@lapo/asn1js 1.0.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- ASN.1 JavaScript decoder Copyright (c) 2008-2018 Lapo Luchini <lapo@lapo.it>
1
+ ASN.1 JavaScript decoder Copyright (c) 2008-2021 Lapo Luchini <lapo@lapo.it>
2
2
 
3
3
  Permission to use, copy, modify, and/or distribute this software for any
4
4
  purpose with or without fee is hereby granted, provided that the above
package/README.md CHANGED
@@ -5,10 +5,54 @@ asn1js is a JavaScript generic ASN.1 parser/decoder that can decode any valid AS
5
5
 
6
6
  An example page that can decode Base64-encoded (raw base64, PEM armoring and `begin-base64` are recognized) or Hex-encoded (or local files with some browsers) is included and can be used both [online on the official website](https://lapo.it/asn1js/) or [offline (ZIP file)](https://lapo.it/asn1js/asn1js.zip).
7
7
 
8
+ Usage with `npm` / `yarn`
9
+ -------------------------
10
+
11
+ This package can be installed with either npm or yarn via the following commands:
12
+
13
+ ```sh
14
+ npm install @lapo/asn1js
15
+ # or with yarn
16
+ yarn add @lapo/asn1js
17
+ ```
18
+
19
+ Assuming a standard javascript bundler is setup you can import it like so:
20
+
21
+ ```js
22
+ const ASN1 = require('@lapo/asn1js');
23
+ // or with ES modules
24
+ import ASN1 from '@lapo/asn1js';
25
+ ```
26
+
27
+ A submodule of this package can also be imported:
28
+
29
+ ```js
30
+ const Hex = require('@lapo/asn1js/hex');
31
+ // or with ES modules
32
+ import Hex from '@lapo/asn1js/hex';
33
+ ```
34
+
35
+ Usage with RequireJS
36
+ --------------------
37
+
38
+ Can be [tested on JSFiddle](https://jsfiddle.net/lapo/tmdq35ug/).
39
+
40
+ ```html
41
+ <script type="text/javascript" src="https://unpkg.com/requirejs/require.js"></script>
42
+ <script>
43
+ require([
44
+ 'https://unpkg.com/@lapo/asn1js/asn1.js',
45
+ 'https://unpkg.com/@lapo/asn1js/hex.js'
46
+ ], function(ASN1, Hex) {
47
+ document.body.innerText = ASN1.decode(Hex.decode('06032B6570')).content();
48
+ });
49
+ </script>
50
+ ```
51
+
8
52
  ISC license
9
53
  -----------
10
54
 
11
- ASN.1 JavaScript decoder Copyright (c) 2008-2018 Lapo Luchini <lapo@lapo.it>
55
+ ASN.1 JavaScript decoder Copyright (c) 2008-2020 Lapo Luchini <lapo@lapo.it>
12
56
 
13
57
  Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
14
58
 
@@ -28,4 +72,4 @@ links
28
72
  - [official website](https://lapo.it/asn1js/)
29
73
  - [InDefero tracker](http://idf.lapo.it/p/asn1js/)
30
74
  - [GitHub mirror](https://github.com/lapo-luchini/asn1js)
31
- - [Ohloh code stats](https://www.ohloh.net/p/asn1js)
75
+ - [Ohloh code stats](https://www.openhub.net/p/asn1js)
package/asn1.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // ASN.1 JavaScript decoder
2
- // Copyright (c) 2008-2018 Lapo Luchini <lapo@lapo.it>
2
+ // Copyright (c) 2008-2021 Lapo Luchini <lapo@lapo.it>
3
3
 
4
4
  // Permission to use, copy, modify, and/or distribute this software for any
5
5
  // purpose with or without fee is hereby granted, provided that the above
@@ -13,11 +13,14 @@
13
13
  // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
14
  // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
 
16
- (function (undefined) {
16
+ (typeof define != 'undefined' ? define : function (factory) { 'use strict';
17
+ if (typeof module == 'object') module.exports = factory(function (name) { return require(name); });
18
+ else window.asn1 = factory(function (name) { return window[name.substring(2)]; });
19
+ })(function (require) {
17
20
  "use strict";
18
21
 
19
- var Int10 = (typeof module !== 'undefined') ? require('./int10.js') : window.Int10,
20
- oids = (typeof module !== 'undefined') ? require('./oids.js') : window.oids,
22
+ var Int10 = require('./int10'),
23
+ oids = require('./oids'),
21
24
  ellipsis = "\u2026",
22
25
  reTimeS = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
23
26
  reTimeL = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
@@ -98,15 +101,33 @@ Stream.prototype.parseStringISO = function (start, end) {
98
101
  return s;
99
102
  };
100
103
  Stream.prototype.parseStringUTF = function (start, end) {
104
+ function ex(c) { // must be 10xxxxxx
105
+ if ((c < 0x80) || (c >= 0xC0))
106
+ throw new Error('Invalid UTF-8 continuation byte: ' + c);
107
+ return (c & 0x3F);
108
+ }
109
+ function surrogate(cp) {
110
+ if (cp < 0x10000)
111
+ throw new Error('UTF-8 overlong encoding, codepoint encoded in 4 bytes: ' + cp);
112
+ // we could use String.fromCodePoint(cp) but let's be nice to older browsers and use surrogate pairs
113
+ cp -= 0x10000;
114
+ return String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00);
115
+ }
101
116
  var s = "";
102
117
  for (var i = start; i < end; ) {
103
118
  var c = this.get(i++);
104
- if (c < 128)
119
+ if (c < 0x80) // 0xxxxxxx (7 bit)
105
120
  s += String.fromCharCode(c);
106
- else if ((c > 191) && (c < 224))
107
- s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));
121
+ else if (c < 0xC0)
122
+ throw new Error('Invalid UTF-8 starting byte: ' + c);
123
+ else if (c < 0xE0) // 110xxxxx 10xxxxxx (11 bit)
124
+ s += String.fromCharCode(((c & 0x1F) << 6) | ex(this.get(i++)));
125
+ else if (c < 0xF0) // 1110xxxx 10xxxxxx 10xxxxxx (16 bit)
126
+ s += String.fromCharCode(((c & 0x0F) << 12) | (ex(this.get(i++)) << 6) | ex(this.get(i++)));
127
+ else if (c < 0xF8) // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx (21 bit)
128
+ s += surrogate(((c & 0x07) << 18) | (ex(this.get(i++)) << 12) | (ex(this.get(i++)) << 6) | ex(this.get(i++)));
108
129
  else
109
- s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));
130
+ throw new Error('Invalid UTF-8 starting byte (since 2003 it is restricted to 4 bytes): ' + c);
110
131
  }
111
132
  return s;
112
133
  };
@@ -179,33 +200,45 @@ Stream.prototype.parseInteger = function (start, end) {
179
200
  return s + n.toString();
180
201
  };
181
202
  Stream.prototype.parseBitString = function (start, end, maxLength) {
182
- var unusedBit = this.get(start),
183
- lenBit = ((end - start - 1) << 3) - unusedBit,
184
- intro = "(" + lenBit + " bit)\n",
203
+ var unusedBits = this.get(start);
204
+ if (unusedBits > 7)
205
+ throw 'Invalid BitString with unusedBits=' + unusedBits;
206
+ var lenBit = ((end - start - 1) << 3) - unusedBits,
185
207
  s = "";
186
208
  for (var i = start + 1; i < end; ++i) {
187
209
  var b = this.get(i),
188
- skip = (i == end - 1) ? unusedBit : 0;
210
+ skip = (i == end - 1) ? unusedBits : 0;
189
211
  for (var j = 7; j >= skip; --j)
190
212
  s += (b >> j) & 1 ? "1" : "0";
191
213
  if (s.length > maxLength)
192
- return intro + stringCut(s, maxLength);
214
+ s = stringCut(s, maxLength);
193
215
  }
194
- return intro + s;
216
+ return { size: lenBit, str: s };
195
217
  };
196
218
  Stream.prototype.parseOctetString = function (start, end, maxLength) {
197
- if (this.isASCII(start, end))
198
- return stringCut(this.parseStringISO(start, end), maxLength);
199
219
  var len = end - start,
200
- s = "(" + len + " byte)\n";
220
+ s;
221
+ try {
222
+ s = this.parseStringUTF(start, end);
223
+ var v;
224
+ for (i = 0; i < s.length; ++i) {
225
+ v = s.charCodeAt(i);
226
+ if (v < 32 && v != 9 && v != 10 && v != 13) // [\t\r\n] are (kinda) printable
227
+ throw new Error('Unprintable character at index ' + i + ' (code ' + s.charCodeAt(i) + ")");
228
+ }
229
+ return { size: len, str: s };
230
+ } catch (e) {
231
+ // ignore
232
+ }
201
233
  maxLength /= 2; // we work in bytes
202
234
  if (len > maxLength)
203
235
  end = start + maxLength;
236
+ s = '';
204
237
  for (var i = start; i < end; ++i)
205
238
  s += this.hexByte(this.get(i));
206
239
  if (len > maxLength)
207
240
  s += ellipsis;
208
- return s;
241
+ return { size: len, str: s };
209
242
  };
210
243
  Stream.prototype.parseOID = function (start, end, maxLength) {
211
244
  var s = '',
@@ -246,12 +279,13 @@ Stream.prototype.parseOID = function (start, end, maxLength) {
246
279
  return s;
247
280
  };
248
281
 
249
- function ASN1(stream, header, length, tag, sub) {
282
+ function ASN1(stream, header, length, tag, tagLen, sub) {
250
283
  if (!(tag instanceof ASN1Tag)) throw 'Invalid tag value.';
251
284
  this.stream = stream;
252
285
  this.header = header;
253
286
  this.length = length;
254
287
  this.tag = tag;
288
+ this.tagLen = tagLen;
255
289
  this.sub = sub;
256
290
  }
257
291
  ASN1.prototype.typeName = function () {
@@ -292,7 +326,27 @@ ASN1.prototype.typeName = function () {
292
326
  case 3: return "Private_" + this.tag.tagNumber.toString();
293
327
  }
294
328
  };
295
- ASN1.prototype.content = function (maxLength) { // a preview of the content (intended for humans)
329
+ function recurse(el, parser, maxLength) {
330
+ var avoidRecurse = true;
331
+ if (el.tag.tagConstructed && el.sub) {
332
+ avoidRecurse = false;
333
+ el.sub.forEach(function (e1) {
334
+ if (e1.tag.tagClass != el.tag.tagClass || e1.tag.tagNumber != el.tag.tagNumber)
335
+ avoidRecurse = true;
336
+ });
337
+ }
338
+ if (avoidRecurse)
339
+ return el.stream[parser](el.posContent(), el.posContent() + Math.abs(el.length), maxLength);
340
+ var d = { size: 0, str: '' };
341
+ el.sub.forEach(function (el) {
342
+ var d1 = recurse(el, parser, maxLength - d.str.length);
343
+ d.size += d1.size;
344
+ d.str += d1.str;
345
+ });
346
+ return d;
347
+ }
348
+ /** A string preview of the content (intended for humans). */
349
+ ASN1.prototype.content = function (maxLength) {
296
350
  if (this.tag === undefined)
297
351
  return null;
298
352
  if (maxLength === undefined)
@@ -302,7 +356,8 @@ ASN1.prototype.content = function (maxLength) { // a preview of the content (int
302
356
  if (!this.tag.isUniversal()) {
303
357
  if (this.sub !== null)
304
358
  return "(" + this.sub.length + " elem)";
305
- return this.stream.parseOctetString(content, content + len, maxLength);
359
+ var d1 = this.stream.parseOctetString(content, content + len, maxLength);
360
+ return "(" + d1.size + " byte)\n" + d1.str;
306
361
  }
307
362
  switch (this.tag.tagNumber) {
308
363
  case 0x01: // BOOLEAN
@@ -310,18 +365,19 @@ ASN1.prototype.content = function (maxLength) { // a preview of the content (int
310
365
  case 0x02: // INTEGER
311
366
  return this.stream.parseInteger(content, content + len);
312
367
  case 0x03: // BIT_STRING
313
- return this.sub ? "(" + this.sub.length + " elem)" :
314
- this.stream.parseBitString(content, content + len, maxLength);
368
+ var d = recurse(this, 'parseBitString', maxLength);
369
+ return "(" + d.size + " bit)\n" + d.str;
315
370
  case 0x04: // OCTET_STRING
316
- return this.sub ? "(" + this.sub.length + " elem)" :
317
- this.stream.parseOctetString(content, content + len, maxLength);
371
+ d = recurse(this, 'parseOctetString', maxLength);
372
+ return "(" + d.size + " byte)\n" + d.str;
318
373
  //case 0x05: // NULL
319
374
  case 0x06: // OBJECT_IDENTIFIER
320
375
  return this.stream.parseOID(content, content + len, maxLength);
321
376
  //case 0x07: // ObjectDescriptor
322
377
  //case 0x08: // EXTERNAL
323
378
  //case 0x09: // REAL
324
- //case 0x0A: // ENUMERATED
379
+ case 0x0A: // ENUMERATED
380
+ return this.stream.parseInteger(content, content + len);
325
381
  //case 0x0B: // EMBEDDED_PDV
326
382
  case 0x10: // SEQUENCE
327
383
  case 0x11: // SET
@@ -336,9 +392,9 @@ ASN1.prototype.content = function (maxLength) { // a preview of the content (int
336
392
  case 0x14: // TeletexString
337
393
  case 0x15: // VideotexString
338
394
  case 0x16: // IA5String
339
- //case 0x19: // GraphicString
340
395
  case 0x1A: // VisibleString
341
- //case 0x1B: // GeneralString
396
+ case 0x1B: // GeneralString
397
+ //case 0x19: // GraphicString
342
398
  //case 0x1C: // UniversalString
343
399
  return stringCut(this.stream.parseStringISO(content, content + len), maxLength);
344
400
  case 0x1E: // BMPString
@@ -382,6 +438,10 @@ ASN1.prototype.posContent = function () {
382
438
  ASN1.prototype.posEnd = function () {
383
439
  return this.stream.pos + this.header + Math.abs(this.length);
384
440
  };
441
+ /** Position of the length. */
442
+ ASN1.prototype.posLen = function() {
443
+ return this.stream.pos + this.tagLen;
444
+ };
385
445
  ASN1.prototype.toHexString = function () {
386
446
  return this.stream.hexDump(this.posStart(), this.posEnd(), true);
387
447
  };
@@ -391,12 +451,12 @@ ASN1.prototype.toB64String = function () {
391
451
  ASN1.decodeLength = function (stream) {
392
452
  var buf = stream.get(),
393
453
  len = buf & 0x7F;
394
- if (len == buf)
454
+ if (len == buf) // first bit was 0, short form
395
455
  return len;
456
+ if (len === 0) // long form with length 0 is a special case
457
+ return null; // undefined length
396
458
  if (len > 6) // no reason to use Int10, as it would be a huge buffer anyways
397
459
  throw "Length over 48 bits not supported at position " + (stream.pos - 1);
398
- if (len === 0)
399
- return null; // undefined
400
460
  buf = 0;
401
461
  for (var i = 0; i < len; ++i)
402
462
  buf = (buf * 256) + stream.get();
@@ -422,11 +482,12 @@ ASN1Tag.prototype.isUniversal = function () {
422
482
  ASN1Tag.prototype.isEOC = function () {
423
483
  return this.tagClass === 0x00 && this.tagNumber === 0x00;
424
484
  };
425
- ASN1.decode = function (stream) {
485
+ ASN1.decode = function (stream, offset) {
426
486
  if (!(stream instanceof Stream))
427
- stream = new Stream(stream, 0);
487
+ stream = new Stream(stream, offset || 0);
428
488
  var streamStart = new Stream(stream),
429
489
  tag = new ASN1Tag(stream),
490
+ tagLen = stream.pos - streamStart.pos,
430
491
  len = ASN1.decodeLength(stream),
431
492
  start = stream.pos,
432
493
  header = start - streamStart.pos,
@@ -481,9 +542,9 @@ ASN1.decode = function (stream) {
481
542
  throw "We can't skip over an invalid tag with undefined length at offset " + start;
482
543
  stream.pos = start + Math.abs(len);
483
544
  }
484
- return new ASN1(streamStart, header, len, tag, sub);
545
+ return new ASN1(streamStart, header, len, tag, tagLen, sub);
485
546
  };
486
547
 
487
- // export globals
488
- if (typeof module !== 'undefined') { module.exports = ASN1; } else { window.ASN1 = ASN1; }
489
- })();
548
+ return ASN1;
549
+
550
+ });
package/base64.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Base64 JavaScript decoder
2
- // Copyright (c) 2008-2018 Lapo Luchini <lapo@lapo.it>
2
+ // Copyright (c) 2008-2021 Lapo Luchini <lapo@lapo.it>
3
3
 
4
4
  // Permission to use, copy, modify, and/or distribute this software for any
5
5
  // purpose with or without fee is hereby granted, provided that the above
@@ -13,31 +13,36 @@
13
13
  // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
14
  // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
 
16
- (function (undefined) {
16
+ (typeof define != 'undefined' ? define : function (factory) { 'use strict';
17
+ if (typeof module == 'object') module.exports = factory();
18
+ else window.base64 = factory();
19
+ })(function () {
17
20
  "use strict";
18
21
 
19
22
  var Base64 = {},
20
- decoder;
23
+ decoder, // populated on first usage
24
+ haveU8 = (typeof Uint8Array == 'function');
21
25
 
22
26
  Base64.decode = function (a) {
27
+ var isString = (typeof a == 'string');
23
28
  var i;
24
29
  if (decoder === undefined) {
25
30
  var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
26
31
  ignore = "= \f\n\r\t\u00A0\u2028\u2029";
27
32
  decoder = [];
28
33
  for (i = 0; i < 64; ++i)
29
- decoder[b64.charAt(i)] = i;
34
+ decoder[b64.charCodeAt(i)] = i;
30
35
  for (i = 0; i < ignore.length; ++i)
31
- decoder[ignore.charAt(i)] = -1;
36
+ decoder[ignore.charCodeAt(i)] = -1;
32
37
  // RFC 3548 URL & file safe encoding
33
- decoder['-'] = decoder['+'];
34
- decoder['_'] = decoder['/'];
38
+ decoder['-'.charCodeAt(0)] = decoder['+'.charCodeAt(0)];
39
+ decoder['_'.charCodeAt(0)] = decoder['/'.charCodeAt(0)];
35
40
  }
36
- var out = [];
37
- var bits = 0, char_count = 0;
41
+ var out = haveU8 ? new Uint8Array(a.length * 3 >> 2) : [];
42
+ var bits = 0, char_count = 0, len = 0;
38
43
  for (i = 0; i < a.length; ++i) {
39
- var c = a.charAt(i);
40
- if (c == '=')
44
+ var c = isString ? a.charCodeAt(i) : a[i];
45
+ if (c == 61) // '='.charCodeAt(0)
41
46
  break;
42
47
  c = decoder[c];
43
48
  if (c == -1)
@@ -46,9 +51,9 @@ Base64.decode = function (a) {
46
51
  throw 'Illegal character at offset ' + i;
47
52
  bits |= c;
48
53
  if (++char_count >= 4) {
49
- out[out.length] = (bits >> 16);
50
- out[out.length] = (bits >> 8) & 0xFF;
51
- out[out.length] = bits & 0xFF;
54
+ out[len++] = (bits >> 16);
55
+ out[len++] = (bits >> 8) & 0xFF;
56
+ out[len++] = bits & 0xFF;
52
57
  bits = 0;
53
58
  char_count = 0;
54
59
  } else {
@@ -59,13 +64,15 @@ Base64.decode = function (a) {
59
64
  case 1:
60
65
  throw "Base64 encoding incomplete: at least 2 bits missing";
61
66
  case 2:
62
- out[out.length] = (bits >> 10);
67
+ out[len++] = (bits >> 10);
63
68
  break;
64
69
  case 3:
65
- out[out.length] = (bits >> 16);
66
- out[out.length] = (bits >> 8) & 0xFF;
70
+ out[len++] = (bits >> 16);
71
+ out[len++] = (bits >> 8) & 0xFF;
67
72
  break;
68
73
  }
74
+ if (haveU8 && out.length > len) // in case it was originally longer because of ignored characters
75
+ out = out.subarray(0, len);
69
76
  return out;
70
77
  };
71
78
 
@@ -79,7 +86,7 @@ Base64.pretty = function (str) {
79
86
  return str.replace(/(.{80})/g, '$1\n');
80
87
  };
81
88
 
82
- Base64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;
89
+ Base64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+/=\s]+)====|^([A-Za-z0-9+/=\s]+)$/;
83
90
  Base64.unarmor = function (a) {
84
91
  var m = Base64.re.exec(a);
85
92
  if (m) {
@@ -87,12 +94,14 @@ Base64.unarmor = function (a) {
87
94
  a = m[1];
88
95
  else if (m[2])
89
96
  a = m[2];
97
+ else if (m[3])
98
+ a = m[3];
90
99
  else
91
100
  throw "RegExp out of sync";
92
101
  }
93
102
  return Base64.decode(a);
94
103
  };
95
104
 
96
- // export globals
97
- if (typeof module !== 'undefined') { module.exports = Base64; } else { window.Base64 = Base64; }
98
- })();
105
+ return Base64;
106
+
107
+ });
package/hex.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Hex JavaScript decoder
2
- // Copyright (c) 2008-2018 Lapo Luchini <lapo@lapo.it>
2
+ // Copyright (c) 2008-2021 Lapo Luchini <lapo@lapo.it>
3
3
 
4
4
  // Permission to use, copy, modify, and/or distribute this software for any
5
5
  // purpose with or without fee is hereby granted, provided that the above
@@ -13,33 +13,41 @@
13
13
  // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
14
  // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
 
16
- (function (undefined) {
16
+ (typeof define != 'undefined' ? define : function (factory) { 'use strict';
17
+ if (typeof module == 'object') module.exports = factory();
18
+ else window.hex = factory();
19
+ })(function () {
17
20
  "use strict";
18
21
 
19
22
  var Hex = {},
20
- decoder;
23
+ decoder, // populated on first usage
24
+ haveU8 = (typeof Uint8Array == 'function');
21
25
 
26
+ /**
27
+ * Decodes an hexadecimal value.
28
+ * @param {string|Array|Uint8Array} a - a string representing hexadecimal data, or an array representation of its charcodes
29
+ */
22
30
  Hex.decode = function(a) {
31
+ var isString = (typeof a == 'string');
23
32
  var i;
24
33
  if (decoder === undefined) {
25
34
  var hex = "0123456789ABCDEF",
26
35
  ignore = " \f\n\r\t\u00A0\u2028\u2029";
27
36
  decoder = [];
28
37
  for (i = 0; i < 16; ++i)
29
- decoder[hex.charAt(i)] = i;
38
+ decoder[hex.charCodeAt(i)] = i;
30
39
  hex = hex.toLowerCase();
31
40
  for (i = 10; i < 16; ++i)
32
- decoder[hex.charAt(i)] = i;
41
+ decoder[hex.charCodeAt(i)] = i;
33
42
  for (i = 0; i < ignore.length; ++i)
34
- decoder[ignore.charAt(i)] = -1;
43
+ decoder[ignore.charCodeAt(i)] = -1;
35
44
  }
36
- var out = [],
45
+ var out = haveU8 ? new Uint8Array(a.length >> 1) : [],
37
46
  bits = 0,
38
- char_count = 0;
47
+ char_count = 0,
48
+ len = 0;
39
49
  for (i = 0; i < a.length; ++i) {
40
- var c = a.charAt(i);
41
- if (c == '=')
42
- break;
50
+ var c = isString ? a.charCodeAt(i) : a[i];
43
51
  c = decoder[c];
44
52
  if (c == -1)
45
53
  continue;
@@ -47,7 +55,7 @@ Hex.decode = function(a) {
47
55
  throw 'Illegal character at offset ' + i;
48
56
  bits |= c;
49
57
  if (++char_count >= 2) {
50
- out[out.length] = bits;
58
+ out[len++] = bits;
51
59
  bits = 0;
52
60
  char_count = 0;
53
61
  } else {
@@ -56,9 +64,11 @@ Hex.decode = function(a) {
56
64
  }
57
65
  if (char_count)
58
66
  throw "Hex encoding incomplete: 4 bits missing";
67
+ if (haveU8 && out.length > len) // in case it was originally longer because of ignored characters
68
+ out = out.subarray(0, len);
59
69
  return out;
60
70
  };
61
71
 
62
- // export globals
63
- if (typeof module !== 'undefined') { module.exports = Hex; } else { window.Hex = Hex; }
64
- })();
72
+ return Hex;
73
+
74
+ });
package/int10.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Big integer base-10 printing library
2
- // Copyright (c) 2014-2018 Lapo Luchini <lapo@lapo.it>
2
+ // Copyright (c) 2008-2021 Lapo Luchini <lapo@lapo.it>
3
3
 
4
4
  // Permission to use, copy, modify, and/or distribute this software for any
5
5
  // purpose with or without fee is hereby granted, provided that the above
@@ -13,15 +13,27 @@
13
13
  // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
14
  // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
15
 
16
- (function () {
16
+ (typeof define != 'undefined' ? define : function (factory) { 'use strict';
17
+ if (typeof module == 'object') module.exports = factory();
18
+ else window.int10 = factory();
19
+ })(function () {
17
20
  "use strict";
18
21
 
19
22
  var max = 10000000000000; // biggest 10^n integer that can still fit 2^53 when multiplied by 256
20
23
 
24
+ /**
25
+ * Arbitrary length base-10 value.
26
+ * @param {number} value - Optional initial value (will be 0 otherwise).
27
+ */
21
28
  function Int10(value) {
22
29
  this.buf = [+value || 0];
23
30
  }
24
31
 
32
+ /**
33
+ * Multiply value by m and add c.
34
+ * @param {number} m - multiplier, must be < =256
35
+ * @param {number} c - value to add
36
+ */
25
37
  Int10.prototype.mulAdd = function (m, c) {
26
38
  // assert(m <= 256)
27
39
  var b = this.buf,
@@ -41,8 +53,11 @@ Int10.prototype.mulAdd = function (m, c) {
41
53
  b[i] = c;
42
54
  };
43
55
 
56
+ /**
57
+ * Subtract value.
58
+ * @param {number} c - value to subtract
59
+ */
44
60
  Int10.prototype.sub = function (c) {
45
- // assert(m <= 256)
46
61
  var b = this.buf,
47
62
  l = b.length,
48
63
  i, t;
@@ -59,6 +74,10 @@ Int10.prototype.sub = function (c) {
59
74
  b.pop();
60
75
  };
61
76
 
77
+ /**
78
+ * Convert to decimal string representation.
79
+ * @param {*} base - optional value, only value accepted is 10
80
+ */
62
81
  Int10.prototype.toString = function (base) {
63
82
  if ((base || 10) != 10)
64
83
  throw 'only base 10 is supported';
@@ -69,6 +88,10 @@ Int10.prototype.toString = function (base) {
69
88
  return s;
70
89
  };
71
90
 
91
+ /**
92
+ * Convert to Number value representation.
93
+ * Will probably overflow 2^53 and thus become approximate.
94
+ */
72
95
  Int10.prototype.valueOf = function () {
73
96
  var b = this.buf,
74
97
  v = 0;
@@ -77,11 +100,14 @@ Int10.prototype.valueOf = function () {
77
100
  return v;
78
101
  };
79
102
 
103
+ /**
104
+ * Return value as a simple Number (if it is <= 10000000000000), or return this.
105
+ */
80
106
  Int10.prototype.simplify = function () {
81
107
  var b = this.buf;
82
108
  return (b.length == 1) ? b[0] : this;
83
109
  };
84
110
 
85
- // export globals
86
- if (typeof module !== 'undefined') { module.exports = Int10; } else { window.Int10 = Int10; }
87
- })();
111
+ return Int10;
112
+
113
+ });
package/oids.js CHANGED
@@ -2,7 +2,12 @@
2
2
  // which is made by Peter Gutmann and whose license states:
3
3
  // You can use this code in whatever way you want,
4
4
  // as long as you don't try to claim you wrote it.
5
- var oids = {
5
+ (typeof define != 'undefined' ? define : function (factory) { 'use strict';
6
+ if (typeof module == 'object') module.exports = factory();
7
+ else window.oids = factory();
8
+ })(function () {
9
+ 'use strict';
10
+ return {
6
11
  "0.2.262.1.10": { "d": "Telesec", "c": "Deutsche Telekom" },
7
12
  "0.2.262.1.10.0": { "d": "extension", "c": "Telesec" },
8
13
  "0.2.262.1.10.1": { "d": "mechanism", "c": "Telesec" },
@@ -302,6 +307,9 @@ var oids = {
302
307
  "1.0.10118.3.0.49": { "d": "ripemd160", "c": "ISO 10118-3 hash function" },
303
308
  "1.0.10118.3.0.50": { "d": "ripemd128", "c": "ISO 10118-3 hash function" },
304
309
  "1.0.10118.3.0.55": { "d": "whirlpool", "c": "ISO 10118-3 hash function" },
310
+ "1.0.18033.2": { "d": "iso18033-2", "c": "ISO 18033-2" },
311
+ "1.0.18033.2.2": { "d": "kem", "c": "ISO 18033-2 algorithms" },
312
+ "1.0.18033.2.2.4": { "d": "kemRSA", "c": "ISO 18033-2 KEM algorithms" },
305
313
  "1.2.36.1.3.1.1.1": { "d": "qgpki", "c": "Queensland Government PKI" },
306
314
  "1.2.36.1.3.1.1.1.1": { "d": "qgpkiPolicies", "c": "QGPKI policies" },
307
315
  "1.2.36.1.3.1.1.1.1.1": { "d": "qgpkiMedIntermedCA", "c": "QGPKI policy" },
@@ -702,6 +710,7 @@ var oids = {
702
710
  "1.2.840.113549.1.9.16.0.7": { "d": "id-mod-ets-eSigPolicy-88", "c": "S/MIME Modules" },
703
711
  "1.2.840.113549.1.9.16.0.8": { "d": "id-mod-ets-eSigPolicy-88", "c": "S/MIME Modules" },
704
712
  "1.2.840.113549.1.9.16.1": { "d": "contentType", "c": "S/MIME" },
713
+ "1.2.840.113549.1.9.16.1.0": { "d": "anyContentType", "c": "S/MIME Content Types" },
705
714
  "1.2.840.113549.1.9.16.1.1": { "d": "receipt", "c": "S/MIME Content Types" },
706
715
  "1.2.840.113549.1.9.16.1.2": { "d": "authData", "c": "S/MIME Content Types" },
707
716
  "1.2.840.113549.1.9.16.1.3": { "d": "publishCert", "c": "S/MIME Content Types" },
@@ -736,6 +745,19 @@ var oids = {
736
745
  "1.2.840.113549.1.9.16.1.32": { "d": "asAdjacencyAttest", "c": "S/MIME Content Types", "w": true },
737
746
  "1.2.840.113549.1.9.16.1.33": { "d": "rpkiTrustAnchor", "c": "S/MIME Content Types" },
738
747
  "1.2.840.113549.1.9.16.1.34": { "d": "trustAnchorList", "c": "S/MIME Content Types" },
748
+ "1.2.840.113549.1.9.16.1.35": { "d": "rpkiGhostbusters", "c": "S/MIME Content Types" },
749
+ "1.2.840.113549.1.9.16.1.36": { "d": "resourceTaggedAttest", "c": "S/MIME Content Types" },
750
+ "1.2.840.113549.1.9.16.1.37": { "d": "utf8TextWithCRLF", "c": "S/MIME Content Types" },
751
+ "1.2.840.113549.1.9.16.1.38": { "d": "htmlWithCRLF", "c": "S/MIME Content Types" },
752
+ "1.2.840.113549.1.9.16.1.39": { "d": "epub", "c": "S/MIME Content Types" },
753
+ "1.2.840.113549.1.9.16.1.40": { "d": "animaJSONVoucher", "c": "S/MIME Content Types" },
754
+ "1.2.840.113549.1.9.16.1.41": { "d": "mudType", "c": "S/MIME Content Types" },
755
+ "1.2.840.113549.1.9.16.1.42": { "d": "sztpConveyedInfoXML", "c": "S/MIME Content Types" },
756
+ "1.2.840.113549.1.9.16.1.43": { "d": "sztpConveyedInfoJSON", "c": "S/MIME Content Types" },
757
+ "1.2.840.113549.1.9.16.1.44": { "d": "cbor", "c": "S/MIME Content Types" },
758
+ "1.2.840.113549.1.9.16.1.45": { "d": "cborSequence", "c": "S/MIME Content Types" },
759
+ "1.2.840.113549.1.9.16.1.46": { "d": "animaCBORVoucher", "c": "S/MIME Content Types", "w": true },
760
+ "1.2.840.113549.1.9.16.1.47": { "d": "geofeedCSVwithCRLF", "c": "S/MIME Content Types" },
739
761
  "1.2.840.113549.1.9.16.2": { "d": "authenticatedAttributes", "c": "S/MIME" },
740
762
  "1.2.840.113549.1.9.16.2.1": { "d": "receiptRequest", "c": "S/MIME Authenticated Attributes" },
741
763
  "1.2.840.113549.1.9.16.2.2": { "d": "securityLabel", "c": "S/MIME Authenticated Attributes" },
@@ -788,6 +810,13 @@ var oids = {
788
810
  "1.2.840.113549.1.9.16.2.49": { "d": "erInternal", "c": "S/MIME Authenticated Attributes" },
789
811
  "1.2.840.113549.1.9.16.2.50": { "d": "erExternal", "c": "S/MIME Authenticated Attributes" },
790
812
  "1.2.840.113549.1.9.16.2.51": { "d": "multipleSignatures", "c": "S/MIME Authenticated Attributes" },
813
+ "1.2.840.113549.1.9.16.2.52": { "d": "cmsAlgorithmProtect", "c": "S/MIME Authenticated Attributes" },
814
+ "1.2.840.113549.1.9.16.2.53": { "d": "setKeyInformation", "c": "S/MIME Authenticated Attributes" },
815
+ "1.2.840.113549.1.9.16.2.54": { "d": "asymmDecryptKeyID", "c": "S/MIME Authenticated Attributes" },
816
+ "1.2.840.113549.1.9.16.2.55": { "d": "secureHeaderFieldsIdentifier", "c": "S/MIME Authenticated Attributes" },
817
+ "1.2.840.113549.1.9.16.2.56": { "d": "otpChallenge", "c": "S/MIME Authenticated Attributes" },
818
+ "1.2.840.113549.1.9.16.2.57": { "d": "revocationChallenge", "c": "S/MIME Authenticated Attributes" },
819
+ "1.2.840.113549.1.9.16.2.58": { "d": "estIdentityLinking", "c": "S/MIME Authenticated Attributes" },
791
820
  "1.2.840.113549.1.9.16.3.1": { "d": "esDHwith3DES", "c": "S/MIME Algorithms. Obsolete", "w": true },
792
821
  "1.2.840.113549.1.9.16.3.2": { "d": "esDHwithRC2", "c": "S/MIME Algorithms. Obsolete", "w": true },
793
822
  "1.2.840.113549.1.9.16.3.3": { "d": "3desWrap", "c": "S/MIME Algorithms. Obsolete", "w": true },
@@ -804,9 +833,20 @@ var oids = {
804
833
  "1.2.840.113549.1.9.16.3.14": { "d": "rsaKEM", "c": "S/MIME Algorithms" },
805
834
  "1.2.840.113549.1.9.16.3.15": { "d": "authEnc128", "c": "S/MIME Algorithms" },
806
835
  "1.2.840.113549.1.9.16.3.16": { "d": "authEnc256", "c": "S/MIME Algorithms" },
836
+ "1.2.840.113549.1.9.16.3.17": { "d": "hssLmsHashSig", "c": "S/MIME Algorithms" },
837
+ "1.2.840.113549.1.9.16.3.18": { "d": "chaCha20Poly1305", "c": "S/MIME Algorithms" },
807
838
  "1.2.840.113549.1.9.16.3.19": { "d": "ecdhHKDF-SHA256", "c": "S/MIME Algorithms" },
808
839
  "1.2.840.113549.1.9.16.3.20": { "d": "ecdhHKDF-SHA384", "c": "S/MIME Algorithms" },
809
840
  "1.2.840.113549.1.9.16.3.21": { "d": "ecdhHKDF-SHA512", "c": "S/MIME Algorithms" },
841
+ "1.2.840.113549.1.9.16.3.22": { "d": "aesSIV-CMAC-256", "c": "S/MIME Algorithms" },
842
+ "1.2.840.113549.1.9.16.3.23": { "d": "aesSIV-CMAC-384", "c": "S/MIME Algorithms" },
843
+ "1.2.840.113549.1.9.16.3.24": { "d": "aesSIV-CMAC-512", "c": "S/MIME Algorithms" },
844
+ "1.2.840.113549.1.9.16.3.25": { "d": "aesSIV-CMAC-wrap256", "c": "S/MIME Algorithms" },
845
+ "1.2.840.113549.1.9.16.3.26": { "d": "aesSIV-CMAC-wrap384", "c": "S/MIME Algorithms" },
846
+ "1.2.840.113549.1.9.16.3.27": { "d": "aesSIV-CMAC-wrap512", "c": "S/MIME Algorithms" },
847
+ "1.2.840.113549.1.9.16.3.28": { "d": "hkdfWithSha256", "c": "S/MIME Algorithms" },
848
+ "1.2.840.113549.1.9.16.3.29": { "d": "hkdfWithSha384", "c": "S/MIME Algorithms" },
849
+ "1.2.840.113549.1.9.16.3.30": { "d": "hkdfWithSha512", "c": "S/MIME Algorithms" },
810
850
  "1.2.840.113549.1.9.16.4.1": { "d": "certDist-ldap", "c": "S/MIME Certificate Distribution" },
811
851
  "1.2.840.113549.1.9.16.5.1": { "d": "sigPolicyQualifier-spuri x", "c": "S/MIME Signature Policy Qualifiers" },
812
852
  "1.2.840.113549.1.9.16.5.2": { "d": "sigPolicyQualifier-spUserNotice", "c": "S/MIME Signature Policy Qualifiers" },
@@ -816,6 +856,10 @@ var oids = {
816
856
  "1.2.840.113549.1.9.16.6.4": { "d": "proofOfSender", "c": "S/MIME Commitment Type Identifiers" },
817
857
  "1.2.840.113549.1.9.16.6.5": { "d": "proofOfApproval", "c": "S/MIME Commitment Type Identifiers" },
818
858
  "1.2.840.113549.1.9.16.6.6": { "d": "proofOfCreation", "c": "S/MIME Commitment Type Identifiers" },
859
+ "1.2.840.113549.1.9.16.7.1": { "d": "testAmoco", "c": "S/MIMETest Security Policies" },
860
+ "1.2.840.113549.1.9.16.7.2": { "d": "testCaterpillar", "c": "S/MIMETest Security Policies" },
861
+ "1.2.840.113549.1.9.16.7.3": { "d": "testWhirlpool", "c": "S/MIMETest Security Policies" },
862
+ "1.2.840.113549.1.9.16.7.4": { "d": "testWhirlpoolCategories", "c": "S/MIMETest Security Policies" },
819
863
  "1.2.840.113549.1.9.16.8.1": { "d": "glUseKEK", "c": "S/MIME Symmetric Key Distribution Attributes" },
820
864
  "1.2.840.113549.1.9.16.8.2": { "d": "glDelete", "c": "S/MIME Symmetric Key Distribution Attributes" },
821
865
  "1.2.840.113549.1.9.16.8.3": { "d": "glAddMember", "c": "S/MIME Symmetric Key Distribution Attributes" },
@@ -836,8 +880,46 @@ var oids = {
836
880
  "1.2.840.113549.1.9.16.9.2": { "d": "domainSig", "c": "S/MIME Signature Type Identifier" },
837
881
  "1.2.840.113549.1.9.16.9.3": { "d": "additionalAttributesSig", "c": "S/MIME Signature Type Identifier" },
838
882
  "1.2.840.113549.1.9.16.9.4": { "d": "reviewSig", "c": "S/MIME Signature Type Identifier" },
883
+ "1.2.840.113549.1.9.16.10.1": { "d": "envelopedData", "c": "S/MIME X.400 Encoded Information Types" },
884
+ "1.2.840.113549.1.9.16.10.2": { "d": "signedData", "c": "S/MIME X.400 Encoded Information Types" },
885
+ "1.2.840.113549.1.9.16.10.3": { "d": "certsOnly", "c": "S/MIME X.400 Encoded Information Types" },
886
+ "1.2.840.113549.1.9.16.10.4": { "d": "signedReceipt", "c": "S/MIME X.400 Encoded Information Types" },
887
+ "1.2.840.113549.1.9.16.10.5": { "d": "envelopedX400", "c": "S/MIME X.400 Encoded Information Types" },
888
+ "1.2.840.113549.1.9.16.10.6": { "d": "signedX400", "c": "S/MIME X.400 Encoded Information Types" },
889
+ "1.2.840.113549.1.9.16.10.7": { "d": "compressedData", "c": "S/MIME X.400 Encoded Information Types" },
839
890
  "1.2.840.113549.1.9.16.11": { "d": "capabilities", "c": "S/MIME" },
840
891
  "1.2.840.113549.1.9.16.11.1": { "d": "preferBinaryInside", "c": "S/MIME Capability" },
892
+ "1.2.840.113549.1.9.16.12": { "d": "pskcAttributes", "c": "S/MIME Portable Symmetric Key Container Attributes" },
893
+ "1.2.840.113549.1.9.16.12.1": { "d": "pskcManufacturer", "c": "S/MIME Portable Symmetric Key Container Attributes" },
894
+ "1.2.840.113549.1.9.16.12.2": { "d": "pskcSerialNo", "c": "S/MIME Portable Symmetric Key Container Attributes" },
895
+ "1.2.840.113549.1.9.16.12.3": { "d": "pskcModel", "c": "S/MIME Portable Symmetric Key Container Attributes" },
896
+ "1.2.840.113549.1.9.16.12.4": { "d": "pskcIssueno", "c": "S/MIME Portable Symmetric Key Container Attributes" },
897
+ "1.2.840.113549.1.9.16.12.5": { "d": "pskcDevicebinding", "c": "S/MIME Portable Symmetric Key Container Attributes" },
898
+ "1.2.840.113549.1.9.16.12.6": { "d": "pskcDevicestartdate", "c": "S/MIME Portable Symmetric Key Container Attributes" },
899
+ "1.2.840.113549.1.9.16.12.7": { "d": "pskcDeviceexpirydate", "c": "S/MIME Portable Symmetric Key Container Attributes" },
900
+ "1.2.840.113549.1.9.16.12.8": { "d": "pskcModuleid", "c": "S/MIME Portable Symmetric Key Container Attributes" },
901
+ "1.2.840.113549.1.9.16.12.9": { "d": "pskcKeyid", "c": "S/MIME Portable Symmetric Key Container Attributes" },
902
+ "1.2.840.113549.1.9.16.12.10": { "d": "pskcAlgorithm", "c": "S/MIME Portable Symmetric Key Container Attributes" },
903
+ "1.2.840.113549.1.9.16.12.11": { "d": "pskcIssuer", "c": "S/MIME Portable Symmetric Key Container Attributes" },
904
+ "1.2.840.113549.1.9.16.12.12": { "d": "pskcKeyprofileid", "c": "S/MIME Portable Symmetric Key Container Attributes" },
905
+ "1.2.840.113549.1.9.16.12.13": { "d": "pskcKeyreference", "c": "S/MIME Portable Symmetric Key Container Attributes" },
906
+ "1.2.840.113549.1.9.16.12.14": { "d": "pskcFriendlyname", "c": "S/MIME Portable Symmetric Key Container Attributes" },
907
+ "1.2.840.113549.1.9.16.12.15": { "d": "pskcAlgorithmparams", "c": "S/MIME Portable Symmetric Key Container Attributes" },
908
+ "1.2.840.113549.1.9.16.12.16": { "d": "pskcCounter", "c": "S/MIME Portable Symmetric Key Container Attributes" },
909
+ "1.2.840.113549.1.9.16.12.17": { "d": "pskcTime", "c": "S/MIME Portable Symmetric Key Container Attributes" },
910
+ "1.2.840.113549.1.9.16.12.18": { "d": "pskcTimeinterval", "c": "S/MIME Portable Symmetric Key Container Attributes" },
911
+ "1.2.840.113549.1.9.16.12.19": { "d": "pskcTimedrift", "c": "S/MIME Portable Symmetric Key Container Attributes" },
912
+ "1.2.840.113549.1.9.16.12.20": { "d": "pskcValuemac", "c": "S/MIME Portable Symmetric Key Container Attributes" },
913
+ "1.2.840.113549.1.9.16.12.21": { "d": "pskcKeystartdate", "c": "S/MIME Portable Symmetric Key Container Attributes" },
914
+ "1.2.840.113549.1.9.16.12.22": { "d": "pskcKeyexpirydate", "c": "S/MIME Portable Symmetric Key Container Attributes" },
915
+ "1.2.840.113549.1.9.16.12.23": { "d": "pskcNooftransactions", "c": "S/MIME Portable Symmetric Key Container Attributes" },
916
+ "1.2.840.113549.1.9.16.12.24": { "d": "pskcKeyusages", "c": "S/MIME Portable Symmetric Key Container Attributes" },
917
+ "1.2.840.113549.1.9.16.12.25": { "d": "pskcPinpolicy", "c": "S/MIME Portable Symmetric Key Container Attributes" },
918
+ "1.2.840.113549.1.9.16.12.26": { "d": "pskcDeviceuserid", "c": "S/MIME Portable Symmetric Key Container Attributes" },
919
+ "1.2.840.113549.1.9.16.12.27": { "d": "pskcKeyuserid", "c": "S/MIME Portable Symmetric Key Container Attributes" },
920
+ "1.2.840.113549.1.9.16.13": { "d": "otherRecipientInfoIds", "c": "S/MIME Other Recipient Info Identifiers" },
921
+ "1.2.840.113549.1.9.16.13.1": { "d": "keyTransPSK", "c": "S/MIME Other Recipient Info Identifiers" },
922
+ "1.2.840.113549.1.9.16.13.2": { "d": "keyAgreePSK", "c": "S/MIME Other Recipient Info Identifiers" },
841
923
  "1.2.840.113549.1.9.20": { "d": "friendlyName (for PKCS #12)", "c": "PKCS #9 via PKCS #12" },
842
924
  "1.2.840.113549.1.9.21": { "d": "localKeyID (for PKCS #12)", "c": "PKCS #9 via PKCS #12" },
843
925
  "1.2.840.113549.1.9.22": { "d": "certTypes (for PKCS #12)", "c": "PKCS #9 via PKCS #12" },
@@ -1039,6 +1121,9 @@ var oids = {
1039
1121
  "1.2.840.113635.100.6.1.1": { "d": "appleCertificateExtensionAppleSigning", "c": "Apple certificate extension" },
1040
1122
  "1.2.840.113635.100.6.1.2": { "d": "appleCertificateExtensionADCDeveloperSigning", "c": "Apple certificate extension" },
1041
1123
  "1.2.840.113635.100.6.1.3": { "d": "appleCertificateExtensionADCAppleSigning", "c": "Apple certificate extension" },
1124
+ "1.2.840.113635.100.15.1": { "d": "appleCustomCertificateExtension1", "c": "Apple custom certificate extension" },
1125
+ "1.2.840.113635.100.15.2": { "d": "appleCustomCertificateExtension2", "c": "Apple custom certificate extension" },
1126
+ "1.2.840.113635.100.15.3": { "d": "appleCustomCertificateExtension3", "c": "Apple custom certificate extension" },
1042
1127
  "1.3.6.1.4.1.311.2.1.4": { "d": "spcIndirectDataContext", "c": "Microsoft code signing" },
1043
1128
  "1.3.6.1.4.1.311.2.1.10": { "d": "spcAgencyInfo", "c": "Microsoft code signing. Also known as policyLink" },
1044
1129
  "1.3.6.1.4.1.311.2.1.11": { "d": "spcStatementType", "c": "Microsoft code signing" },
@@ -1145,6 +1230,7 @@ var oids = {
1145
1230
  "1.3.6.1.4.1.311.60.2.1.1": { "d": "jurisdictionOfIncorporationL", "c": "Microsoft (???)" },
1146
1231
  "1.3.6.1.4.1.311.60.2.1.2": { "d": "jurisdictionOfIncorporationSP", "c": "Microsoft (???)" },
1147
1232
  "1.3.6.1.4.1.311.60.2.1.3": { "d": "jurisdictionOfIncorporationC", "c": "Microsoft (???)" },
1233
+ "1.3.6.1.4.1.311.76.509.1.1": { "d": "microsoftCPS", "c": "Microsoft PKI services" },
1148
1234
  "1.3.6.1.4.1.311.88": { "d": "capiCom", "c": "Microsoft attribute" },
1149
1235
  "1.3.6.1.4.1.311.88.1": { "d": "capiComVersion", "c": "Microsoft attribute" },
1150
1236
  "1.3.6.1.4.1.311.88.2": { "d": "capiComAttribute", "c": "Microsoft attribute" },
@@ -1222,9 +1308,10 @@ var oids = {
1222
1308
  "1.3.6.1.4.1.8301.3.5.1": { "d": "validityModelChain", "c": "TU Darmstadt ValidityModel" },
1223
1309
  "1.3.6.1.4.1.8301.3.5.2": { "d": "validityModelShell", "c": "ValidityModel" },
1224
1310
  "1.3.6.1.4.1.8231.1": { "d": "rolUnicoNacional", "c": "Chilean Government national unique roll number" },
1225
- "1.3.6.1.4.1.11591": { "d": "gnu", "c": "GNU Project (see http://www.gnupg.org/oids.html)" },
1311
+ "1.3.6.1.4.1.11591": { "d": "gnu", "c": "GNU Project (see https://www.gnupg.org/oids.html)" },
1226
1312
  "1.3.6.1.4.1.11591.1": { "d": "gnuRadius", "c": "GNU Radius" },
1227
1313
  "1.3.6.1.4.1.11591.3": { "d": "gnuRadar", "c": "GNU Radar" },
1314
+ "1.3.6.1.4.1.11591.4.11": { "d": "scrypt", "c": "GNU Generic Security Service" },
1228
1315
  "1.3.6.1.4.1.11591.12": { "d": "gnuDigestAlgorithm", "c": "GNU digest algorithm" },
1229
1316
  "1.3.6.1.4.1.11591.12.2": { "d": "tiger", "c": "GNU digest algorithm" },
1230
1317
  "1.3.6.1.4.1.11591.13": { "d": "gnuEncryptionAlgorithm", "c": "GNU encryption algorithm" },
@@ -1254,6 +1341,13 @@ var oids = {
1254
1341
  "1.3.6.1.4.1.23629.1.4.2.1.3": { "d": "safenetStartDate", "c": "SafeNet" },
1255
1342
  "1.3.6.1.4.1.23629.1.4.2.1.4": { "d": "safenetAdminCert", "c": "SafeNet" },
1256
1343
  "1.3.6.1.4.1.23629.1.4.2.2.1": { "d": "safenetKeyDigest", "c": "SafeNet" },
1344
+ "1.3.6.1.4.1.51483.2.1": { "d": "hashOfRootKey", "c": "CTIA" },
1345
+ "1.3.6.1.5.2.3.1": { "d": "authData", "c": "Kerberos" },
1346
+ "1.3.6.1.5.2.3.2": { "d": "dHKeyData", "c": "Kerberos" },
1347
+ "1.3.6.1.5.2.3.3": { "d": "rkeyData", "c": "Kerberos" },
1348
+ "1.3.6.1.5.2.3.4": { "d": "keyPurposeClientAuth", "c": "Kerberos" },
1349
+ "1.3.6.1.5.2.3.5": { "d": "keyPurposeKdc", "c": "Kerberos" },
1350
+ "1.3.6.1.5.2.3.6": { "d": "kdf", "c": "Kerberos" },
1257
1351
  "1.3.6.1.5.5.7": { "d": "pkix", "c": "" },
1258
1352
  "1.3.6.1.5.5.7.0.12": { "d": "attributeCert", "c": "PKIX" },
1259
1353
  "1.3.6.1.5.5.7.1": { "d": "privateExtension", "c": "PKIX" },
@@ -1270,24 +1364,65 @@ var oids = {
1270
1364
  "1.3.6.1.5.5.7.1.11": { "d": "subjectInfoAccess", "c": "PKIX private extension" },
1271
1365
  "1.3.6.1.5.5.7.1.12": { "d": "logoType", "c": "PKIX private extension" },
1272
1366
  "1.3.6.1.5.5.7.1.13": { "d": "wlanSSID", "c": "PKIX private extension" },
1367
+ "1.3.6.1.5.5.7.1.14": { "d": "proxyCertInfo", "c": "PKIX private extension" },
1368
+ "1.3.6.1.5.5.7.1.15": { "d": "acPolicies", "c": "PKIX private extension" },
1369
+ "1.3.6.1.5.5.7.1.16": { "d": "certificateWarranty", "c": "PKIX private extension" },
1370
+ "1.3.6.1.5.5.7.1.18": { "d": "cmsContentConstraints", "c": "PKIX private extension" },
1371
+ "1.3.6.1.5.5.7.1.19": { "d": "otherCerts", "c": "PKIX private extension" },
1372
+ "1.3.6.1.5.5.7.1.20": { "d": "wrappedApexContinKey", "c": "PKIX private extension" },
1373
+ "1.3.6.1.5.5.7.1.21": { "d": "clearanceConstraints", "c": "PKIX private extension" },
1374
+ "1.3.6.1.5.5.7.1.22": { "d": "skiSemantics", "c": "PKIX private extension" },
1375
+ "1.3.6.1.5.5.7.1.23": { "d": "noSecrecyAfforded", "c": "PKIX private extension" },
1376
+ "1.3.6.1.5.5.7.1.24": { "d": "tlsFeature", "c": "PKIX private extension" },
1377
+ "1.3.6.1.5.5.7.1.25": { "d": "manufacturerUsageDescription", "c": "PKIX private extension" },
1378
+ "1.3.6.1.5.5.7.1.26": { "d": "tnAuthList", "c": "PKIX private extension" },
1379
+ "1.3.6.1.5.5.7.1.27": { "d": "jwtClaimConstraints", "c": "PKIX private extension" },
1380
+ "1.3.6.1.5.5.7.1.28": { "d": "ipAddrBlocksV2", "c": "PKIX private extension" },
1381
+ "1.3.6.1.5.5.7.1.29": { "d": "autonomousSysIdsV2", "c": "PKIX private extension" },
1382
+ "1.3.6.1.5.5.7.1.30": { "d": "manufacturerUsageDescriptionSigner", "c": "PKIX private extension" },
1383
+ "1.3.6.1.5.5.7.1.31": { "d": "acmeIdentifier", "c": "PKIX private extension" },
1384
+ "1.3.6.1.5.5.7.1.32": { "d": "masaURL", "c": "PKIX private extension" },
1273
1385
  "1.3.6.1.5.5.7.2": { "d": "policyQualifierIds", "c": "PKIX" },
1274
1386
  "1.3.6.1.5.5.7.2.1": { "d": "cps", "c": "PKIX policy qualifier" },
1275
1387
  "1.3.6.1.5.5.7.2.2": { "d": "unotice", "c": "PKIX policy qualifier" },
1276
1388
  "1.3.6.1.5.5.7.2.3": { "d": "textNotice", "c": "PKIX policy qualifier" },
1389
+ "1.3.6.1.5.5.7.2.4": { "d": "acps", "c": "PKIX policy qualifier" },
1390
+ "1.3.6.1.5.5.7.2.5": { "d": "acunotice", "c": "PKIX policy qualifier" },
1277
1391
  "1.3.6.1.5.5.7.3": { "d": "keyPurpose", "c": "PKIX" },
1278
1392
  "1.3.6.1.5.5.7.3.1": { "d": "serverAuth", "c": "PKIX key purpose" },
1279
1393
  "1.3.6.1.5.5.7.3.2": { "d": "clientAuth", "c": "PKIX key purpose" },
1280
1394
  "1.3.6.1.5.5.7.3.3": { "d": "codeSigning", "c": "PKIX key purpose" },
1281
1395
  "1.3.6.1.5.5.7.3.4": { "d": "emailProtection", "c": "PKIX key purpose" },
1282
- "1.3.6.1.5.5.7.3.5": { "d": "ipsecEndSystem", "c": "PKIX key purpose" },
1283
- "1.3.6.1.5.5.7.3.6": { "d": "ipsecTunnel", "c": "PKIX key purpose" },
1284
- "1.3.6.1.5.5.7.3.7": { "d": "ipsecUser", "c": "PKIX key purpose" },
1396
+ "1.3.6.1.5.5.7.3.5": { "d": "ipsecEndSystem", "c": "PKIX key purpose", "w": true },
1397
+ "1.3.6.1.5.5.7.3.6": { "d": "ipsecTunnel", "c": "PKIX key purpose", "w": true },
1398
+ "1.3.6.1.5.5.7.3.7": { "d": "ipsecUser", "c": "PKIX key purpose", "w": true },
1285
1399
  "1.3.6.1.5.5.7.3.8": { "d": "timeStamping", "c": "PKIX key purpose" },
1286
1400
  "1.3.6.1.5.5.7.3.9": { "d": "ocspSigning", "c": "PKIX key purpose" },
1287
1401
  "1.3.6.1.5.5.7.3.10": { "d": "dvcs", "c": "PKIX key purpose" },
1288
- "1.3.6.1.5.5.7.3.11": { "d": "sbgpCertAAServerAuth", "c": "PKIX key purpose" },
1402
+ "1.3.6.1.5.5.7.3.11": { "d": "sbgpCertAAServerAuth", "c": "PKIX key purpose", "w": true },
1403
+ "1.3.6.1.5.5.7.3.12": { "d": "scvpResponder", "c": "PKIX key purpose", "w": true },
1289
1404
  "1.3.6.1.5.5.7.3.13": { "d": "eapOverPPP", "c": "PKIX key purpose" },
1290
1405
  "1.3.6.1.5.5.7.3.14": { "d": "eapOverLAN", "c": "PKIX key purpose" },
1406
+ "1.3.6.1.5.5.7.3.15": { "d": "scvpServer", "c": "PKIX key purpose" },
1407
+ "1.3.6.1.5.5.7.3.16": { "d": "scvpClient", "c": "PKIX key purpose" },
1408
+ "1.3.6.1.5.5.7.3.17": { "d": "ipsecIKE", "c": "PKIX key purpose" },
1409
+ "1.3.6.1.5.5.7.3.18": { "d": "capwapAC", "c": "PKIX key purpose" },
1410
+ "1.3.6.1.5.5.7.3.19": { "d": "capwapWTP", "c": "PKIX key purpose" },
1411
+ "1.3.6.1.5.5.7.3.20": { "d": "sipDomain", "c": "PKIX key purpose" },
1412
+ "1.3.6.1.5.5.7.3.21": { "d": "secureShellClient", "c": "PKIX key purpose" },
1413
+ "1.3.6.1.5.5.7.3.22": { "d": "secureShellServer", "c": "PKIX key purpose" },
1414
+ "1.3.6.1.5.5.7.3.23": { "d": "sendRouter", "c": "PKIX key purpose" },
1415
+ "1.3.6.1.5.5.7.3.24": { "d": "sendProxiedRouter", "c": "PKIX key purpose" },
1416
+ "1.3.6.1.5.5.7.3.25": { "d": "sendOwner", "c": "PKIX key purpose" },
1417
+ "1.3.6.1.5.5.7.3.26": { "d": "sendProxiedOwner", "c": "PKIX key purpose" },
1418
+ "1.3.6.1.5.5.7.3.27": { "d": "cmcCA", "c": "PKIX key purpose" },
1419
+ "1.3.6.1.5.5.7.3.28": { "d": "cmcRA", "c": "PKIX key purpose" },
1420
+ "1.3.6.1.5.5.7.3.29": { "d": "cmcArchive", "c": "PKIX key purpose" },
1421
+ "1.3.6.1.5.5.7.3.30": { "d": "bgpsecRouter", "c": "PKIX key purpose" },
1422
+ "1.3.6.1.5.5.7.3.31": { "d": "bimi", "c": "PKIX key purpose" },
1423
+ "1.3.6.1.5.5.7.3.32": { "d": "cmKGA", "c": "PKIX key purpose" },
1424
+ "1.3.6.1.5.5.7.3.33": { "d": "rpcTLSClient", "c": "PKIX key purpose" },
1425
+ "1.3.6.1.5.5.7.3.34": { "d": "rpcTLSServer", "c": "PKIX key purpose" },
1291
1426
  "1.3.6.1.5.5.7.4": { "d": "cmpInformationTypes", "c": "PKIX" },
1292
1427
  "1.3.6.1.5.5.7.4.1": { "d": "caProtEncCert", "c": "PKIX CMP information" },
1293
1428
  "1.3.6.1.5.5.7.4.2": { "d": "signKeyPairTypes", "c": "PKIX CMP information" },
@@ -1319,13 +1454,27 @@ var oids = {
1319
1454
  "1.3.6.1.5.5.7.6": { "d": "algorithms", "c": "PKIX" },
1320
1455
  "1.3.6.1.5.5.7.6.1": { "d": "des40", "c": "PKIX algorithm" },
1321
1456
  "1.3.6.1.5.5.7.6.2": { "d": "noSignature", "c": "PKIX algorithm" },
1322
- "1.3.6.1.5.5.7.6.3": { "d": "dh-sig-hmac-sha1", "c": "PKIX algorithm" },
1323
- "1.3.6.1.5.5.7.6.4": { "d": "dh-pop", "c": "PKIX algorithm" },
1457
+ "1.3.6.1.5.5.7.6.3": { "d": "dhSigHmacSha1", "c": "PKIX algorithm" },
1458
+ "1.3.6.1.5.5.7.6.4": { "d": "dhPop", "c": "PKIX algorithm" },
1459
+ "1.3.6.1.5.5.7.6.5": { "d": "dhPopSha224", "c": "PKIX algorithm" },
1460
+ "1.3.6.1.5.5.7.6.6": { "d": "dhPopSha256", "c": "PKIX algorithm" },
1461
+ "1.3.6.1.5.5.7.6.7": { "d": "dhPopSha384", "c": "PKIX algorithm" },
1462
+ "1.3.6.1.5.5.7.6.8": { "d": "dhPopSha512", "c": "PKIX algorithm" },
1463
+ "1.3.6.1.5.5.7.6.15": { "d": "dhPopStaticSha224HmacSha224", "c": "PKIX algorithm" },
1464
+ "1.3.6.1.5.5.7.6.16": { "d": "dhPopStaticSha256HmacSha256", "c": "PKIX algorithm" },
1465
+ "1.3.6.1.5.5.7.6.17": { "d": "dhPopStaticSha384HmacSha384", "c": "PKIX algorithm" },
1466
+ "1.3.6.1.5.5.7.6.18": { "d": "dhPopStaticSha512HmacSha512", "c": "PKIX algorithm" },
1467
+ "1.3.6.1.5.5.7.6.25": { "d": "ecdhPopStaticSha224HmacSha224", "c": "PKIX algorithm" },
1468
+ "1.3.6.1.5.5.7.6.26": { "d": "ecdhPopStaticSha256HmacSha256", "c": "PKIX algorithm" },
1469
+ "1.3.6.1.5.5.7.6.27": { "d": "ecdhPopStaticSha384HmacSha384", "c": "PKIX algorithm" },
1470
+ "1.3.6.1.5.5.7.6.28": { "d": "ecdhPopStaticSha512HmacSha512", "c": "PKIX algorithm" },
1324
1471
  "1.3.6.1.5.5.7.7": { "d": "cmcControls", "c": "PKIX" },
1325
1472
  "1.3.6.1.5.5.7.8": { "d": "otherNames", "c": "PKIX" },
1326
1473
  "1.3.6.1.5.5.7.8.1": { "d": "personalData", "c": "PKIX other name" },
1327
1474
  "1.3.6.1.5.5.7.8.2": { "d": "userGroup", "c": "PKIX other name" },
1475
+ "1.3.6.1.5.5.7.8.3": { "d": "permanentIdentifier", "c": "PKIX other name" },
1328
1476
  "1.3.6.1.5.5.7.8.5": { "d": "xmppAddr", "c": "PKIX other name" },
1477
+ "1.3.6.1.5.5.7.8.6": { "d": "SIM", "c": "PKIX other name" },
1329
1478
  "1.3.6.1.5.5.7.9": { "d": "personalData", "c": "PKIX qualified certificates" },
1330
1479
  "1.3.6.1.5.5.7.9.1": { "d": "dateOfBirth", "c": "PKIX personal data" },
1331
1480
  "1.3.6.1.5.5.7.9.2": { "d": "placeOfBirth", "c": "PKIX personal data" },
@@ -1341,6 +1490,10 @@ var oids = {
1341
1490
  "1.3.6.1.5.5.7.10.6": { "d": "wlanSSID", "c": "PKIX attribute-certificate extension" },
1342
1491
  "1.3.6.1.5.5.7.11": { "d": "personalData", "c": "PKIX qualified certificates" },
1343
1492
  "1.3.6.1.5.5.7.11.1": { "d": "pkixQCSyntax-v1", "c": "PKIX qualified certificates" },
1493
+ "1.3.6.1.5.5.7.11.2": { "d": "pkixQCSyntax-v2", "c": "PKIX qualified certificates" },
1494
+ "1.3.6.1.5.5.7.12": { "d": "pkixCCT", "c": "PKIX CMC Content Types" },
1495
+ "1.3.6.1.5.5.7.12.2": { "d": "pkiData", "c": "PKIX CMC Content Types" },
1496
+ "1.3.6.1.5.5.7.12.3": { "d": "pkiResponse", "c": "PKIX CMC Content Types" },
1344
1497
  "1.3.6.1.5.5.7.14.2": { "d": "resourceCertificatePolicy", "c": "PKIX policies" },
1345
1498
  "1.3.6.1.5.5.7.20": { "d": "logo", "c": "PKIX qualified certificates" },
1346
1499
  "1.3.6.1.5.5.7.20.1": { "d": "logoLoyalty", "c": "PKIX" },
@@ -1632,6 +1785,10 @@ var oids = {
1632
1785
  "1.3.132.1.11.1": { "d": "ecdhX963KDF-SHA256", "c": "SECG (Certicom) elliptic curve key agreement" },
1633
1786
  "1.3.132.1.11.2": { "d": "ecdhX963KDF-SHA384", "c": "SECG (Certicom) elliptic curve key agreement" },
1634
1787
  "1.3.132.1.11.3": { "d": "ecdhX963KDF-SHA512", "c": "SECG (Certicom) elliptic curve key agreement" },
1788
+ "1.3.133.16.840.9.44": { "d": "x944", "c": "X9.44" },
1789
+ "1.3.133.16.840.9.44.1": { "d": "x944Components", "c": "X9.44" },
1790
+ "1.3.133.16.840.9.44.1.1": { "d": "x944Kdf2", "c": "X9.44" },
1791
+ "1.3.133.16.840.9.44.1.2": { "d": "x944Kdf3", "c": "X9.44" },
1635
1792
  "1.3.133.16.840.9.84": { "d": "x984", "c": "X9.84" },
1636
1793
  "1.3.133.16.840.9.84.0": { "d": "x984Module", "c": "X9.84" },
1637
1794
  "1.3.133.16.840.9.84.0.1": { "d": "x984Biometrics", "c": "X9.84 Module" },
@@ -1771,7 +1928,36 @@ var oids = {
1771
1928
  "2.5.4.74": { "d": "protPrivPolicy", "c": "X.520 DN component" },
1772
1929
  "2.5.4.75": { "d": "xMLPrivilegeInfo", "c": "X.520 DN component" },
1773
1930
  "2.5.4.76": { "d": "xmlPrivPolicy", "c": "X.520 DN component" },
1931
+ "2.5.4.77": { "d": "uuidpair", "c": "X.520 DN component" },
1932
+ "2.5.4.78": { "d": "tagOid", "c": "X.520 DN component" },
1933
+ "2.5.4.79": { "d": "uiiFormat", "c": "X.520 DN component" },
1934
+ "2.5.4.80": { "d": "uiiInUrh", "c": "X.520 DN component" },
1935
+ "2.5.4.81": { "d": "contentUrl", "c": "X.520 DN component" },
1774
1936
  "2.5.4.82": { "d": "permission", "c": "X.520 DN component" },
1937
+ "2.5.4.83": { "d": "uri", "c": "X.520 DN component" },
1938
+ "2.5.4.84": { "d": "pwdAttribute", "c": "X.520 DN component" },
1939
+ "2.5.4.85": { "d": "userPwd", "c": "X.520 DN component" },
1940
+ "2.5.4.86": { "d": "urn", "c": "X.520 DN component" },
1941
+ "2.5.4.87": { "d": "url", "c": "X.520 DN component" },
1942
+ "2.5.4.88": { "d": "utmCoordinates", "c": "X.520 DN component" },
1943
+ "2.5.4.89": { "d": "urnC", "c": "X.520 DN component" },
1944
+ "2.5.4.90": { "d": "uii", "c": "X.520 DN component" },
1945
+ "2.5.4.91": { "d": "epc", "c": "X.520 DN component" },
1946
+ "2.5.4.92": { "d": "tagAfi", "c": "X.520 DN component" },
1947
+ "2.5.4.93": { "d": "epcFormat", "c": "X.520 DN component" },
1948
+ "2.5.4.94": { "d": "epcInUrn", "c": "X.520 DN component" },
1949
+ "2.5.4.95": { "d": "ldapUrl", "c": "X.520 DN component" },
1950
+ "2.5.4.96": { "d": "tagLocation", "c": "X.520 DN component" },
1951
+ "2.5.4.97": { "d": "organizationIdentifier", "c": "X.520 DN component" },
1952
+ "2.5.4.98": { "d": "countryCode3c", "c": "X.520 DN component" },
1953
+ "2.5.4.99": { "d": "countryCode3n", "c": "X.520 DN component" },
1954
+ "2.5.4.100": { "d": "dnsName", "c": "X.520 DN component" },
1955
+ "2.5.4.101": { "d": "eepkCertificateRevocationList", "c": "X.520 DN component" },
1956
+ "2.5.4.102": { "d": "eeAttrCertificateRevocationList", "c": "X.520 DN component" },
1957
+ "2.5.4.103": { "d": "supportedPublicKeyAlgorithms", "c": "X.520 DN component" },
1958
+ "2.5.4.104": { "d": "intEmail", "c": "X.520 DN component" },
1959
+ "2.5.4.105": { "d": "jid", "c": "X.520 DN component" },
1960
+ "2.5.4.106": { "d": "objectIdentifier", "c": "X.520 DN component" },
1775
1961
  "2.5.6.0": { "d": "top", "c": "X.520 objectClass" },
1776
1962
  "2.5.6.1": { "d": "alias", "c": "X.520 objectClass" },
1777
1963
  "2.5.6.2": { "d": "country", "c": "X.520 objectClass" },
@@ -1902,6 +2088,9 @@ var oids = {
1902
2088
  "2.16.840.1.101.2.1.2.74": { "d": "forwardedCSPMsgBodyPart", "c": "SDN.700 INFOSEC format" },
1903
2089
  "2.16.840.1.101.2.1.2.75": { "d": "cspForwardedMessageParameters", "c": "SDN.700 INFOSEC format" },
1904
2090
  "2.16.840.1.101.2.1.2.76": { "d": "mspMMP2", "c": "SDN.700 INFOSEC format" },
2091
+ "2.16.840.1.101.2.1.2.78.2": { "d": "encryptedKeyPackage", "c": "SDN.700 INFOSEC format and RFC 6032" },
2092
+ "2.16.840.1.101.2.1.2.78.3": { "d": "keyPackageReceipt", "c": "SDN.700 INFOSEC format and RFC 7191" },
2093
+ "2.16.840.1.101.2.1.2.78.6": { "d": "keyPackageError", "c": "SDN.700 INFOSEC format and RFC 7191" },
1905
2094
  "2.16.840.1.101.2.1.3.1": { "d": "sdnsSecurityPolicy", "c": "SDN.700 INFOSEC policy" },
1906
2095
  "2.16.840.1.101.2.1.3.2": { "d": "sdnsPRBAC", "c": "SDN.700 INFOSEC policy" },
1907
2096
  "2.16.840.1.101.2.1.3.3": { "d": "mosaicPRBAC", "c": "SDN.700 INFOSEC policy" },
@@ -1978,10 +2167,18 @@ var oids = {
1978
2167
  "2.16.840.1.101.2.1.5.58": { "d": "policyInformationFile", "c": "SDN.700 INFOSEC attributes (obsolete)", "w": true },
1979
2168
  "2.16.840.1.101.2.1.5.59": { "d": "secPolicyInformationFile", "c": "SDN.700 INFOSEC attributes" },
1980
2169
  "2.16.840.1.101.2.1.5.60": { "d": "cAClearanceConstraint", "c": "SDN.700 INFOSEC attributes" },
2170
+ "2.16.840.1.101.2.1.5.65": { "d": "keyPkgIdAndReceiptReq", "c": "SDN.700 INFOSEC attributes and RFC 7191" },
2171
+ "2.16.840.1.101.2.1.5.66": { "d": "contentDecryptKeyID", "c": "SDN.700 INFOSEC attributes and RFC 6032" },
2172
+ "2.16.840.1.101.2.1.5.70": { "d": "kpCrlPointers", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2173
+ "2.16.840.1.101.2.1.5.71": { "d": "kpKeyProvinceV2", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2174
+ "2.16.840.1.101.2.1.5.72": { "d": "kpManifest", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
1981
2175
  "2.16.840.1.101.2.1.7.1": { "d": "cspExtns", "c": "SDN.700 INFOSEC extensions" },
1982
2176
  "2.16.840.1.101.2.1.7.1.0": { "d": "cspCsExtn", "c": "SDN.700 INFOSEC extensions" },
1983
2177
  "2.16.840.1.101.2.1.8.1": { "d": "mISSISecurityCategories", "c": "SDN.700 INFOSEC security category" },
1984
2178
  "2.16.840.1.101.2.1.8.2": { "d": "standardSecurityLabelPrivileges", "c": "SDN.700 INFOSEC security category" },
2179
+ "2.16.840.1.101.2.1.8.3.1": { "d": "enumeratedPermissiveAttrs", "c": "SDN.700 INFOSEC security category from RFC 7906" },
2180
+ "2.16.840.1.101.2.1.8.3.3": { "d": "informativeAttrs", "c": "SDN.700 INFOSEC security category from RFC 7906" },
2181
+ "2.16.840.1.101.2.1.8.3.4": { "d": "enumeratedRestrictiveAttrs", "c": "SDN.700 INFOSEC security category from RFC 7906" },
1985
2182
  "2.16.840.1.101.2.1.10.1": { "d": "sigPrivileges", "c": "SDN.700 INFOSEC privileges" },
1986
2183
  "2.16.840.1.101.2.1.10.2": { "d": "kmPrivileges", "c": "SDN.700 INFOSEC privileges" },
1987
2184
  "2.16.840.1.101.2.1.10.3": { "d": "namedTagSetPrivilege", "c": "SDN.700 INFOSEC privileges" },
@@ -2008,6 +2205,26 @@ var oids = {
2008
2205
  "2.16.840.1.101.2.1.12.0.3.0.2": { "d": "kafkaTagSetName2", "c": "SDN.700 INFOSEC test objects" },
2009
2206
  "2.16.840.1.101.2.1.12.0.3.0.3": { "d": "kafkaTagSetName3", "c": "SDN.700 INFOSEC test objects" },
2010
2207
  "2.16.840.1.101.2.1.12.1.1": { "d": "tcp1", "c": "SDN.700 INFOSEC test objects" },
2208
+ "2.16.840.1.101.2.1.13.1": { "d": "kmaKeyAlgorithm", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2209
+ "2.16.840.1.101.2.1.13.3": { "d": "kmaTSECNomenclature", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2210
+ "2.16.840.1.101.2.1.13.5": { "d": "kmaKeyDistPeriod", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2211
+ "2.16.840.1.101.2.1.13.6": { "d": "kmaKeyValidityPeriod", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2212
+ "2.16.840.1.101.2.1.13.7": { "d": "kmaKeyDuration", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2213
+ "2.16.840.1.101.2.1.13.11": { "d": "kmaSplitID", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2214
+ "2.16.840.1.101.2.1.13.12": { "d": "kmaKeyPkgType", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2215
+ "2.16.840.1.101.2.1.13.13": { "d": "kmaKeyPurpose", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2216
+ "2.16.840.1.101.2.1.13.14": { "d": "kmaKeyUse", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2217
+ "2.16.840.1.101.2.1.13.15": { "d": "kmaTransportKey", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2218
+ "2.16.840.1.101.2.1.13.16": { "d": "kmaKeyPkgReceiversV2", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2219
+ "2.16.840.1.101.2.1.13.19": { "d": "kmaOtherCertFormats", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2220
+ "2.16.840.1.101.2.1.13.20": { "d": "kmaUsefulCerts", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2221
+ "2.16.840.1.101.2.1.13.21": { "d": "kmaKeyWrapAlgorithm", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2222
+ "2.16.840.1.101.2.1.13.22": { "d": "kmaSigUsageV3", "c": "SDN.700 INFOSEC attributes and RFC 7906" },
2223
+ "2.16.840.1.101.2.1.16.0": { "d": "dn", "c": "SDN.700 INFOSEC attributes and RFC 7191" },
2224
+ "2.16.840.1.101.2.1.22": { "d": "errorCodes", "c": "RFC 7906 key attribute error codes" },
2225
+ "2.16.840.1.101.2.1.22.1": { "d": "missingKeyType", "c": "RFC 7906 key attribute error codes" },
2226
+ "2.16.840.1.101.2.1.22.2": { "d": "privacyMarkTooLong", "c": "RFC 7906 key attribute error codes" },
2227
+ "2.16.840.1.101.2.1.22.3": { "d": "unrecognizedSecurityPolicy", "c": "RFC 7906 key attribute error codes" },
2011
2228
  "2.16.840.1.101.3.1": { "d": "slabel", "c": "CSOR GAK", "w": true },
2012
2229
  "2.16.840.1.101.3.2": { "d": "pki", "c": "NIST", "w": true },
2013
2230
  "2.16.840.1.101.3.2.1": { "d": "NIST policyIdentifier", "c": "NIST policies", "w": true },
@@ -2040,6 +2257,7 @@ var oids = {
2040
2257
  "2.16.840.1.101.3.4.1.6": { "d": "aes128-GCM", "c": "NIST Algorithm" },
2041
2258
  "2.16.840.1.101.3.4.1.7": { "d": "aes128-CCM", "c": "NIST Algorithm" },
2042
2259
  "2.16.840.1.101.3.4.1.8": { "d": "aes128-wrap-pad", "c": "NIST Algorithm" },
2260
+ "2.16.840.1.101.3.4.1.9": { "d": "aes128-GMAC", "c": "NIST Algorithm" },
2043
2261
  "2.16.840.1.101.3.4.1.21": { "d": "aes192-ECB", "c": "NIST Algorithm" },
2044
2262
  "2.16.840.1.101.3.4.1.22": { "d": "aes192-CBC", "c": "NIST Algorithm" },
2045
2263
  "2.16.840.1.101.3.4.1.23": { "d": "aes192-OFB", "c": "NIST Algorithm" },
@@ -2048,6 +2266,7 @@ var oids = {
2048
2266
  "2.16.840.1.101.3.4.1.26": { "d": "aes192-GCM", "c": "NIST Algorithm" },
2049
2267
  "2.16.840.1.101.3.4.1.27": { "d": "aes192-CCM", "c": "NIST Algorithm" },
2050
2268
  "2.16.840.1.101.3.4.1.28": { "d": "aes192-wrap-pad", "c": "NIST Algorithm" },
2269
+ "2.16.840.1.101.3.4.1.29": { "d": "aes192-GMAC", "c": "NIST Algorithm" },
2051
2270
  "2.16.840.1.101.3.4.1.41": { "d": "aes256-ECB", "c": "NIST Algorithm" },
2052
2271
  "2.16.840.1.101.3.4.1.42": { "d": "aes256-CBC", "c": "NIST Algorithm" },
2053
2272
  "2.16.840.1.101.3.4.1.43": { "d": "aes256-OFB", "c": "NIST Algorithm" },
@@ -2056,11 +2275,22 @@ var oids = {
2056
2275
  "2.16.840.1.101.3.4.1.46": { "d": "aes256-GCM", "c": "NIST Algorithm" },
2057
2276
  "2.16.840.1.101.3.4.1.47": { "d": "aes256-CCM", "c": "NIST Algorithm" },
2058
2277
  "2.16.840.1.101.3.4.1.48": { "d": "aes256-wrap-pad", "c": "NIST Algorithm" },
2278
+ "2.16.840.1.101.3.4.1.49": { "d": "aes256-GMAC", "c": "NIST Algorithm" },
2059
2279
  "2.16.840.1.101.3.4.2": { "d": "hashAlgos", "c": "NIST Algorithm" },
2060
2280
  "2.16.840.1.101.3.4.2.1": { "d": "sha-256", "c": "NIST Algorithm" },
2061
2281
  "2.16.840.1.101.3.4.2.2": { "d": "sha-384", "c": "NIST Algorithm" },
2062
2282
  "2.16.840.1.101.3.4.2.3": { "d": "sha-512", "c": "NIST Algorithm" },
2063
2283
  "2.16.840.1.101.3.4.2.4": { "d": "sha-224", "c": "NIST Algorithm" },
2284
+ "2.16.840.1.101.3.4.2.7": { "d": "sha3-224", "c": "NIST Algorithm" },
2285
+ "2.16.840.1.101.3.4.2.8": { "d": "sha3-256", "c": "NIST Algorithm" },
2286
+ "2.16.840.1.101.3.4.2.9": { "d": "sha3-384", "c": "NIST Algorithm" },
2287
+ "2.16.840.1.101.3.4.2.10": { "d": "sha3-512", "c": "NIST Algorithm" },
2288
+ "2.16.840.1.101.3.4.2.11": { "d": "shake128", "c": "NIST Algorithm" },
2289
+ "2.16.840.1.101.3.4.2.12": { "d": "shake256", "c": "NIST Algorithm" },
2290
+ "2.16.840.1.101.3.4.2.17": { "d": "shake128len", "c": "NIST Algorithm" },
2291
+ "2.16.840.1.101.3.4.2.18": { "d": "shake256len", "c": "NIST Algorithm" },
2292
+ "2.16.840.1.101.3.4.2.19": { "d": "kmacShake128", "c": "NIST Algorithm" },
2293
+ "2.16.840.1.101.3.4.2.20": { "d": "kmacShake256", "c": "NIST Algorithm" },
2064
2294
  "2.16.840.1.101.3.4.3.1": { "d": "dsaWithSha224", "c": "NIST Algorithm" },
2065
2295
  "2.16.840.1.101.3.4.3.2": { "d": "dsaWithSha256", "c": "NIST Algorithm" },
2066
2296
  "2.16.840.1.113719.1.2.8": { "d": "novellAlgorithm", "c": "Novell" },
@@ -2116,6 +2346,7 @@ var oids = {
2116
2346
  "2.16.840.1.113730.3.1.2": { "d": "departmentNumber", "c": "Netscape LDAP definitions" },
2117
2347
  "2.16.840.1.113730.3.1.3": { "d": "employeeNumber", "c": "Netscape LDAP definitions" },
2118
2348
  "2.16.840.1.113730.3.1.4": { "d": "employeeType", "c": "Netscape LDAP definitions" },
2349
+ "2.16.840.1.113730.3.1.216": { "d": "userPKCS12", "c": "Netscape LDAP definitions" },
2119
2350
  "2.16.840.1.113730.3.2.2": { "d": "inetOrgPerson", "c": "Netscape LDAP definitions" },
2120
2351
  "2.16.840.1.113730.4.1": { "d": "serverGatedCrypto", "c": "Netscape" },
2121
2352
  "2.16.840.1.113733.1.6.3": { "d": "verisignCZAG", "c": "Verisign extension" },
@@ -2318,5 +2549,4 @@ var oids = {
2318
2549
  "2.16.840.1.113733.1.7.23.6": { "d": "VeriSign EV policy", "c": "VeriSign Class 3 Public Primary Certification Authority" },
2319
2550
  "2.16.840.1.114171.500.9": { "d": "Wells Fargo EV policy", "c": "Wells Fargo WellsSecure Public Root Certificate Authority" },
2320
2551
  "END": ""
2321
- };
2322
- if (typeof module !== 'undefined') { module.exports = oids; }
2552
+ };});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lapo/asn1js",
3
- "version": "1.0.2",
3
+ "version": "1.2.3",
4
4
  "description": "Generic ASN.1 parser/decoder that can decode any valid ASN.1 DER or BER structures.",
5
5
  "main": "asn1.js",
6
6
  "repository": {
@@ -13,24 +13,38 @@
13
13
  "bugs": { "url": "https://github.com/lapo-luchini/asn1js/issues" },
14
14
  "homepage": "https://lapo.it/asn1js/",
15
15
  "files": [ "asn1.js", "base64.js", "hex.js", "int10.js", "oids.js" ],
16
+ "scripts" : {
17
+ "lint" : "npx eslint asn1.js base64.js hex.js int10.js oids.js",
18
+ "test" : "node test"
19
+ },
16
20
  "eslintConfig": {
17
21
  "env": {
22
+ "amd": true,
18
23
  "browser": true,
19
24
  "node": true
20
25
  },
21
26
  "extends": [ "eslint:recommended" ],
27
+ "globals": {
28
+ "Uint8Array": "readonly"
29
+ },
22
30
  "rules": {
23
31
  "strict": [ "error", "function" ],
24
- "indent": [ "error", 4, { "outerIIFEBody": 0 } ],
32
+ "indent": [ "error", 4, { "ignoredNodes": [ "Program > ExpressionStatement > CallExpression > FunctionExpression > BlockStatement > ExpressionStatement[directive='use strict']:first-child" ] } ],
25
33
  "linebreak-style": [ "error", "unix" ],
26
34
  "semi": [ "warn", "always" ],
27
35
  "comma-dangle": [ "error", "never" ]
28
36
  },
29
37
  "overrides": [
30
38
  {
31
- "files": [ "index.js", "test.js" ],
39
+ "files": [ "test.js" ],
40
+ "rules": {
41
+ "strict": [ "error", "global" ],
42
+ "comma-dangle": [ "error", "always-multiline" ]
43
+ }
44
+ }, {
45
+ "files": [ "oids.js" ],
32
46
  "rules": {
33
- "strict": [ "error", "global" ]
47
+ "indent": "off"
34
48
  }
35
49
  }
36
50
  ]