move asn.1 helper functions to asn1helpers.[ch]
diff --git a/src/asn1helpers.c b/src/asn1helpers.c
new file mode 100644
index 0000000..fe886e3
--- /dev/null
+++ b/src/asn1helpers.c
@@ -0,0 +1,19 @@
+
+#include <string.h>
+
+#include <asn1defs.h>
+
+#include "asn1helpers.h"
+
+int asn1_strncpy(char *out, const ASN1String *in, size_t n)
+{
+	size_t cpylen = n;
+
+	if (in->len < cpylen)
+		cpylen = in->len;
+
+	strncpy(out, (char *)in->buf, cpylen);
+	out[n-1] = '\0';
+
+	return cpylen;
+}