@peculiar/certificates-viewer 3.2.1 → 3.3.1

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.
Files changed (108) hide show
  1. package/dist/cjs/{certification_request-cde57123.js → certification_request-50ce61b3.js} +643 -235
  2. package/dist/cjs/crl-0c15e04a.js +312 -0
  3. package/dist/cjs/{index-ff818d4d.js → download-a97f4cb2.js} +106 -2
  4. package/dist/cjs/index.cjs.js +1 -3
  5. package/dist/cjs/l10n-4eaa5263.js +167 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{peculiar-attribute-certificate-viewer_2.cjs.entry.js → peculiar-attribute-certificate-viewer_3.cjs.entry.js} +123 -21
  8. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -15
  9. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +2 -2
  10. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +6 -25
  11. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -8
  12. package/dist/cjs/peculiar.cjs.js +1 -1
  13. package/dist/cjs/{public_key-2f5bd471.js → public_key-2b73778a.js} +80 -40
  14. package/dist/cjs/{x509_certificate-51a97033.js → x509_certificate-c94ce29e.js} +13 -7
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/certificate-decoder/certificate-decoder.js +19 -6
  17. package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +2 -1
  18. package/dist/collection/components/certificate-viewer/basic_information.js +3 -1
  19. package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +2 -1
  20. package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +2 -1
  21. package/dist/collection/components/certificate-viewer/extensions/crl_number_extension.js +19 -0
  22. package/dist/collection/components/certificate-viewer/extensions/index.js +9 -1
  23. package/dist/collection/components/certificate-viewer/extensions/issuing_distribution_point_extension.js +27 -0
  24. package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +2 -1
  25. package/dist/collection/components/certificate-viewer/miscellaneous.js +2 -20
  26. package/dist/collection/components/certificates-viewer/certificates-viewer.js +2 -3
  27. package/dist/collection/components/crl-viewer/crl-viewer.js +234 -0
  28. package/dist/collection/components/crl-viewer/revoked_certificates.js +27 -0
  29. package/dist/collection/crypto/crl.js +82 -0
  30. package/dist/collection/crypto/csr.js +7 -0
  31. package/dist/collection/crypto/extension.js +10 -1
  32. package/dist/collection/crypto/index.js +1 -0
  33. package/dist/collection/crypto/utils.js +5 -4
  34. package/dist/collection/crypto/x509_attribute_certificate.js +7 -1
  35. package/dist/collection/crypto/x509_certificate.js +7 -1
  36. package/dist/collection/locales/en.json +12 -1
  37. package/dist/collection/utils/download.js +18 -2
  38. package/dist/collection/utils/index.js +1 -0
  39. package/dist/collection/utils/validator.js +2 -0
  40. package/dist/esm/{certification_request-c0674647.js → certification_request-5b5c2fa2.js} +577 -172
  41. package/dist/esm/crl-10d4db54.js +308 -0
  42. package/dist/esm/{index-0ba131b0.js → download-67ac9120.js} +102 -2
  43. package/dist/esm/index.js +1 -3
  44. package/dist/esm/l10n-116c79fa.js +163 -0
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/{peculiar-attribute-certificate-viewer_2.entry.js → peculiar-attribute-certificate-viewer_3.entry.js} +113 -12
  47. package/dist/esm/peculiar-certificate-decoder.entry.js +21 -11
  48. package/dist/esm/peculiar-certificate-summary_3.entry.js +2 -2
  49. package/dist/esm/peculiar-certificate-viewer.entry.js +6 -25
  50. package/dist/esm/peculiar-certificates-viewer.entry.js +6 -8
  51. package/dist/esm/peculiar.js +1 -1
  52. package/dist/esm/{public_key-38c9ddc8.js → public_key-c1e6801e.js} +67 -28
  53. package/dist/esm/{x509_certificate-12f6d344.js → x509_certificate-61126913.js} +9 -3
  54. package/dist/peculiar/index.esm.js +1 -1
  55. package/dist/peculiar/locales/en.json +12 -1
  56. package/dist/peculiar/p-10aa0b03.entry.js +11 -0
  57. package/dist/peculiar/{p-17c4da7b.js → p-309fdd02.js} +2 -2
  58. package/dist/peculiar/p-318a1e9f.entry.js +4 -0
  59. package/dist/peculiar/p-53aac672.js +63 -0
  60. package/dist/peculiar/p-5a898f51.js +32 -0
  61. package/dist/peculiar/{p-38635919.entry.js → p-652f77d0.entry.js} +1 -1
  62. package/dist/peculiar/p-7ef69178.entry.js +4 -0
  63. package/dist/peculiar/{p-464e0943.js → p-bbf0fd6c.js} +9 -9
  64. package/dist/peculiar/p-cff9655c.js +18 -0
  65. package/dist/peculiar/p-ed58acd0.js +12 -0
  66. package/dist/peculiar/p-ff867be1.entry.js +26 -0
  67. package/dist/peculiar/peculiar.esm.js +1 -1
  68. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +3 -3
  69. package/dist/types/components/certificate-viewer/basic_information.d.ts +2 -0
  70. package/dist/types/components/certificate-viewer/extensions/crl_number_extension.d.ts +15 -0
  71. package/dist/types/components/certificate-viewer/extensions/issuing_distribution_point_extension.d.ts +15 -0
  72. package/dist/types/components/certificate-viewer/miscellaneous.d.ts +2 -2
  73. package/dist/types/components/certificate-viewer/row.d.ts +1 -1
  74. package/dist/types/components/crl-viewer/crl-viewer.d.ts +59 -0
  75. package/dist/types/components/crl-viewer/revoked_certificates.d.ts +14 -0
  76. package/dist/types/components.d.ts +66 -0
  77. package/dist/types/crypto/crl.d.ts +28 -0
  78. package/dist/types/crypto/csr.d.ts +2 -0
  79. package/dist/types/crypto/extension.d.ts +2 -2
  80. package/dist/types/crypto/index.d.ts +1 -0
  81. package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -0
  82. package/dist/types/crypto/x509_certificate.d.ts +2 -0
  83. package/dist/types/utils/download.d.ts +10 -2
  84. package/dist/types/utils/index.d.ts +1 -0
  85. package/dist/types/utils/l10n.d.ts +11 -0
  86. package/dist/types/utils/validator.d.ts +1 -0
  87. package/package.json +19 -19
  88. package/dist/cjs/_commonjsHelpers-cb1f949a.js +0 -23
  89. package/dist/cjs/csr-78378ed0.js +0 -150
  90. package/dist/cjs/download-6724f3a7.js +0 -79
  91. package/dist/cjs/l10n-a048a686.js +0 -145
  92. package/dist/cjs/x509_attribute_certificate-cc325b70.js +0 -87
  93. package/dist/esm/_commonjsHelpers-bfbd2ad8.js +0 -20
  94. package/dist/esm/csr-c1b6a176.js +0 -147
  95. package/dist/esm/download-735fb2eb.js +0 -76
  96. package/dist/esm/l10n-ac28fa92.js +0 -141
  97. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +0 -85
  98. package/dist/peculiar/p-006865d7.js +0 -4
  99. package/dist/peculiar/p-3f8d1008.entry.js +0 -4
  100. package/dist/peculiar/p-42da7f97.js +0 -11
  101. package/dist/peculiar/p-4f4c1d30.js +0 -12
  102. package/dist/peculiar/p-6011646e.entry.js +0 -11
  103. package/dist/peculiar/p-6bfd077c.entry.js +0 -18
  104. package/dist/peculiar/p-6c510523.js +0 -18
  105. package/dist/peculiar/p-986cc770.entry.js +0 -11
  106. package/dist/peculiar/p-b765873e.js +0 -78
  107. package/dist/peculiar/p-d0b55fbb.js +0 -4
  108. package/dist/peculiar/p-d7a13cb4.js +0 -18
@@ -1,9 +1,8 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import { b as build } from './index-0ba131b0.js';
5
- import './l10n-ac28fa92.js';
6
- import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-bfbd2ad8.js';
4
+ import { b as build, c as createCommonjsModule, a as commonjsGlobal } from './download-67ac9120.js';
5
+ import './l10n-116c79fa.js';
7
6
 
8
7
  /**
9
8
  * @license
@@ -19,6 +18,8 @@ const isPem = (value) => (/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-
19
18
  .test(value));
20
19
  const isX509Pem = (value) => (/-----BEGIN CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE-----/
21
20
  .test(value));
21
+ const isX509CRLPem = (value) => (/-----BEGIN X509 CRL-----([A-Za-z0-9+\/=\s]+)-----END X509 CRL-----/
22
+ .test(value));
22
23
  const isPkcs10Pem = (value) => (/-----BEGIN CERTIFICATE REQUEST-----([A-Za-z0-9+\/=\s]+)-----END CERTIFICATE REQUEST-----/
23
24
  .test(value));
24
25
  const isX509AttributePem = (value) => (/-----BEGIN ATTRIBUTE CERTIFICATE-----([A-Za-z0-9+\/=\s]+)-----END ATTRIBUTE CERTIFICATE-----/
@@ -3297,7 +3298,7 @@ function verifySchema(inputBuffer, inputSchema) {
3297
3298
  return compareSchema(asn1.result, asn1.result, inputSchema);
3298
3299
  }
3299
3300
 
3300
- const asn1 = /*#__PURE__*/Object.freeze({
3301
+ const asn1js = /*#__PURE__*/Object.freeze({
3301
3302
  __proto__: null,
3302
3303
  Any: Any,
3303
3304
  BaseBlock: BaseBlock,
@@ -3382,8 +3383,104 @@ var AsnPropTypes;
3382
3383
  AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null";
3383
3384
  })(AsnPropTypes || (AsnPropTypes = {}));
3384
3385
 
3386
+ class BitString {
3387
+ constructor(params, unusedBits = 0) {
3388
+ this.unusedBits = 0;
3389
+ this.value = new ArrayBuffer(0);
3390
+ if (params) {
3391
+ if (typeof params === "number") {
3392
+ this.fromNumber(params);
3393
+ }
3394
+ else if (build.BufferSourceConverter.isBufferSource(params)) {
3395
+ this.unusedBits = unusedBits;
3396
+ this.value = build.BufferSourceConverter.toArrayBuffer(params);
3397
+ }
3398
+ else {
3399
+ throw TypeError("Unsupported type of 'params' argument for BitString");
3400
+ }
3401
+ }
3402
+ }
3403
+ fromASN(asn) {
3404
+ if (!(asn instanceof BitString$1)) {
3405
+ throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
3406
+ }
3407
+ this.unusedBits = asn.valueBlock.unusedBits;
3408
+ this.value = asn.valueBlock.valueHex;
3409
+ return this;
3410
+ }
3411
+ toASN() {
3412
+ return new BitString$1({ unusedBits: this.unusedBits, valueHex: this.value });
3413
+ }
3414
+ toSchema(name) {
3415
+ return new BitString$1({ name });
3416
+ }
3417
+ toNumber() {
3418
+ let res = "";
3419
+ const uintArray = new Uint8Array(this.value);
3420
+ for (const octet of uintArray) {
3421
+ res += octet.toString(2).padStart(8, "0");
3422
+ }
3423
+ res = res.split("").reverse().join("");
3424
+ if (this.unusedBits) {
3425
+ res = res.slice(this.unusedBits).padStart(this.unusedBits, "0");
3426
+ }
3427
+ return parseInt(res, 2);
3428
+ }
3429
+ fromNumber(value) {
3430
+ let bits = value.toString(2);
3431
+ const octetSize = (bits.length + 7) >> 3;
3432
+ this.unusedBits = (octetSize << 3) - bits.length;
3433
+ const octets = new Uint8Array(octetSize);
3434
+ bits = bits.padStart(octetSize << 3, "0").split("").reverse().join("");
3435
+ let index = 0;
3436
+ while (index < octetSize) {
3437
+ octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
3438
+ index++;
3439
+ }
3440
+ this.value = octets.buffer;
3441
+ }
3442
+ }
3443
+
3444
+ class OctetString {
3445
+ constructor(param) {
3446
+ if (typeof param === "number") {
3447
+ this.buffer = new ArrayBuffer(param);
3448
+ }
3449
+ else {
3450
+ if (build.BufferSourceConverter.isBufferSource(param)) {
3451
+ this.buffer = build.BufferSourceConverter.toArrayBuffer(param);
3452
+ }
3453
+ else if (Array.isArray(param)) {
3454
+ this.buffer = new Uint8Array(param);
3455
+ }
3456
+ else {
3457
+ this.buffer = new ArrayBuffer(0);
3458
+ }
3459
+ }
3460
+ }
3461
+ get byteLength() {
3462
+ return this.buffer.byteLength;
3463
+ }
3464
+ get byteOffset() {
3465
+ return 0;
3466
+ }
3467
+ fromASN(asn) {
3468
+ if (!(asn instanceof OctetString$1)) {
3469
+ throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
3470
+ }
3471
+ this.buffer = asn.valueBlock.valueHex;
3472
+ return this;
3473
+ }
3474
+ toASN() {
3475
+ return new OctetString$1({ valueHex: this.buffer });
3476
+ }
3477
+ toSchema(name) {
3478
+ return new OctetString$1({ name });
3479
+ }
3480
+ }
3481
+
3385
3482
  const AsnAnyConverter = {
3386
- fromASN: (value) => value instanceof Null ? null : value.valueBeforeDecode,
3483
+ fromASN: (value) => value instanceof Null ? null : value.valueBeforeDecodeView,
3387
3484
  toASN: (value) => {
3388
3485
  if (value === null) {
3389
3486
  return new Null();
@@ -3396,21 +3493,21 @@ const AsnAnyConverter = {
3396
3493
  },
3397
3494
  };
3398
3495
  const AsnIntegerConverter = {
3399
- fromASN: (value) => value.valueBlock.valueHex.byteLength > 4
3496
+ fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4
3400
3497
  ? value.valueBlock.toString()
3401
3498
  : value.valueBlock.valueDec,
3402
- toASN: (value) => new Integer({ value: value }),
3499
+ toASN: (value) => new Integer({ value: +value }),
3403
3500
  };
3404
3501
  const AsnEnumeratedConverter = {
3405
3502
  fromASN: (value) => value.valueBlock.valueDec,
3406
3503
  toASN: (value) => new Enumerated({ value }),
3407
3504
  };
3408
3505
  const AsnIntegerArrayBufferConverter = {
3409
- fromASN: (value) => value.valueBlock.valueHex,
3506
+ fromASN: (value) => value.valueBlock.valueHexView,
3410
3507
  toASN: (value) => new Integer({ valueHex: value }),
3411
3508
  };
3412
3509
  const AsnBitStringConverter = {
3413
- fromASN: (value) => value.valueBlock.valueHex,
3510
+ fromASN: (value) => value.valueBlock.valueHexView,
3414
3511
  toASN: (value) => new BitString$1({ valueHex: value }),
3415
3512
  };
3416
3513
  const AsnObjectIdentifierConverter = {
@@ -3422,9 +3519,13 @@ const AsnBooleanConverter = {
3422
3519
  toASN: (value) => new Boolean({ value }),
3423
3520
  };
3424
3521
  const AsnOctetStringConverter = {
3425
- fromASN: (value) => value.valueBlock.valueHex,
3522
+ fromASN: (value) => value.valueBlock.valueHexView,
3426
3523
  toASN: (value) => new OctetString$1({ valueHex: value }),
3427
3524
  };
3525
+ const AsnConstructedOctetStringConverter = {
3526
+ fromASN: (value) => new OctetString(value.getValue()),
3527
+ toASN: (value) => value.toASN(),
3528
+ };
3428
3529
  function createStringConverter(Asn1Type) {
3429
3530
  return {
3430
3531
  fromASN: (value) => value.valueBlock.value,
@@ -3452,8 +3553,8 @@ const AsnGeneralizedTimeConverter = {
3452
3553
  toASN: (value) => new GeneralizedTime({ valueDate: value }),
3453
3554
  };
3454
3555
  const AsnNullConverter = {
3455
- fromASN: (value) => null,
3456
- toASN: (value) => {
3556
+ fromASN: () => null,
3557
+ toASN: () => {
3457
3558
  return new Null();
3458
3559
  },
3459
3560
  };
@@ -3508,104 +3609,8 @@ function defaultConverter(type) {
3508
3609
  }
3509
3610
  }
3510
3611
 
3511
- class BitString {
3512
- constructor(params, unusedBits = 0) {
3513
- this.unusedBits = 0;
3514
- this.value = new ArrayBuffer(0);
3515
- if (params) {
3516
- if (typeof params === "number") {
3517
- this.fromNumber(params);
3518
- }
3519
- else if (build.BufferSourceConverter.isBufferSource(params)) {
3520
- this.unusedBits = unusedBits;
3521
- this.value = build.BufferSourceConverter.toArrayBuffer(params);
3522
- }
3523
- else {
3524
- throw TypeError("Unsupported type of 'params' argument for BitString");
3525
- }
3526
- }
3527
- }
3528
- fromASN(asn) {
3529
- if (!(asn instanceof BitString$1)) {
3530
- throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
3531
- }
3532
- this.unusedBits = asn.valueBlock.unusedBits;
3533
- this.value = asn.valueBlock.valueHex;
3534
- return this;
3535
- }
3536
- toASN() {
3537
- return new BitString$1({ unusedBits: this.unusedBits, valueHex: this.value });
3538
- }
3539
- toSchema(name) {
3540
- return new BitString$1({ name });
3541
- }
3542
- toNumber() {
3543
- let res = "";
3544
- const uintArray = new Uint8Array(this.value);
3545
- for (const octet of uintArray) {
3546
- res += octet.toString(2).padStart(8, "0");
3547
- }
3548
- res = res.split("").reverse().join("");
3549
- if (this.unusedBits) {
3550
- res = res.slice(this.unusedBits).padStart(this.unusedBits, "0");
3551
- }
3552
- return parseInt(res, 2);
3553
- }
3554
- fromNumber(value) {
3555
- let bits = value.toString(2);
3556
- const octetSize = (bits.length + 7) >> 3;
3557
- this.unusedBits = (octetSize << 3) - bits.length;
3558
- const octets = new Uint8Array(octetSize);
3559
- bits = bits.padStart(octetSize << 3, "0").split("").reverse().join("");
3560
- let index = 0;
3561
- while (index < octetSize) {
3562
- octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
3563
- index++;
3564
- }
3565
- this.value = octets.buffer;
3566
- }
3567
- }
3568
-
3569
- class OctetString {
3570
- constructor(param) {
3571
- if (typeof param === "number") {
3572
- this.buffer = new ArrayBuffer(param);
3573
- }
3574
- else {
3575
- if (build.BufferSourceConverter.isBufferSource(param)) {
3576
- this.buffer = build.BufferSourceConverter.toArrayBuffer(param);
3577
- }
3578
- else if (Array.isArray(param)) {
3579
- this.buffer = new Uint8Array(param);
3580
- }
3581
- else {
3582
- this.buffer = new ArrayBuffer(0);
3583
- }
3584
- }
3585
- }
3586
- get byteLength() {
3587
- return this.buffer.byteLength;
3588
- }
3589
- get byteOffset() {
3590
- return 0;
3591
- }
3592
- fromASN(asn) {
3593
- if (!(asn instanceof OctetString$1)) {
3594
- throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
3595
- }
3596
- this.buffer = asn.valueBlock.valueHex;
3597
- return this;
3598
- }
3599
- toASN() {
3600
- return new OctetString$1({ valueHex: this.buffer });
3601
- }
3602
- toSchema(name) {
3603
- return new OctetString$1({ name });
3604
- }
3605
- }
3606
-
3607
3612
  function isConvertible(target) {
3608
- if (target && target.prototype) {
3613
+ if (typeof target === "function" && target.prototype) {
3609
3614
  if (target.prototype.toASN && target.prototype.fromASN) {
3610
3615
  return true;
3611
3616
  }
@@ -3614,7 +3619,7 @@ function isConvertible(target) {
3614
3619
  }
3615
3620
  }
3616
3621
  else {
3617
- return !!(target && target.toASN && target.fromASN);
3622
+ return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target);
3618
3623
  }
3619
3624
  }
3620
3625
  function isTypeOfArray(target) {
@@ -3652,11 +3657,13 @@ class AsnSchemaStorage {
3652
3657
  has(target) {
3653
3658
  return this.items.has(target);
3654
3659
  }
3655
- get(target) {
3656
- var _a, _b, _c;
3660
+ get(target, checkSchema = false) {
3657
3661
  const schema = this.items.get(target);
3658
3662
  if (!schema) {
3659
- throw new Error(`Cannot get schema for '${(_c = (_b = (_a = target === null || target === void 0 ? void 0 : target.prototype) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : target}' target`);
3663
+ throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`);
3664
+ }
3665
+ if (checkSchema && !schema.schema) {
3666
+ throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);
3660
3667
  }
3661
3668
  return schema;
3662
3669
  }
@@ -3687,7 +3694,7 @@ class AsnSchemaStorage {
3687
3694
  let asn1Item;
3688
3695
  if (typeof (item.type) === "number") {
3689
3696
  const Asn1TypeName = AsnPropTypes[item.type];
3690
- const Asn1Type = asn1[Asn1TypeName];
3697
+ const Asn1Type = asn1js[Asn1TypeName];
3691
3698
  if (!Asn1Type) {
3692
3699
  throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`);
3693
3700
  }
@@ -3745,9 +3752,9 @@ class AsnSchemaStorage {
3745
3752
  this.cache(item.type);
3746
3753
  const isRepeated = !!item.repeated;
3747
3754
  let value = !isRepeated
3748
- ? this.get(item.type).schema
3755
+ ? this.get(item.type, true).schema
3749
3756
  : asn1Item;
3750
- value = value.valueBlock ? value.valueBlock.value : value.value;
3757
+ value = "valueBlock" in value ? value.valueBlock.value : value.value;
3751
3758
  asn1Value.push(new Constructed({
3752
3759
  name: !isRepeated ? name : "",
3753
3760
  optional,
@@ -3755,7 +3762,7 @@ class AsnSchemaStorage {
3755
3762
  tagClass: 3,
3756
3763
  tagNumber: item.context,
3757
3764
  },
3758
- value,
3765
+ value: value,
3759
3766
  }));
3760
3767
  }
3761
3768
  }
@@ -3791,7 +3798,7 @@ class AsnSchemaStorage {
3791
3798
  return this;
3792
3799
  }
3793
3800
  findParentSchema(target) {
3794
- const parent = target.__proto__;
3801
+ const parent = Object.getPrototypeOf(target);
3795
3802
  if (parent) {
3796
3803
  const schema = this.items.get(parent);
3797
3804
  return schema || this.findParentSchema(parent);
@@ -3877,15 +3884,19 @@ class AsnParser {
3877
3884
  }
3878
3885
  const res = new target();
3879
3886
  if (isTypeOfArray(target)) {
3880
- if (typeof schema.itemType === "number") {
3881
- const converter = defaultConverter(schema.itemType);
3887
+ if (!("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) {
3888
+ throw new Error(`Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.`);
3889
+ }
3890
+ const itemType = schema.itemType;
3891
+ if (typeof itemType === "number") {
3892
+ const converter = defaultConverter(itemType);
3882
3893
  if (!converter) {
3883
3894
  throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
3884
3895
  }
3885
3896
  return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element));
3886
3897
  }
3887
3898
  else {
3888
- return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, schema.itemType));
3899
+ return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType));
3889
3900
  }
3890
3901
  }
3891
3902
  for (const key in schema.items) {
@@ -3894,9 +3905,10 @@ class AsnParser {
3894
3905
  continue;
3895
3906
  }
3896
3907
  const schemaItem = schema.items[key];
3897
- if (typeof (schemaItem.type) === "number" || isConvertible(schemaItem.type)) {
3898
- const converter = (_a = schemaItem.converter) !== null && _a !== void 0 ? _a : (isConvertible(schemaItem.type)
3899
- ? new schemaItem.type()
3908
+ const schemaItemType = schemaItem.type;
3909
+ if (typeof schemaItemType === "number" || isConvertible(schemaItemType)) {
3910
+ const converter = (_a = schemaItem.converter) !== null && _a !== void 0 ? _a : (isConvertible(schemaItemType)
3911
+ ? new schemaItemType()
3900
3912
  : null);
3901
3913
  if (!converter) {
3902
3914
  throw new Error("Converter is empty");
@@ -3908,7 +3920,14 @@ class AsnParser {
3908
3920
  : Set;
3909
3921
  const newItem = new Container();
3910
3922
  newItem.valueBlock = asn1SchemaValue.valueBlock;
3911
- const value = fromBER(newItem.toBER(false)).result.valueBlock.value;
3923
+ const newItemAsn = fromBER(newItem.toBER(false));
3924
+ if (newItemAsn.offset === -1) {
3925
+ throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
3926
+ }
3927
+ if (!("value" in newItemAsn.result.valueBlock && Array.isArray(newItemAsn.result.valueBlock.value))) {
3928
+ throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
3929
+ }
3930
+ const value = newItemAsn.result.valueBlock.value;
3912
3931
  res[key] = Array.from(value, (element) => converter.fromASN(element));
3913
3932
  }
3914
3933
  else {
@@ -3919,12 +3938,12 @@ class AsnParser {
3919
3938
  let value = asn1SchemaValue;
3920
3939
  if (schemaItem.implicit) {
3921
3940
  let newItem;
3922
- if (isConvertible(schemaItem.type)) {
3923
- newItem = new schemaItem.type().toSchema("");
3941
+ if (isConvertible(schemaItemType)) {
3942
+ newItem = new schemaItemType().toSchema("");
3924
3943
  }
3925
3944
  else {
3926
- const Asn1TypeName = AsnPropTypes[schemaItem.type];
3927
- const Asn1Type = asn1[Asn1TypeName];
3945
+ const Asn1TypeName = AsnPropTypes[schemaItemType];
3946
+ const Asn1Type = asn1js[Asn1TypeName];
3928
3947
  if (!Asn1Type) {
3929
3948
  throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`);
3930
3949
  }
@@ -3938,10 +3957,13 @@ class AsnParser {
3938
3957
  }
3939
3958
  else {
3940
3959
  if (schemaItem.repeated) {
3941
- res[key] = Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItem.type));
3960
+ if (!Array.isArray(asn1SchemaValue)) {
3961
+ throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");
3962
+ }
3963
+ res[key] = Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType));
3942
3964
  }
3943
3965
  else {
3944
- res[key] = this.fromASN(asn1SchemaValue, schemaItem.type);
3966
+ res[key] = this.fromASN(asn1SchemaValue, schemaItemType);
3945
3967
  }
3946
3968
  }
3947
3969
  }
@@ -3964,14 +3986,20 @@ class AsnSerializer {
3964
3986
  return this.toASN(obj).toBER(false);
3965
3987
  }
3966
3988
  static toASN(obj) {
3967
- if (obj && isConvertible(obj.constructor)) {
3989
+ if (obj && typeof obj === "object" && isConvertible(obj)) {
3968
3990
  return obj.toASN();
3969
3991
  }
3992
+ if (!(obj && typeof obj === "object")) {
3993
+ throw new TypeError("Parameter 1 should be type of Object.");
3994
+ }
3970
3995
  const target = obj.constructor;
3971
3996
  const schema = schemaStorage.get(target);
3972
3997
  schemaStorage.cache(target);
3973
3998
  let asn1Value = [];
3974
3999
  if (schema.itemType) {
4000
+ if (!Array.isArray(obj)) {
4001
+ throw new TypeError("Parameter 1 should be type of Array.");
4002
+ }
3975
4003
  if (typeof schema.itemType === "number") {
3976
4004
  const converter = defaultConverter(schema.itemType);
3977
4005
  if (!converter) {
@@ -3993,13 +4021,13 @@ class AsnSerializer {
3993
4021
  && isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
3994
4022
  continue;
3995
4023
  }
3996
- let asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
4024
+ const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
3997
4025
  if (typeof schemaItem.context === "number") {
3998
4026
  if (schemaItem.implicit) {
3999
4027
  if (!schemaItem.repeated
4000
4028
  && (typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) {
4001
4029
  const value = {};
4002
- value.valueHex = asn1Item instanceof Null ? asn1Item.valueBeforeDecode : asn1Item.valueBlock.toBER();
4030
+ value.valueHex = asn1Item instanceof Null ? asn1Item.valueBeforeDecodeView : asn1Item.valueBlock.toBER();
4003
4031
  asn1Value.push(new Primitive({
4004
4032
  optional: schemaItem.optional,
4005
4033
  idBlock: {
@@ -4064,6 +4092,9 @@ class AsnSerializer {
4064
4092
  throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
4065
4093
  }
4066
4094
  if (schemaItem.repeated) {
4095
+ if (!Array.isArray(objProp)) {
4096
+ throw new TypeError("Parameter 'objProp' should be type of Array.");
4097
+ }
4067
4098
  const items = Array.from(objProp, (element) => converter.toASN(element));
4068
4099
  const Container = schemaItem.repeated === "sequence"
4069
4100
  ? Sequence
@@ -4078,6 +4109,9 @@ class AsnSerializer {
4078
4109
  }
4079
4110
  else {
4080
4111
  if (schemaItem.repeated) {
4112
+ if (!Array.isArray(objProp)) {
4113
+ throw new TypeError("Parameter 'objProp' should be type of Array.");
4114
+ }
4081
4115
  const items = Array.from(objProp, (element) => this.toASN(element));
4082
4116
  const Container = schemaItem.repeated === "sequence"
4083
4117
  ? Sequence
@@ -5429,7 +5463,7 @@ let DisplayText = class DisplayText {
5429
5463
  Object.assign(this, params);
5430
5464
  }
5431
5465
  toString() {
5432
- return this.ia5String || this.visibleString || this.bmpString || this.utf8String;
5466
+ return this.ia5String || this.visibleString || this.bmpString || this.utf8String || "";
5433
5467
  }
5434
5468
  };
5435
5469
  __decorate([
@@ -5520,6 +5554,7 @@ CertificatePolicies = CertificatePolicies_1 = __decorate([
5520
5554
  AsnType({ type: AsnTypeTypes.Sequence, itemType: PolicyInformation })
5521
5555
  ], CertificatePolicies);
5522
5556
 
5557
+ const id_ce_cRLNumber = `${id_ce}.20`;
5523
5558
  let CRLNumber = class CRLNumber {
5524
5559
  constructor(value = 0) {
5525
5560
  this.value = value;
@@ -5532,6 +5567,7 @@ CRLNumber = __decorate([
5532
5567
  AsnType({ type: AsnTypeTypes.Choice })
5533
5568
  ], CRLNumber);
5534
5569
 
5570
+ const id_ce_deltaCRLIndicator = `${id_ce}.27`;
5535
5571
  let BaseCRLNumber = class BaseCRLNumber extends CRLNumber {
5536
5572
  };
5537
5573
  BaseCRLNumber = __decorate([
@@ -5638,6 +5674,7 @@ FreshestCRL = FreshestCRL_1 = __decorate([
5638
5674
  AsnType({ type: AsnTypeTypes.Sequence, itemType: DistributionPoint })
5639
5675
  ], FreshestCRL);
5640
5676
 
5677
+ const id_ce_issuingDistributionPoint = `${id_ce}.28`;
5641
5678
  class IssuingDistributionPoint {
5642
5679
  constructor(params = {}) {
5643
5680
  this.onlyContainsUserCerts = IssuingDistributionPoint.ONLY;
@@ -5646,29 +5683,25 @@ class IssuingDistributionPoint {
5646
5683
  this.onlyContainsAttributeCerts = IssuingDistributionPoint.ONLY;
5647
5684
  Object.assign(this, params);
5648
5685
  }
5649
- ;
5650
- ;
5651
- ;
5652
- ;
5653
5686
  }
5654
5687
  IssuingDistributionPoint.ONLY = false;
5655
5688
  __decorate([
5656
5689
  AsnProp({ type: DistributionPointName, context: 0, optional: true })
5657
5690
  ], IssuingDistributionPoint.prototype, "distributionPoint", void 0);
5658
5691
  __decorate([
5659
- AsnProp({ type: AsnPropTypes.Boolean, context: 1, defaultValue: IssuingDistributionPoint.ONLY })
5692
+ AsnProp({ type: AsnPropTypes.Boolean, context: 1, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
5660
5693
  ], IssuingDistributionPoint.prototype, "onlyContainsUserCerts", void 0);
5661
5694
  __decorate([
5662
- AsnProp({ type: AsnPropTypes.Boolean, context: 2, defaultValue: IssuingDistributionPoint.ONLY })
5695
+ AsnProp({ type: AsnPropTypes.Boolean, context: 2, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
5663
5696
  ], IssuingDistributionPoint.prototype, "onlyContainsCACerts", void 0);
5664
5697
  __decorate([
5665
- AsnProp({ type: Reason, context: 3, optional: true })
5698
+ AsnProp({ type: Reason, context: 3, optional: true, implicit: true })
5666
5699
  ], IssuingDistributionPoint.prototype, "onlySomeReasons", void 0);
5667
5700
  __decorate([
5668
- AsnProp({ type: AsnPropTypes.Boolean, context: 4, defaultValue: IssuingDistributionPoint.ONLY })
5701
+ AsnProp({ type: AsnPropTypes.Boolean, context: 4, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
5669
5702
  ], IssuingDistributionPoint.prototype, "indirectCRL", void 0);
5670
5703
  __decorate([
5671
- AsnProp({ type: AsnPropTypes.Boolean, context: 5, defaultValue: IssuingDistributionPoint.ONLY })
5704
+ AsnProp({ type: AsnPropTypes.Boolean, context: 5, defaultValue: IssuingDistributionPoint.ONLY, implicit: true })
5672
5705
  ], IssuingDistributionPoint.prototype, "onlyContainsAttributeCerts", void 0);
5673
5706
 
5674
5707
  const id_ce_cRLReasons = `${id_ce}.21`;
@@ -6041,11 +6074,14 @@ __decorate([
6041
6074
  let Time = class Time {
6042
6075
  constructor(time) {
6043
6076
  if (time) {
6044
- if (typeof time === "string" || typeof time === "number") {
6045
- this.utcTime = new Date(time);
6046
- }
6047
- else if (time instanceof Date) {
6048
- this.utcTime = time;
6077
+ if (typeof time === "string" || typeof time === "number" || time instanceof Date) {
6078
+ const date = new Date(time);
6079
+ if (date.getUTCFullYear() > 2049) {
6080
+ this.generalTime = date;
6081
+ }
6082
+ else {
6083
+ this.utcTime = date;
6084
+ }
6049
6085
  }
6050
6086
  else {
6051
6087
  Object.assign(this, time);
@@ -10053,6 +10089,9 @@ class Extension extends AsnData {
10053
10089
  case '2.5.29.46':
10054
10090
  this.value = AsnParser.parse(asnExtnValue, CRLDistributionPoints);
10055
10091
  break;
10092
+ case id_ce_issuingDistributionPoint:
10093
+ this.value = AsnParser.parse(asnExtnValue, IssuingDistributionPoint);
10094
+ break;
10056
10095
  case id_ce_cRLReasons:
10057
10096
  this.value = AsnParser.parse(asnExtnValue, CRLReason);
10058
10097
  break;
@@ -10141,6 +10180,12 @@ class Extension extends AsnData {
10141
10180
  case id_pe_subjectInfoAccess:
10142
10181
  this.value = AsnParser.parse(asnExtnValue, SubjectInfoAccessSyntax);
10143
10182
  break;
10183
+ case id_ce_cRLNumber:
10184
+ this.value = AsnParser.parse(asnExtnValue, CRLNumber);
10185
+ break;
10186
+ case id_ce_deltaCRLIndicator:
10187
+ this.value = AsnParser.parse(asnExtnValue, BaseCRLNumber);
10188
+ break;
10144
10189
  default:
10145
10190
  console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
10146
10191
  this.value = build.Convert.ToHex(asnExtnValue);
@@ -10197,10 +10242,11 @@ class CryptoProvider {
10197
10242
  CryptoProvider.DEFAULT = 'default';
10198
10243
  const cryptoProvider = new CryptoProvider();
10199
10244
 
10200
- const base64Clarify = (base64) => (base64
10201
- .replace(/.*base64,/, '')
10202
- .replace(/-----.+-----/g, '')
10203
- .replace(/[\s\r\n]/g, ''));
10245
+ const base64Re = /-----BEGIN [^-]+-----([A-Za-z0-9+/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+/=\s]+)====/;
10246
+ const base64Clarify = (base64) => {
10247
+ const execArray = base64Re.exec(base64);
10248
+ return execArray ? (execArray[1] || execArray[2]) : base64;
10249
+ };
10204
10250
  const hexFormat = (hex) => (hex
10205
10251
  .replace(/(.{32})/g, '$1\n')
10206
10252
  .replace(/(.{4})/g, '$1 ')
@@ -10881,6 +10927,77 @@ __decorate([
10881
10927
  AsnProp({ type: EncapsulatedContent, context: 0, optional: true })
10882
10928
  ], EncapsulatedContentInfo.prototype, "eContent", void 0);
10883
10929
 
10930
+ var CMSVersion;
10931
+ (function (CMSVersion) {
10932
+ CMSVersion[CMSVersion["v0"] = 0] = "v0";
10933
+ CMSVersion[CMSVersion["v1"] = 1] = "v1";
10934
+ CMSVersion[CMSVersion["v2"] = 2] = "v2";
10935
+ CMSVersion[CMSVersion["v3"] = 3] = "v3";
10936
+ CMSVersion[CMSVersion["v4"] = 4] = "v4";
10937
+ CMSVersion[CMSVersion["v5"] = 5] = "v5";
10938
+ })(CMSVersion || (CMSVersion = {}));
10939
+ let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
10940
+ };
10941
+ DigestAlgorithmIdentifier = __decorate([
10942
+ AsnType({ type: AsnTypeTypes.Sequence })
10943
+ ], DigestAlgorithmIdentifier);
10944
+ let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
10945
+ };
10946
+ SignatureAlgorithmIdentifier = __decorate([
10947
+ AsnType({ type: AsnTypeTypes.Sequence })
10948
+ ], SignatureAlgorithmIdentifier);
10949
+ let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
10950
+ };
10951
+ KeyEncryptionAlgorithmIdentifier = __decorate([
10952
+ AsnType({ type: AsnTypeTypes.Sequence })
10953
+ ], KeyEncryptionAlgorithmIdentifier);
10954
+ let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
10955
+ };
10956
+ ContentEncryptionAlgorithmIdentifier = __decorate([
10957
+ AsnType({ type: AsnTypeTypes.Sequence })
10958
+ ], ContentEncryptionAlgorithmIdentifier);
10959
+ let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {
10960
+ };
10961
+ MessageAuthenticationCodeAlgorithm = __decorate([
10962
+ AsnType({ type: AsnTypeTypes.Sequence })
10963
+ ], MessageAuthenticationCodeAlgorithm);
10964
+ let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {
10965
+ };
10966
+ KeyDerivationAlgorithmIdentifier = __decorate([
10967
+ AsnType({ type: AsnTypeTypes.Sequence })
10968
+ ], KeyDerivationAlgorithmIdentifier);
10969
+
10970
+ let EncryptedContent = class EncryptedContent {
10971
+ constructor(params = {}) {
10972
+ Object.assign(this, params);
10973
+ }
10974
+ };
10975
+ __decorate([
10976
+ AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
10977
+ ], EncryptedContent.prototype, "value", void 0);
10978
+ __decorate([
10979
+ AsnProp({ type: OctetString, converter: AsnConstructedOctetStringConverter, context: 0, implicit: true, optional: true, repeated: "sequence" })
10980
+ ], EncryptedContent.prototype, "constructedValue", void 0);
10981
+ EncryptedContent = __decorate([
10982
+ AsnType({ type: AsnTypeTypes.Choice })
10983
+ ], EncryptedContent);
10984
+ class EncryptedContentInfo {
10985
+ constructor(params = {}) {
10986
+ this.contentType = "";
10987
+ this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
10988
+ Object.assign(this, params);
10989
+ }
10990
+ }
10991
+ __decorate([
10992
+ AsnProp({ type: AsnPropTypes.ObjectIdentifier })
10993
+ ], EncryptedContentInfo.prototype, "contentType", void 0);
10994
+ __decorate([
10995
+ AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
10996
+ ], EncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
10997
+ __decorate([
10998
+ AsnProp({ type: EncryptedContent, optional: true })
10999
+ ], EncryptedContentInfo.prototype, "encryptedContent", void 0);
11000
+
10884
11001
  class IssuerAndSerialNumber {
10885
11002
  constructor(params = {}) {
10886
11003
  this.issuer = new Name$1;
@@ -10895,6 +11012,268 @@ __decorate([
10895
11012
  AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
10896
11013
  ], IssuerAndSerialNumber.prototype, "serialNumber", void 0);
10897
11014
 
11015
+ class OtherKeyAttribute {
11016
+ constructor(params = {}) {
11017
+ this.keyAttrId = "";
11018
+ Object.assign(this, params);
11019
+ }
11020
+ }
11021
+ __decorate([
11022
+ AsnProp({ type: AsnPropTypes.ObjectIdentifier })
11023
+ ], OtherKeyAttribute.prototype, "keyAttrId", void 0);
11024
+ __decorate([
11025
+ AsnProp({ type: AsnPropTypes.Any, optional: true })
11026
+ ], OtherKeyAttribute.prototype, "keyAttr", void 0);
11027
+
11028
+ var RecipientEncryptedKeys_1;
11029
+ class RecipientKeyIdentifier {
11030
+ constructor(params = {}) {
11031
+ this.subjectKeyIdentifier = new SubjectKeyIdentifier();
11032
+ Object.assign(this, params);
11033
+ }
11034
+ }
11035
+ __decorate([
11036
+ AsnProp({ type: SubjectKeyIdentifier })
11037
+ ], RecipientKeyIdentifier.prototype, "subjectKeyIdentifier", void 0);
11038
+ __decorate([
11039
+ AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
11040
+ ], RecipientKeyIdentifier.prototype, "date", void 0);
11041
+ __decorate([
11042
+ AsnProp({ type: OtherKeyAttribute, optional: true })
11043
+ ], RecipientKeyIdentifier.prototype, "other", void 0);
11044
+ let KeyAgreeRecipientIdentifier = class KeyAgreeRecipientIdentifier {
11045
+ constructor(params = {}) {
11046
+ Object.assign(this, params);
11047
+ }
11048
+ };
11049
+ __decorate([
11050
+ AsnProp({ type: RecipientKeyIdentifier, context: 0, implicit: true, optional: true })
11051
+ ], KeyAgreeRecipientIdentifier.prototype, "rKeyId", void 0);
11052
+ __decorate([
11053
+ AsnProp({ type: IssuerAndSerialNumber, optional: true })
11054
+ ], KeyAgreeRecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
11055
+ KeyAgreeRecipientIdentifier = __decorate([
11056
+ AsnType({ type: AsnTypeTypes.Choice })
11057
+ ], KeyAgreeRecipientIdentifier);
11058
+ class RecipientEncryptedKey {
11059
+ constructor(params = {}) {
11060
+ this.rid = new KeyAgreeRecipientIdentifier();
11061
+ this.encryptedKey = new OctetString();
11062
+ Object.assign(this, params);
11063
+ }
11064
+ }
11065
+ __decorate([
11066
+ AsnProp({ type: KeyAgreeRecipientIdentifier })
11067
+ ], RecipientEncryptedKey.prototype, "rid", void 0);
11068
+ __decorate([
11069
+ AsnProp({ type: OctetString })
11070
+ ], RecipientEncryptedKey.prototype, "encryptedKey", void 0);
11071
+ let RecipientEncryptedKeys = RecipientEncryptedKeys_1 = class RecipientEncryptedKeys extends AsnArray {
11072
+ constructor(items) {
11073
+ super(items);
11074
+ Object.setPrototypeOf(this, RecipientEncryptedKeys_1.prototype);
11075
+ }
11076
+ };
11077
+ RecipientEncryptedKeys = RecipientEncryptedKeys_1 = __decorate([
11078
+ AsnType({ type: AsnTypeTypes.Sequence, itemType: RecipientEncryptedKey })
11079
+ ], RecipientEncryptedKeys);
11080
+ class OriginatorPublicKey {
11081
+ constructor(params = {}) {
11082
+ this.algorithm = new AlgorithmIdentifier();
11083
+ this.publicKey = new ArrayBuffer(0);
11084
+ Object.assign(this, params);
11085
+ }
11086
+ }
11087
+ __decorate([
11088
+ AsnProp({ type: AlgorithmIdentifier })
11089
+ ], OriginatorPublicKey.prototype, "algorithm", void 0);
11090
+ __decorate([
11091
+ AsnProp({ type: AsnPropTypes.BitString })
11092
+ ], OriginatorPublicKey.prototype, "publicKey", void 0);
11093
+ let OriginatorIdentifierOrKey = class OriginatorIdentifierOrKey {
11094
+ constructor(params = {}) {
11095
+ Object.assign(this, params);
11096
+ }
11097
+ };
11098
+ __decorate([
11099
+ AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true, optional: true })
11100
+ ], OriginatorIdentifierOrKey.prototype, "subjectKeyIdentifier", void 0);
11101
+ __decorate([
11102
+ AsnProp({ type: OriginatorPublicKey, context: 1, implicit: true, optional: true })
11103
+ ], OriginatorIdentifierOrKey.prototype, "originatorKey", void 0);
11104
+ __decorate([
11105
+ AsnProp({ type: IssuerAndSerialNumber, optional: true })
11106
+ ], OriginatorIdentifierOrKey.prototype, "issuerAndSerialNumber", void 0);
11107
+ OriginatorIdentifierOrKey = __decorate([
11108
+ AsnType({ type: AsnTypeTypes.Choice })
11109
+ ], OriginatorIdentifierOrKey);
11110
+ class KeyAgreeRecipientInfo {
11111
+ constructor(params = {}) {
11112
+ this.version = CMSVersion.v3;
11113
+ this.originator = new OriginatorIdentifierOrKey();
11114
+ this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
11115
+ this.recipientEncryptedKeys = new RecipientEncryptedKeys();
11116
+ Object.assign(this, params);
11117
+ }
11118
+ }
11119
+ __decorate([
11120
+ AsnProp({ type: AsnPropTypes.Integer })
11121
+ ], KeyAgreeRecipientInfo.prototype, "version", void 0);
11122
+ __decorate([
11123
+ AsnProp({ type: OriginatorIdentifierOrKey, context: 0 })
11124
+ ], KeyAgreeRecipientInfo.prototype, "originator", void 0);
11125
+ __decorate([
11126
+ AsnProp({ type: OctetString, context: 1, optional: true })
11127
+ ], KeyAgreeRecipientInfo.prototype, "ukm", void 0);
11128
+ __decorate([
11129
+ AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
11130
+ ], KeyAgreeRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
11131
+ __decorate([
11132
+ AsnProp({ type: RecipientEncryptedKeys })
11133
+ ], KeyAgreeRecipientInfo.prototype, "recipientEncryptedKeys", void 0);
11134
+
11135
+ let RecipientIdentifier = class RecipientIdentifier {
11136
+ constructor(params = {}) {
11137
+ Object.assign(this, params);
11138
+ }
11139
+ };
11140
+ __decorate([
11141
+ AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
11142
+ ], RecipientIdentifier.prototype, "subjectKeyIdentifier", void 0);
11143
+ __decorate([
11144
+ AsnProp({ type: IssuerAndSerialNumber })
11145
+ ], RecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
11146
+ RecipientIdentifier = __decorate([
11147
+ AsnType({ type: AsnTypeTypes.Choice })
11148
+ ], RecipientIdentifier);
11149
+ class KeyTransRecipientInfo {
11150
+ constructor(params = {}) {
11151
+ this.version = CMSVersion.v0;
11152
+ this.rid = new RecipientIdentifier();
11153
+ this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
11154
+ this.encryptedKey = new OctetString();
11155
+ Object.assign(this, params);
11156
+ }
11157
+ }
11158
+ __decorate([
11159
+ AsnProp({ type: AsnPropTypes.Integer })
11160
+ ], KeyTransRecipientInfo.prototype, "version", void 0);
11161
+ __decorate([
11162
+ AsnProp({ type: RecipientIdentifier })
11163
+ ], KeyTransRecipientInfo.prototype, "rid", void 0);
11164
+ __decorate([
11165
+ AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
11166
+ ], KeyTransRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
11167
+ __decorate([
11168
+ AsnProp({ type: OctetString })
11169
+ ], KeyTransRecipientInfo.prototype, "encryptedKey", void 0);
11170
+
11171
+ class KEKIdentifier {
11172
+ constructor(params = {}) {
11173
+ this.keyIdentifier = new OctetString();
11174
+ Object.assign(this, params);
11175
+ }
11176
+ }
11177
+ __decorate([
11178
+ AsnProp({ type: OctetString })
11179
+ ], KEKIdentifier.prototype, "keyIdentifier", void 0);
11180
+ __decorate([
11181
+ AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
11182
+ ], KEKIdentifier.prototype, "date", void 0);
11183
+ __decorate([
11184
+ AsnProp({ type: OtherKeyAttribute, optional: true })
11185
+ ], KEKIdentifier.prototype, "other", void 0);
11186
+ class KEKRecipientInfo {
11187
+ constructor(params = {}) {
11188
+ this.version = CMSVersion.v4;
11189
+ this.kekid = new KEKIdentifier();
11190
+ this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
11191
+ this.encryptedKey = new OctetString();
11192
+ Object.assign(this, params);
11193
+ }
11194
+ }
11195
+ __decorate([
11196
+ AsnProp({ type: AsnPropTypes.Integer })
11197
+ ], KEKRecipientInfo.prototype, "version", void 0);
11198
+ __decorate([
11199
+ AsnProp({ type: KEKIdentifier })
11200
+ ], KEKRecipientInfo.prototype, "kekid", void 0);
11201
+ __decorate([
11202
+ AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
11203
+ ], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
11204
+ __decorate([
11205
+ AsnProp({ type: OctetString })
11206
+ ], KEKRecipientInfo.prototype, "encryptedKey", void 0);
11207
+
11208
+ class PasswordRecipientInfo {
11209
+ constructor(params = {}) {
11210
+ this.version = CMSVersion.v0;
11211
+ this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
11212
+ this.encryptedKey = new OctetString();
11213
+ Object.assign(this, params);
11214
+ }
11215
+ }
11216
+ __decorate([
11217
+ AsnProp({ type: AsnPropTypes.Integer })
11218
+ ], PasswordRecipientInfo.prototype, "version", void 0);
11219
+ __decorate([
11220
+ AsnProp({ type: KeyDerivationAlgorithmIdentifier, context: 0, optional: true })
11221
+ ], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0);
11222
+ __decorate([
11223
+ AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
11224
+ ], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
11225
+ __decorate([
11226
+ AsnProp({ type: OctetString })
11227
+ ], PasswordRecipientInfo.prototype, "encryptedKey", void 0);
11228
+
11229
+ class OtherRecipientInfo {
11230
+ constructor(params = {}) {
11231
+ this.oriType = "";
11232
+ this.oriValue = new ArrayBuffer(0);
11233
+ Object.assign(this, params);
11234
+ }
11235
+ }
11236
+ __decorate([
11237
+ AsnProp({ type: AsnPropTypes.ObjectIdentifier })
11238
+ ], OtherRecipientInfo.prototype, "oriType", void 0);
11239
+ __decorate([
11240
+ AsnProp({ type: AsnPropTypes.Any })
11241
+ ], OtherRecipientInfo.prototype, "oriValue", void 0);
11242
+ let RecipientInfo = class RecipientInfo {
11243
+ constructor(params = {}) {
11244
+ Object.assign(this, params);
11245
+ }
11246
+ };
11247
+ __decorate([
11248
+ AsnProp({ type: KeyTransRecipientInfo, optional: true })
11249
+ ], RecipientInfo.prototype, "ktri", void 0);
11250
+ __decorate([
11251
+ AsnProp({ type: KeyAgreeRecipientInfo, context: 1, implicit: true, optional: true })
11252
+ ], RecipientInfo.prototype, "kari", void 0);
11253
+ __decorate([
11254
+ AsnProp({ type: KEKRecipientInfo, context: 2, implicit: true, optional: true })
11255
+ ], RecipientInfo.prototype, "kekri", void 0);
11256
+ __decorate([
11257
+ AsnProp({ type: PasswordRecipientInfo, context: 3, implicit: true, optional: true })
11258
+ ], RecipientInfo.prototype, "pwri", void 0);
11259
+ __decorate([
11260
+ AsnProp({ type: OtherRecipientInfo, context: 4, implicit: true, optional: true })
11261
+ ], RecipientInfo.prototype, "ori", void 0);
11262
+ RecipientInfo = __decorate([
11263
+ AsnType({ type: AsnTypeTypes.Choice })
11264
+ ], RecipientInfo);
11265
+
11266
+ var RecipientInfos_1;
11267
+ let RecipientInfos = RecipientInfos_1 = class RecipientInfos extends AsnArray {
11268
+ constructor(items) {
11269
+ super(items);
11270
+ Object.setPrototypeOf(this, RecipientInfos_1.prototype);
11271
+ }
11272
+ };
11273
+ RecipientInfos = RecipientInfos_1 = __decorate([
11274
+ AsnType({ type: AsnTypeTypes.Set, itemType: RecipientInfo })
11275
+ ], RecipientInfos);
11276
+
10898
11277
  var RevocationInfoChoices_1;
10899
11278
  class OtherRevocationInfoFormat {
10900
11279
  constructor(params = {}) {
@@ -10931,25 +11310,51 @@ RevocationInfoChoices = RevocationInfoChoices_1 = __decorate([
10931
11310
  AsnType({ type: AsnTypeTypes.Set, itemType: RevocationInfoChoice })
10932
11311
  ], RevocationInfoChoices);
10933
11312
 
10934
- var CMSVersion;
10935
- (function (CMSVersion) {
10936
- CMSVersion[CMSVersion["v0"] = 0] = "v0";
10937
- CMSVersion[CMSVersion["v1"] = 1] = "v1";
10938
- CMSVersion[CMSVersion["v2"] = 2] = "v2";
10939
- CMSVersion[CMSVersion["v3"] = 3] = "v3";
10940
- CMSVersion[CMSVersion["v4"] = 4] = "v4";
10941
- CMSVersion[CMSVersion["v5"] = 5] = "v5";
10942
- })(CMSVersion || (CMSVersion = {}));
10943
- let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
10944
- };
10945
- DigestAlgorithmIdentifier = __decorate([
10946
- AsnType({ type: AsnTypeTypes.Sequence })
10947
- ], DigestAlgorithmIdentifier);
10948
- let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
11313
+ class OriginatorInfo {
11314
+ constructor(params = {}) {
11315
+ Object.assign(this, params);
11316
+ }
11317
+ }
11318
+ __decorate([
11319
+ AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
11320
+ ], OriginatorInfo.prototype, "certs", void 0);
11321
+ __decorate([
11322
+ AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
11323
+ ], OriginatorInfo.prototype, "crls", void 0);
11324
+
11325
+ var UnprotectedAttributes_1;
11326
+ let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends AsnArray {
11327
+ constructor(items) {
11328
+ super(items);
11329
+ Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
11330
+ }
10949
11331
  };
10950
- SignatureAlgorithmIdentifier = __decorate([
10951
- AsnType({ type: AsnTypeTypes.Sequence })
10952
- ], SignatureAlgorithmIdentifier);
11332
+ UnprotectedAttributes = UnprotectedAttributes_1 = __decorate([
11333
+ AsnType({ type: AsnTypeTypes.Set, itemType: Attribute })
11334
+ ], UnprotectedAttributes);
11335
+ class EnvelopedData {
11336
+ constructor(params = {}) {
11337
+ this.version = CMSVersion.v0;
11338
+ this.recipientInfos = new RecipientInfos();
11339
+ this.encryptedContentInfo = new EncryptedContentInfo();
11340
+ Object.assign(this, params);
11341
+ }
11342
+ }
11343
+ __decorate([
11344
+ AsnProp({ type: AsnPropTypes.Integer })
11345
+ ], EnvelopedData.prototype, "version", void 0);
11346
+ __decorate([
11347
+ AsnProp({ type: OriginatorInfo, context: 0, implicit: true, optional: true })
11348
+ ], EnvelopedData.prototype, "originatorInfo", void 0);
11349
+ __decorate([
11350
+ AsnProp({ type: RecipientInfos })
11351
+ ], EnvelopedData.prototype, "recipientInfos", void 0);
11352
+ __decorate([
11353
+ AsnProp({ type: EncryptedContentInfo })
11354
+ ], EnvelopedData.prototype, "encryptedContentInfo", void 0);
11355
+ __decorate([
11356
+ AsnProp({ type: UnprotectedAttributes, context: 1, implicit: true, optional: true })
11357
+ ], EnvelopedData.prototype, "unprotectedAttrs", void 0);
10953
11358
 
10954
11359
  let SignerIdentifier = class SignerIdentifier {
10955
11360
  constructor(params = {}) {
@@ -11506,4 +11911,4 @@ __decorate([
11506
11911
  AsnProp({ type: AsnPropTypes.BitString })
11507
11912
  ], CertificationRequest.prototype, "signature", void 0);
11508
11913
 
11509
- export { BasicConstraints as $, AsnData as A, id_DomainNameTechnicalOperator as B, Certificate as C, DomainNameTechnicalOperator as D, Extension as E, id_DomainNameOwner as F, DomainNameOwner as G, id_DomainNameLegalRepresentative as H, InsuranceValue as I, DomainNameLegalRepresentative as J, id_DomainNameBeneficiary as K, DomainNameBeneficiary as L, CertificationRequest as M, Name as N, OIDs as O, Name$1 as P, OtherName as Q, RSAPublicKey as R, DisplayText as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, UserNotice as X, EDIPartyName as Y, AsnIntegerArrayBufferConverter as Z, KeyUsage as _, isX509Pem as a, ExtendedKeyUsage as a0, SubjectKeyIdentifier as a1, AuthorityKeyIdentifier as a2, CRLDistributionPoints as a3, AuthorityInfoAccessSyntax as a4, SubjectInfoAccessSyntax as a5, SubjectAlternativeName as a6, CertificatePolicies as a7, CertificateTransparency as a8, NameConstraints as a9, CertificateTemplate as aa, EnrollCertTypeChoice as ab, CaVersion as ac, QCStatements as ad, NetscapeComment as ae, NetscapeCertType as af, LeiRole as ag, LeiChoice as ah, Timestamp as ai, ArchiveRevInfo as aj, CRLReason as ak, SubjectDirectoryAttributes as al, PrivateKeyUsagePeriod as am, EntrustVersionInfo as an, BiometricSyntax as ao, LogotypeExtn as ap, TNAuthorizationList as aq, PolicyConstraints as ar, PolicyMappings as as, isPkcs10Pem as b, isX509AttributePem as c, certificateRawToBuffer as d, AsnConvert as e, id_ecPublicKey as f, ECParameters as g, id_rsaEncryption as h, isPem as i, hexFormat as j, base64Format as k, getCertificateThumbprint as l, AttributeCertificate as m, Attribute$1 as n, id_pkcs9_at_extensionRequest as o, AsnParser as p, ExtensionRequest as q, id_pkcs9_at_unstructuredName as r, id_pkcs9_at_challengePassword as s, ChallengePassword as t, id_ValuationRanking as u, id_InsuranceValue as v, id_WebGDPR as w, id_ActivityDescription as x, ActivityDescription as y, id_TypeRelationship as z };
11914
+ export { AsnIntegerArrayBufferConverter as $, AsnData as A, id_DomainNameTechnicalOperator as B, Certificate as C, DomainNameTechnicalOperator as D, Extension as E, id_DomainNameOwner as F, DomainNameOwner as G, id_DomainNameLegalRepresentative as H, InsuranceValue as I, DomainNameLegalRepresentative as J, id_DomainNameBeneficiary as K, DomainNameBeneficiary as L, AttributeCertificate as M, Name as N, CertificationRequest as O, CertificateList as P, OIDs as Q, RSAPublicKey as R, Name$1 as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, OtherName as X, DisplayText as Y, UserNotice as Z, EDIPartyName as _, isX509Pem as a, KeyUsage as a0, BasicConstraints as a1, ExtendedKeyUsage as a2, SubjectKeyIdentifier as a3, AuthorityKeyIdentifier as a4, CRLDistributionPoints as a5, AuthorityInfoAccessSyntax as a6, SubjectInfoAccessSyntax as a7, SubjectAlternativeName as a8, CertificatePolicies as a9, CertificateTransparency as aa, NameConstraints as ab, CertificateTemplate as ac, EnrollCertTypeChoice as ad, CaVersion as ae, QCStatements as af, NetscapeComment as ag, NetscapeCertType as ah, LeiRole as ai, LeiChoice as aj, Timestamp as ak, ArchiveRevInfo as al, CRLReason as am, SubjectDirectoryAttributes as an, PrivateKeyUsagePeriod as ao, EntrustVersionInfo as ap, BiometricSyntax as aq, LogotypeExtn as ar, TNAuthorizationList as as, PolicyConstraints as at, PolicyMappings as au, CRLNumber as av, IssuingDistributionPoint as aw, isPkcs10Pem as b, isX509AttributePem as c, isX509CRLPem as d, certificateRawToBuffer as e, AsnConvert as f, id_ecPublicKey as g, ECParameters as h, isPem as i, id_rsaEncryption as j, hexFormat as k, base64Format as l, getCertificateThumbprint as m, Attribute$1 as n, id_pkcs9_at_extensionRequest as o, AsnParser as p, ExtensionRequest as q, id_pkcs9_at_unstructuredName as r, id_pkcs9_at_challengePassword as s, ChallengePassword as t, id_ValuationRanking as u, id_InsuranceValue as v, id_WebGDPR as w, id_ActivityDescription as x, ActivityDescription as y, id_TypeRelationship as z };