add utf8 string as primitive type

This commit is contained in:
AJ ONeal 2018-11-25 23:32:36 -07:00
父節點 36592cedc1
當前提交 6a108e0849
共有 1 個文件被更改,包括 2 次插入2 次删除

查看文件

@ -16,11 +16,11 @@ var PEM = exports.PEM;
ASN1.ELOOP = "uASN1.js Error: iterated over 15+ elements (probably a malformed file)";
ASN1.EDEEP = "uASN1.js Error: element nested 20+ layers deep (probably a malformed file)";
// Container Types are Sequence 0x30, Container Array? (0xA0, 0xA1)
// Value Types are Integer 0x02, Null 0x05, Object ID 0x06, Value Array? (0x82)
// Value Types are Integer 0x02, Null 0x05, Object ID 0x06, String 0x0C, Value Array? (0x82)
// Bit String (0x03) and Octet String (0x04) may be values or containers
// Sometimes Bit String is used as a container (RSA Pub Spki)
ASN1.CTYPES = [ 0x30, 0x31, 0xa0, 0xa1 ];
ASN1.VTYPES = [ 0x02, 0x05, 0x06, 0x82 ];
ASN1.VTYPES = [ 0x02, 0x05, 0x06, 0x0c, 0x82 ];
ASN1.parse = function parseAsn1(buf, depth, ws) {
if (!ws) { ws = ''; }
if (!depth) { depth = 0; }