node-opcua-crypto-web 5.11.0 → 6.0.0

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.
@@ -1,8 +1,8 @@
1
1
  import __crypto, { KeyLike } from 'node:crypto';
2
- import { Crypto as Crypto$1 } from '@peculiar/webcrypto';
3
2
  import * as x509 from '@peculiar/x509';
4
3
  import { PublicKeyType, X509CrlReason } from '@peculiar/x509';
5
4
  export { x509 };
5
+ import { Crypto as Crypto$1 } from '@peculiar/webcrypto';
6
6
 
7
7
  declare const createPrivateKeyFromNodeJSCrypto: typeof __crypto.createPrivateKey;
8
8
  type KeyFormat = "pem" | "der" | "jwk";
package/dist/index_web.js CHANGED
@@ -11060,24 +11060,24 @@ var require_algorithms = __commonJS({
11060
11060
  id: ""
11061
11061
  },
11062
11062
  sha256: {
11063
- sign: "ecdsa",
11063
+ sign: "ecdsa/rsa",
11064
11064
  hash: "sha256",
11065
- id: ""
11065
+ id: "3031300d060960864801650304020105000420"
11066
11066
  },
11067
11067
  sha224: {
11068
- sign: "ecdsa",
11068
+ sign: "ecdsa/rsa",
11069
11069
  hash: "sha224",
11070
- id: ""
11070
+ id: "302d300d06096086480165030402040500041c"
11071
11071
  },
11072
11072
  sha384: {
11073
- sign: "ecdsa",
11073
+ sign: "ecdsa/rsa",
11074
11074
  hash: "sha384",
11075
- id: ""
11075
+ id: "3041300d060960864801650304020205000430"
11076
11076
  },
11077
11077
  sha512: {
11078
- sign: "ecdsa",
11078
+ sign: "ecdsa/rsa",
11079
11079
  hash: "sha512",
11080
- id: ""
11080
+ id: "3051300d060960864801650304020305000440"
11081
11081
  },
11082
11082
  "DSA-SHA": {
11083
11083
  sign: "dsa",
@@ -35356,14 +35356,14 @@ var require_asn12 = __commonJS({
35356
35356
  );
35357
35357
  });
35358
35358
  exports2.PublicKey = PublicKey2;
35359
- var PrivateKeyInfo2 = asn12.define("PrivateKeyInfo", function() {
35359
+ var PrivateKeyInfo4 = asn12.define("PrivateKeyInfo", function() {
35360
35360
  this.seq().obj(
35361
35361
  this.key("version")["int"](),
35362
35362
  this.key("algorithm").use(AlgorithmIdentifier2),
35363
35363
  this.key("subjectPrivateKey").octstr()
35364
35364
  );
35365
35365
  });
35366
- exports2.PrivateKey = PrivateKeyInfo2;
35366
+ exports2.PrivateKey = PrivateKeyInfo4;
35367
35367
  var EncryptedPrivateKeyInfo4 = asn12.define("EncryptedPrivateKeyInfo", function() {
35368
35368
  this.seq().obj(
35369
35369
  this.key("algorithm").seq().obj(
@@ -48247,6 +48247,7 @@ __export(x509_es_exports, {
48247
48247
  IssuerAlternativeNameExtension: () => IssuerAlternativeNameExtension,
48248
48248
  KeyUsageFlags: () => KeyUsageFlags2,
48249
48249
  KeyUsagesExtension: () => KeyUsagesExtension,
48250
+ MlDsaAlgorithm: () => MlDsaAlgorithm,
48250
48251
  Name: () => Name3,
48251
48252
  NameIdentifier: () => NameIdentifier,
48252
48253
  OidSerializer: () => OidSerializer,
@@ -48258,6 +48259,7 @@ __export(x509_es_exports, {
48258
48259
  REGISTERED_ID: () => REGISTERED_ID,
48259
48260
  RsaAlgorithm: () => RsaAlgorithm,
48260
48261
  ShaAlgorithm: () => ShaAlgorithm,
48262
+ SlhDsaAlgorithm: () => SlhDsaAlgorithm,
48261
48263
  SubjectAlternativeNameExtension: () => SubjectAlternativeNameExtension,
48262
48264
  SubjectKeyIdentifierExtension: () => SubjectKeyIdentifierExtension,
48263
48265
  TextConverter: () => TextConverter,
@@ -54916,10 +54918,10 @@ Extensions = Extensions_1 = __decorate([
54916
54918
  // ../../node_modules/@peculiar/asn1-x509/build/es2015/types.js
54917
54919
  init_inject_buffer();
54918
54920
  var Version;
54919
- (function(Version3) {
54920
- Version3[Version3["v1"] = 0] = "v1";
54921
- Version3[Version3["v2"] = 1] = "v2";
54922
- Version3[Version3["v3"] = 2] = "v3";
54921
+ (function(Version4) {
54922
+ Version4[Version4["v1"] = 0] = "v1";
54923
+ Version4[Version4["v2"] = 1] = "v2";
54924
+ Version4[Version4["v3"] = 2] = "v3";
54923
54925
  })(Version || (Version = {}));
54924
54926
 
54925
54927
  // ../../node_modules/@peculiar/asn1-x509/build/es2015/tbs_certificate.js
@@ -56683,6 +56685,8 @@ init_inject_buffer();
56683
56685
  // ../../node_modules/@peculiar/asn1-ecc/build/es2015/rfc3279.js
56684
56686
  init_inject_buffer();
56685
56687
  var FieldID = class FieldID2 {
56688
+ fieldType;
56689
+ parameters;
56686
56690
  constructor(params = {}) {
56687
56691
  Object.assign(this, params);
56688
56692
  }
@@ -56699,6 +56703,9 @@ FieldID = __decorate([
56699
56703
  var ECPoint = class extends OctetString2 {
56700
56704
  };
56701
56705
  var Curve = class Curve2 {
56706
+ a;
56707
+ b;
56708
+ seed;
56702
56709
  constructor(params = {}) {
56703
56710
  Object.assign(this, params);
56704
56711
  }
@@ -56710,7 +56717,10 @@ __decorate([
56710
56717
  AsnProp({ type: AsnPropTypes.OctetString })
56711
56718
  ], Curve.prototype, "b", void 0);
56712
56719
  __decorate([
56713
- AsnProp({ type: AsnPropTypes.BitString, optional: true })
56720
+ AsnProp({
56721
+ type: AsnPropTypes.BitString,
56722
+ optional: true
56723
+ })
56714
56724
  ], Curve.prototype, "seed", void 0);
56715
56725
  Curve = __decorate([
56716
56726
  AsnType({ type: AsnTypeTypes.Sequence })
@@ -56720,8 +56730,13 @@ var ECPVer;
56720
56730
  ECPVer2[ECPVer2["ecpVer1"] = 1] = "ecpVer1";
56721
56731
  })(ECPVer || (ECPVer = {}));
56722
56732
  var SpecifiedECDomain = class SpecifiedECDomain2 {
56733
+ version = ECPVer.ecpVer1;
56734
+ fieldID;
56735
+ curve;
56736
+ base;
56737
+ order;
56738
+ cofactor;
56723
56739
  constructor(params = {}) {
56724
- this.version = ECPVer.ecpVer1;
56725
56740
  Object.assign(this, params);
56726
56741
  }
56727
56742
  };
@@ -56738,10 +56753,16 @@ __decorate([
56738
56753
  AsnProp({ type: ECPoint })
56739
56754
  ], SpecifiedECDomain.prototype, "base", void 0);
56740
56755
  __decorate([
56741
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
56756
+ AsnProp({
56757
+ type: AsnPropTypes.Integer,
56758
+ converter: AsnIntegerArrayBufferConverter
56759
+ })
56742
56760
  ], SpecifiedECDomain.prototype, "order", void 0);
56743
56761
  __decorate([
56744
- AsnProp({ type: AsnPropTypes.Integer, optional: true })
56762
+ AsnProp({
56763
+ type: AsnPropTypes.Integer,
56764
+ optional: true
56765
+ })
56745
56766
  ], SpecifiedECDomain.prototype, "cofactor", void 0);
56746
56767
  SpecifiedECDomain = __decorate([
56747
56768
  AsnType({ type: AsnTypeTypes.Sequence })
@@ -56749,6 +56770,9 @@ SpecifiedECDomain = __decorate([
56749
56770
 
56750
56771
  // ../../node_modules/@peculiar/asn1-ecc/build/es2015/ec_parameters.js
56751
56772
  var ECParameters = class ECParameters2 {
56773
+ namedCurve;
56774
+ implicitCurve;
56775
+ specifiedCurve;
56752
56776
  constructor(params = {}) {
56753
56777
  Object.assign(this, params);
56754
56778
  }
@@ -56769,9 +56793,11 @@ ECParameters = __decorate([
56769
56793
  // ../../node_modules/@peculiar/asn1-ecc/build/es2015/ec_private_key.js
56770
56794
  init_inject_buffer();
56771
56795
  var ECPrivateKey = class {
56796
+ version = 1;
56797
+ privateKey = new OctetString2();
56798
+ parameters;
56799
+ publicKey;
56772
56800
  constructor(params = {}) {
56773
- this.version = 1;
56774
- this.privateKey = new OctetString2();
56775
56801
  Object.assign(this, params);
56776
56802
  }
56777
56803
  };
@@ -56782,26 +56808,40 @@ __decorate([
56782
56808
  AsnProp({ type: OctetString2 })
56783
56809
  ], ECPrivateKey.prototype, "privateKey", void 0);
56784
56810
  __decorate([
56785
- AsnProp({ type: ECParameters, context: 0, optional: true })
56811
+ AsnProp({
56812
+ type: ECParameters,
56813
+ context: 0,
56814
+ optional: true
56815
+ })
56786
56816
  ], ECPrivateKey.prototype, "parameters", void 0);
56787
56817
  __decorate([
56788
- AsnProp({ type: AsnPropTypes.BitString, context: 1, optional: true })
56818
+ AsnProp({
56819
+ type: AsnPropTypes.BitString,
56820
+ context: 1,
56821
+ optional: true
56822
+ })
56789
56823
  ], ECPrivateKey.prototype, "publicKey", void 0);
56790
56824
 
56791
56825
  // ../../node_modules/@peculiar/asn1-ecc/build/es2015/ec_signature_value.js
56792
56826
  init_inject_buffer();
56793
56827
  var ECDSASigValue = class {
56828
+ r = new ArrayBuffer(0);
56829
+ s = new ArrayBuffer(0);
56794
56830
  constructor(params = {}) {
56795
- this.r = new ArrayBuffer(0);
56796
- this.s = new ArrayBuffer(0);
56797
56831
  Object.assign(this, params);
56798
56832
  }
56799
56833
  };
56800
56834
  __decorate([
56801
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
56835
+ AsnProp({
56836
+ type: AsnPropTypes.Integer,
56837
+ converter: AsnIntegerArrayBufferConverter
56838
+ })
56802
56839
  ], ECDSASigValue.prototype, "r", void 0);
56803
56840
  __decorate([
56804
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
56841
+ AsnProp({
56842
+ type: AsnPropTypes.Integer,
56843
+ converter: AsnIntegerArrayBufferConverter
56844
+ })
56805
56845
  ], ECDSASigValue.prototype, "s", void 0);
56806
56846
 
56807
56847
  // ../../node_modules/@peculiar/asn1-rsa/build/es2015/index.js
@@ -58133,8 +58173,8 @@ __decorate([
58133
58173
  init_inject_buffer();
58134
58174
  var Attributes_1;
58135
58175
  var Version2;
58136
- (function(Version3) {
58137
- Version3[Version3["v1"] = 0] = "v1";
58176
+ (function(Version4) {
58177
+ Version4[Version4["v1"] = 0] = "v1";
58138
58178
  })(Version2 || (Version2 = {}));
58139
58179
  var PrivateKey = class extends OctetString2 {
58140
58180
  };
@@ -58555,6 +58595,159 @@ SMIMECapabilities = SMIMECapabilities_1 = __decorate([
58555
58595
  })
58556
58596
  ], SMIMECapabilities);
58557
58597
 
58598
+ // ../../node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/index.js
58599
+ init_inject_buffer();
58600
+
58601
+ // ../../node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_signatures.js
58602
+ init_inject_buffer();
58603
+ var CompositeParams_1;
58604
+ var CompositeSignatureValue_1;
58605
+ var CompositeParams = CompositeParams_1 = class CompositeParams2 extends AsnArray {
58606
+ constructor(items) {
58607
+ super(items);
58608
+ Object.setPrototypeOf(this, CompositeParams_1.prototype);
58609
+ }
58610
+ };
58611
+ CompositeParams = CompositeParams_1 = __decorate([
58612
+ AsnType({
58613
+ type: AsnTypeTypes.Sequence,
58614
+ itemType: AlgorithmIdentifier
58615
+ })
58616
+ ], CompositeParams);
58617
+ var CompositeSignatureValue = CompositeSignatureValue_1 = class CompositeSignatureValue2 extends AsnArray {
58618
+ constructor(items) {
58619
+ super(items);
58620
+ Object.setPrototypeOf(this, CompositeSignatureValue_1.prototype);
58621
+ }
58622
+ };
58623
+ CompositeSignatureValue = CompositeSignatureValue_1 = __decorate([
58624
+ AsnType({
58625
+ type: AsnTypeTypes.Sequence,
58626
+ itemType: AsnPropTypes.BitString
58627
+ })
58628
+ ], CompositeSignatureValue);
58629
+
58630
+ // ../../node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_keys.js
58631
+ init_inject_buffer();
58632
+
58633
+ // ../../node_modules/@peculiar/asn1-asym-key/build/es2015/index.js
58634
+ init_inject_buffer();
58635
+ var AsymmetricKeyPackage_1;
58636
+ var Version3;
58637
+ (function(Version4) {
58638
+ Version4[Version4["v1"] = 0] = "v1";
58639
+ Version4[Version4["v2"] = 1] = "v2";
58640
+ })(Version3 || (Version3 = {}));
58641
+ var PrivateKeyAlgorithmIdentifier = class PrivateKeyAlgorithmIdentifier2 extends AlgorithmIdentifier {
58642
+ };
58643
+ PrivateKeyAlgorithmIdentifier = __decorate([
58644
+ AsnType({ type: AsnTypeTypes.Sequence })
58645
+ ], PrivateKeyAlgorithmIdentifier);
58646
+ var OneAsymmetricKey = class OneAsymmetricKey2 {
58647
+ version = Version3.v1;
58648
+ privateKeyAlgorithm = new AlgorithmIdentifier();
58649
+ privateKey = new ArrayBuffer(0);
58650
+ attributes;
58651
+ publicKey;
58652
+ };
58653
+ __decorate([
58654
+ AsnProp({ type: AsnPropTypes.Integer })
58655
+ ], OneAsymmetricKey.prototype, "version", void 0);
58656
+ __decorate([
58657
+ AsnProp({ type: AlgorithmIdentifier })
58658
+ ], OneAsymmetricKey.prototype, "privateKeyAlgorithm", void 0);
58659
+ __decorate([
58660
+ AsnProp({ type: AsnPropTypes.OctetString })
58661
+ ], OneAsymmetricKey.prototype, "privateKey", void 0);
58662
+ __decorate([
58663
+ AsnProp({
58664
+ type: Attributes,
58665
+ context: 0,
58666
+ implicit: true,
58667
+ optional: true
58668
+ })
58669
+ ], OneAsymmetricKey.prototype, "attributes", void 0);
58670
+ __decorate([
58671
+ AsnProp({
58672
+ type: AsnPropTypes.BitString,
58673
+ context: 1,
58674
+ implicit: true,
58675
+ optional: true
58676
+ })
58677
+ ], OneAsymmetricKey.prototype, "publicKey", void 0);
58678
+ OneAsymmetricKey = __decorate([
58679
+ AsnType({ type: AsnTypeTypes.Sequence })
58680
+ ], OneAsymmetricKey);
58681
+ var PrivateKeyInfo2 = class PrivateKeyInfo3 extends OneAsymmetricKey {
58682
+ };
58683
+ PrivateKeyInfo2 = __decorate([
58684
+ AsnType({ type: AsnTypeTypes.Sequence })
58685
+ ], PrivateKeyInfo2);
58686
+ var AsymmetricKeyPackage = AsymmetricKeyPackage_1 = class AsymmetricKeyPackage2 extends AsnArray {
58687
+ constructor(items) {
58688
+ super(items);
58689
+ Object.setPrototypeOf(this, AsymmetricKeyPackage_1.prototype);
58690
+ }
58691
+ };
58692
+ AsymmetricKeyPackage = AsymmetricKeyPackage_1 = __decorate([
58693
+ AsnType({
58694
+ type: AsnTypeTypes.Sequence,
58695
+ itemType: OneAsymmetricKey
58696
+ })
58697
+ ], AsymmetricKeyPackage);
58698
+
58699
+ // ../../node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_keys.js
58700
+ var CompositePublicKey_1;
58701
+ var CompositePrivateKey_1;
58702
+ var CompositeAlgorithmIdentifier = class CompositeAlgorithmIdentifier2 extends AlgorithmIdentifier {
58703
+ };
58704
+ CompositeAlgorithmIdentifier = __decorate([
58705
+ AsnType({ type: AsnTypeTypes.Sequence })
58706
+ ], CompositeAlgorithmIdentifier);
58707
+ var CompositePublicKey = CompositePublicKey_1 = class CompositePublicKey2 extends AsnArray {
58708
+ constructor(items) {
58709
+ super(items);
58710
+ Object.setPrototypeOf(this, CompositePublicKey_1.prototype);
58711
+ }
58712
+ };
58713
+ CompositePublicKey = CompositePublicKey_1 = __decorate([
58714
+ AsnType({
58715
+ type: AsnTypeTypes.Sequence,
58716
+ itemType: SubjectPublicKeyInfo
58717
+ })
58718
+ ], CompositePublicKey);
58719
+ var CompositePrivateKey = CompositePrivateKey_1 = class CompositePrivateKey2 extends AsnArray {
58720
+ constructor(items) {
58721
+ super(items);
58722
+ Object.setPrototypeOf(this, CompositePrivateKey_1.prototype);
58723
+ }
58724
+ };
58725
+ CompositePrivateKey = CompositePrivateKey_1 = __decorate([
58726
+ AsnType({
58727
+ type: AsnTypeTypes.Sequence,
58728
+ itemType: OneAsymmetricKey
58729
+ })
58730
+ ], CompositePrivateKey);
58731
+
58732
+ // ../../node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/object_identifiers.js
58733
+ init_inject_buffer();
58734
+ var id_sigAlgs = "2.16.840.1.101.3.4.3";
58735
+ var id_ml_dsa_44 = `${id_sigAlgs}.17`;
58736
+ var id_ml_dsa_65 = `${id_sigAlgs}.18`;
58737
+ var id_ml_dsa_87 = `${id_sigAlgs}.19`;
58738
+ var id_slh_dsa_sha2_128s = `${id_sigAlgs}.20`;
58739
+ var id_slh_dsa_sha2_128f = `${id_sigAlgs}.21`;
58740
+ var id_slh_dsa_sha2_192s = `${id_sigAlgs}.22`;
58741
+ var id_slh_dsa_sha2_192f = `${id_sigAlgs}.23`;
58742
+ var id_slh_dsa_sha2_256s = `${id_sigAlgs}.24`;
58743
+ var id_slh_dsa_sha2_256f = `${id_sigAlgs}.25`;
58744
+ var id_slh_dsa_shake_128s = `${id_sigAlgs}.26`;
58745
+ var id_slh_dsa_shake_128f = `${id_sigAlgs}.27`;
58746
+ var id_slh_dsa_shake_192s = `${id_sigAlgs}.28`;
58747
+ var id_slh_dsa_shake_192f = `${id_sigAlgs}.29`;
58748
+ var id_slh_dsa_shake_256s = `${id_sigAlgs}.30`;
58749
+ var id_slh_dsa_shake_256f = `${id_sigAlgs}.31`;
58750
+
58558
58751
  // ../../node_modules/@peculiar/asn1-csr/build/es2015/index.js
58559
58752
  init_inject_buffer();
58560
58753
 
@@ -58568,7 +58761,10 @@ var Attributes3 = Attributes_12 = class Attributes4 extends AsnArray {
58568
58761
  }
58569
58762
  };
58570
58763
  Attributes3 = Attributes_12 = __decorate([
58571
- AsnType({ type: AsnTypeTypes.Sequence, itemType: Attribute })
58764
+ AsnType({
58765
+ type: AsnTypeTypes.Sequence,
58766
+ itemType: Attribute
58767
+ })
58572
58768
  ], Attributes3);
58573
58769
 
58574
58770
  // ../../node_modules/@peculiar/asn1-csr/build/es2015/certification_request.js
@@ -58577,11 +58773,11 @@ init_inject_buffer();
58577
58773
  // ../../node_modules/@peculiar/asn1-csr/build/es2015/certification_request_info.js
58578
58774
  init_inject_buffer();
58579
58775
  var CertificationRequestInfo = class {
58776
+ version = 0;
58777
+ subject = new Name();
58778
+ subjectPKInfo = new SubjectPublicKeyInfo();
58779
+ attributes = new Attributes3();
58580
58780
  constructor(params = {}) {
58581
- this.version = 0;
58582
- this.subject = new Name();
58583
- this.subjectPKInfo = new SubjectPublicKeyInfo();
58584
- this.attributes = new Attributes3();
58585
58781
  Object.assign(this, params);
58586
58782
  }
58587
58783
  };
@@ -58595,20 +58791,29 @@ __decorate([
58595
58791
  AsnProp({ type: SubjectPublicKeyInfo })
58596
58792
  ], CertificationRequestInfo.prototype, "subjectPKInfo", void 0);
58597
58793
  __decorate([
58598
- AsnProp({ type: Attributes3, implicit: true, context: 0, optional: true })
58794
+ AsnProp({
58795
+ type: Attributes3,
58796
+ implicit: true,
58797
+ context: 0,
58798
+ optional: true
58799
+ })
58599
58800
  ], CertificationRequestInfo.prototype, "attributes", void 0);
58600
58801
 
58601
58802
  // ../../node_modules/@peculiar/asn1-csr/build/es2015/certification_request.js
58602
58803
  var CertificationRequest = class {
58804
+ certificationRequestInfo = new CertificationRequestInfo();
58805
+ certificationRequestInfoRaw;
58806
+ signatureAlgorithm = new AlgorithmIdentifier();
58807
+ signature = new ArrayBuffer(0);
58603
58808
  constructor(params = {}) {
58604
- this.certificationRequestInfo = new CertificationRequestInfo();
58605
- this.signatureAlgorithm = new AlgorithmIdentifier();
58606
- this.signature = new ArrayBuffer(0);
58607
58809
  Object.assign(this, params);
58608
58810
  }
58609
58811
  };
58610
58812
  __decorate([
58611
- AsnProp({ type: CertificationRequestInfo, raw: true })
58813
+ AsnProp({
58814
+ type: CertificationRequestInfo,
58815
+ raw: true
58816
+ })
58612
58817
  ], CertificationRequest.prototype, "certificationRequestInfo", void 0);
58613
58818
  __decorate([
58614
58819
  AsnProp({ type: AlgorithmIdentifier })
@@ -59049,7 +59254,11 @@ var TextConverter = class {
59049
59254
  TextConverter.oidSerializer = OidSerializer;
59050
59255
  TextConverter.algorithmSerializer = DefaultAlgorithmSerializer;
59051
59256
  var _AsnData_rawData;
59257
+ var _AsnData_options;
59052
59258
  var AsnData = class _AsnData {
59259
+ get parseOptions() {
59260
+ return __classPrivateFieldGet(this, _AsnData_options, "f");
59261
+ }
59053
59262
  get rawData() {
59054
59263
  if (!__classPrivateFieldGet(this, _AsnData_rawData, "f")) {
59055
59264
  __classPrivateFieldSet(this, _AsnData_rawData, AsnConvert.serialize(this.asn), "f");
@@ -59058,11 +59267,14 @@ var AsnData = class _AsnData {
59058
59267
  }
59059
59268
  constructor(...args) {
59060
59269
  _AsnData_rawData.set(this, void 0);
59270
+ _AsnData_options.set(this, void 0);
59061
59271
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
59062
- this.asn = AsnConvert.parse(args[0], args[1]);
59272
+ __classPrivateFieldSet(this, _AsnData_options, args[2], "f");
59273
+ this.asn = AsnConvert.parse(args[0], args[1], args[2]);
59063
59274
  __classPrivateFieldSet(this, _AsnData_rawData, import_pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]), "f");
59064
59275
  this.onInit(this.asn);
59065
59276
  } else {
59277
+ __classPrivateFieldSet(this, _AsnData_options, args[1], "f");
59066
59278
  this.asn = args[0];
59067
59279
  this.onInit(this.asn);
59068
59280
  }
@@ -59076,7 +59288,7 @@ var AsnData = class _AsnData {
59076
59288
  toString(format4 = "text") {
59077
59289
  switch (format4) {
59078
59290
  case "asn":
59079
- return AsnConvert.toString(this.rawData);
59291
+ return AsnConvert.toString(this.rawData, __classPrivateFieldGet(this, _AsnData_options, "f"));
59080
59292
  case "text":
59081
59293
  return TextConverter.serialize(this.toTextObject());
59082
59294
  case "hex":
@@ -59102,13 +59314,15 @@ var AsnData = class _AsnData {
59102
59314
  return new TextObject(this.getTextName(), {}, value);
59103
59315
  }
59104
59316
  };
59105
- _AsnData_rawData = /* @__PURE__ */ new WeakMap();
59317
+ _AsnData_rawData = /* @__PURE__ */ new WeakMap(), _AsnData_options = /* @__PURE__ */ new WeakMap();
59106
59318
  AsnData.NAME = "ASN";
59107
59319
  var Extension2 = class _Extension extends AsnData {
59108
59320
  constructor(...args) {
59109
59321
  let raw;
59322
+ let options;
59110
59323
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
59111
59324
  raw = import_pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]);
59325
+ options = args[1];
59112
59326
  } else {
59113
59327
  raw = AsnConvert.serialize(new Extension({
59114
59328
  extnID: args[0],
@@ -59116,7 +59330,7 @@ var Extension2 = class _Extension extends AsnData {
59116
59330
  extnValue: new OctetString2(import_pvtsutils.BufferSourceConverter.toArrayBuffer(args[2]))
59117
59331
  }));
59118
59332
  }
59119
- super(raw, Extension);
59333
+ super(raw, Extension, options);
59120
59334
  }
59121
59335
  onInit(asn) {
59122
59336
  this.type = asn.extnID;
@@ -59406,7 +59620,7 @@ var Name3 = class _Name {
59406
59620
  if (quotedMatches) {
59407
59621
  value = quotedMatches[1];
59408
59622
  }
59409
- return value.replace(/\\0a/ig, "\n").replace(/\\0d/ig, "\r").replace(/\\0g/ig, " ").replace(/\\(.)/g, "$1");
59623
+ return value.replace(/\\0a/gi, "\n").replace(/\\0d/gi, "\r").replace(/\\0g/gi, " ").replace(/\\(.)/g, "$1");
59410
59624
  }
59411
59625
  toArrayBuffer() {
59412
59626
  return AsnConvert.serialize(this.asn);
@@ -59793,9 +60007,9 @@ var PemData = class _PemData extends AsnData {
59793
60007
  }
59794
60008
  constructor(...args) {
59795
60009
  if (_PemData.isAsnEncoded(args[0])) {
59796
- super(_PemData.toArrayBuffer(args[0]), args[1]);
60010
+ super(_PemData.toArrayBuffer(args[0]), args[1], args[2]);
59797
60011
  } else {
59798
- super(args[0]);
60012
+ super(args[0], args[1]);
59799
60013
  }
59800
60014
  }
59801
60015
  toString(format4 = "pem") {
@@ -59825,11 +60039,11 @@ var PublicKey = class _PublicKey extends PemData {
59825
60039
  throw new TypeError("Unsupported PublicKeyType");
59826
60040
  }
59827
60041
  }
59828
- constructor(param) {
60042
+ constructor(param, options) {
59829
60043
  if (PemData.isAsnEncoded(param)) {
59830
- super(param, SubjectPublicKeyInfo);
60044
+ super(param, SubjectPublicKeyInfo, options);
59831
60045
  } else {
59832
- super(param);
60046
+ super(param, options);
59833
60047
  }
59834
60048
  this.tag = PemConverter.PublicKeyTag;
59835
60049
  }
@@ -59849,7 +60063,7 @@ var PublicKey = class _PublicKey extends PemData {
59849
60063
  }
59850
60064
  crypto4 !== null && crypto4 !== void 0 ? crypto4 : crypto4 = cryptoProvider.get();
59851
60065
  let raw = this.rawData;
59852
- const asnSpki = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo);
60066
+ const asnSpki = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo, this.parseOptions);
59853
60067
  if (asnSpki.algorithm.algorithm === id_RSASSA_PSS) {
59854
60068
  raw = convertSpkiToRsaPkcs1(asnSpki, raw);
59855
60069
  }
@@ -59860,7 +60074,7 @@ var PublicKey = class _PublicKey extends PemData {
59860
60074
  const algorithm = this.algorithm = algProv.toWebAlgorithm(asn.algorithm);
59861
60075
  switch (asn.algorithm.algorithm) {
59862
60076
  case id_rsaEncryption: {
59863
- const rsaPublicKey = AsnConvert.parse(asn.subjectPublicKey, RSAPublicKey);
60077
+ const rsaPublicKey = AsnConvert.parse(asn.subjectPublicKey, RSAPublicKey, this.parseOptions);
59864
60078
  const modulus = import_pvtsutils.BufferSourceConverter.toUint8Array(rsaPublicKey.modulus);
59865
60079
  algorithm.publicExponent = import_pvtsutils.BufferSourceConverter.toUint8Array(rsaPublicKey.publicExponent);
59866
60080
  algorithm.modulusLength = (!modulus[0] ? modulus.slice(1) : modulus).byteLength << 3;
@@ -59894,12 +60108,12 @@ var PublicKey = class _PublicKey extends PemData {
59894
60108
  }
59895
60109
  }
59896
60110
  crypto4 !== null && crypto4 !== void 0 ? crypto4 : crypto4 = cryptoProvider.get();
59897
- const asn = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo);
60111
+ const asn = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo, this.parseOptions);
59898
60112
  return await crypto4.subtle.digest(algorithm, asn.subjectPublicKey);
59899
60113
  }
59900
60114
  toTextObject() {
59901
60115
  const obj = this.toTextObjectEmpty();
59902
- const asn = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo);
60116
+ const asn = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo, this.parseOptions);
59903
60117
  obj["Algorithm"] = TextConverter.serializeAlgorithm(asn.algorithm);
59904
60118
  switch (asn.algorithm.algorithm) {
59905
60119
  case id_ecPublicKey:
@@ -59931,9 +60145,11 @@ var AuthorityKeyIdentifierExtension = class _AuthorityKeyIdentifierExtension ext
59931
60145
  }
59932
60146
  constructor(...args) {
59933
60147
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
59934
- super(args[0]);
60148
+ super(args[0], args[1]);
59935
60149
  } else if (typeof args[0] === "string") {
59936
- const value = new AuthorityKeyIdentifier({ keyIdentifier: new KeyIdentifier(import_pvtsutils.Convert.FromHex(args[0])) });
60150
+ const value = new AuthorityKeyIdentifier({
60151
+ keyIdentifier: new KeyIdentifier(import_pvtsutils.Convert.FromHex(args[0]))
60152
+ });
59937
60153
  super(id_ce_authorityKeyIdentifier, args[1], AsnConvert.serialize(value));
59938
60154
  } else {
59939
60155
  const certId = args[0];
@@ -59947,7 +60163,7 @@ var AuthorityKeyIdentifierExtension = class _AuthorityKeyIdentifierExtension ext
59947
60163
  }
59948
60164
  onInit(asn) {
59949
60165
  super.onInit(asn);
59950
- const aki = AsnConvert.parse(asn.extnValue, AuthorityKeyIdentifier);
60166
+ const aki = AsnConvert.parse(asn.extnValue, AuthorityKeyIdentifier, this.parseOptions);
59951
60167
  if (aki.keyIdentifier) {
59952
60168
  this.keyId = import_pvtsutils.Convert.ToHex(aki.keyIdentifier);
59953
60169
  }
@@ -59960,7 +60176,7 @@ var AuthorityKeyIdentifierExtension = class _AuthorityKeyIdentifierExtension ext
59960
60176
  }
59961
60177
  toTextObject() {
59962
60178
  const obj = this.toTextObjectWithoutValue();
59963
- const asn = AsnConvert.parse(this.value, AuthorityKeyIdentifier);
60179
+ const asn = AsnConvert.parse(this.value, AuthorityKeyIdentifier, this.parseOptions);
59964
60180
  if (asn.authorityCertIssuer) {
59965
60181
  obj["Authority Issuer"] = new GeneralNames3(asn.authorityCertIssuer).toTextObject();
59966
60182
  }
@@ -59977,8 +60193,8 @@ AuthorityKeyIdentifierExtension.NAME = "Authority Key Identifier";
59977
60193
  var BasicConstraintsExtension = class extends Extension2 {
59978
60194
  constructor(...args) {
59979
60195
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
59980
- super(args[0]);
59981
- const value = AsnConvert.parse(this.value, BasicConstraints);
60196
+ super(args[0], args[1]);
60197
+ const value = AsnConvert.parse(this.value, BasicConstraints, this.parseOptions);
59982
60198
  this.ca = value.cA;
59983
60199
  this.pathLength = value.pathLenConstraint;
59984
60200
  } else {
@@ -60015,8 +60231,8 @@ var ExtendedKeyUsage3;
60015
60231
  var ExtendedKeyUsageExtension = class extends Extension2 {
60016
60232
  constructor(...args) {
60017
60233
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60018
- super(args[0]);
60019
- const value = AsnConvert.parse(this.value, ExtendedKeyUsage);
60234
+ super(args[0], args[1]);
60235
+ const value = AsnConvert.parse(this.value, ExtendedKeyUsage, this.parseOptions);
60020
60236
  this.usages = value.map((o) => o);
60021
60237
  } else {
60022
60238
  const value = new ExtendedKeyUsage(args[0]);
@@ -60046,8 +60262,8 @@ var KeyUsageFlags2;
60046
60262
  var KeyUsagesExtension = class extends Extension2 {
60047
60263
  constructor(...args) {
60048
60264
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60049
- super(args[0]);
60050
- const value = AsnConvert.parse(this.value, KeyUsage);
60265
+ super(args[0], args[1]);
60266
+ const value = AsnConvert.parse(this.value, KeyUsage, this.parseOptions);
60051
60267
  this.usages = value.toNumber();
60052
60268
  } else {
60053
60269
  const value = new KeyUsage(args[0]);
@@ -60057,7 +60273,7 @@ var KeyUsagesExtension = class extends Extension2 {
60057
60273
  }
60058
60274
  toTextObject() {
60059
60275
  const obj = this.toTextObjectWithoutValue();
60060
- const asn = AsnConvert.parse(this.value, KeyUsage);
60276
+ const asn = AsnConvert.parse(this.value, KeyUsage, this.parseOptions);
60061
60277
  obj[""] = asn.toJSON().join(", ");
60062
60278
  return obj;
60063
60279
  }
@@ -60071,8 +60287,8 @@ var SubjectKeyIdentifierExtension = class _SubjectKeyIdentifierExtension extends
60071
60287
  }
60072
60288
  constructor(...args) {
60073
60289
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60074
- super(args[0]);
60075
- const value = AsnConvert.parse(this.value, SubjectKeyIdentifier);
60290
+ super(args[0], args[1]);
60291
+ const value = AsnConvert.parse(this.value, SubjectKeyIdentifier, this.parseOptions);
60076
60292
  this.keyId = import_pvtsutils.Convert.ToHex(value);
60077
60293
  } else {
60078
60294
  const identifier = typeof args[0] === "string" ? import_pvtsutils.Convert.FromHex(args[0]) : args[0];
@@ -60083,7 +60299,7 @@ var SubjectKeyIdentifierExtension = class _SubjectKeyIdentifierExtension extends
60083
60299
  }
60084
60300
  toTextObject() {
60085
60301
  const obj = this.toTextObjectWithoutValue();
60086
- const asn = AsnConvert.parse(this.value, SubjectKeyIdentifier);
60302
+ const asn = AsnConvert.parse(this.value, SubjectKeyIdentifier, this.parseOptions);
60087
60303
  obj[""] = asn;
60088
60304
  return obj;
60089
60305
  }
@@ -60092,14 +60308,14 @@ SubjectKeyIdentifierExtension.NAME = "Subject Key Identifier";
60092
60308
  var SubjectAlternativeNameExtension = class extends Extension2 {
60093
60309
  constructor(...args) {
60094
60310
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60095
- super(args[0]);
60311
+ super(args[0], args[1]);
60096
60312
  } else {
60097
60313
  super(id_ce_subjectAltName, args[1], new GeneralNames3(args[0] || []).rawData);
60098
60314
  }
60099
60315
  }
60100
60316
  onInit(asn) {
60101
60317
  super.onInit(asn);
60102
- const value = AsnConvert.parse(asn.extnValue, SubjectAlternativeName);
60318
+ const value = AsnConvert.parse(asn.extnValue, SubjectAlternativeName, this.parseOptions);
60103
60319
  this.names = new GeneralNames3(value);
60104
60320
  }
60105
60321
  toTextObject() {
@@ -60116,11 +60332,11 @@ var ExtensionFactory = class {
60116
60332
  static register(id, type) {
60117
60333
  this.items.set(id, type);
60118
60334
  }
60119
- static create(data) {
60120
- const extension = new Extension2(data);
60335
+ static create(data, options) {
60336
+ const extension = new Extension2(data, options);
60121
60337
  const Type = this.items.get(extension.type);
60122
60338
  if (Type) {
60123
- return new Type(data);
60339
+ return new Type(data, options);
60124
60340
  }
60125
60341
  return extension;
60126
60342
  }
@@ -60130,8 +60346,8 @@ var CertificatePolicyExtension = class extends Extension2 {
60130
60346
  constructor(...args) {
60131
60347
  var _a3;
60132
60348
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60133
- super(args[0]);
60134
- const asnPolicies = AsnConvert.parse(this.value, CertificatePolicies);
60349
+ super(args[0], args[1]);
60350
+ const asnPolicies = AsnConvert.parse(this.value, CertificatePolicies, this.parseOptions);
60135
60351
  this.policies = asnPolicies.map((o) => o.policyIdentifier);
60136
60352
  } else {
60137
60353
  const policies = args[0];
@@ -60153,12 +60369,14 @@ var CRLDistributionPointsExtension = class extends Extension2 {
60153
60369
  constructor(...args) {
60154
60370
  var _a3;
60155
60371
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60156
- super(args[0]);
60372
+ super(args[0], args[1]);
60157
60373
  } else if (Array.isArray(args[0]) && typeof args[0][0] === "string") {
60158
60374
  const urls = args[0];
60159
60375
  const dps = urls.map((url) => {
60160
60376
  return new DistributionPoint({
60161
- distributionPoint: new DistributionPointName({ fullName: [new GeneralName({ uniformResourceIdentifier: url })] })
60377
+ distributionPoint: new DistributionPointName({
60378
+ fullName: [new GeneralName({ uniformResourceIdentifier: url })]
60379
+ })
60162
60380
  });
60163
60381
  });
60164
60382
  const value = new CRLDistributionPoints(dps);
@@ -60171,7 +60389,7 @@ var CRLDistributionPointsExtension = class extends Extension2 {
60171
60389
  }
60172
60390
  onInit(asn) {
60173
60391
  super.onInit(asn);
60174
- const crlExt = AsnConvert.parse(asn.extnValue, CRLDistributionPoints);
60392
+ const crlExt = AsnConvert.parse(asn.extnValue, CRLDistributionPoints, this.parseOptions);
60175
60393
  this.distributionPoints = crlExt;
60176
60394
  }
60177
60395
  toTextObject() {
@@ -60198,7 +60416,7 @@ var AuthorityInfoAccessExtension = class extends Extension2 {
60198
60416
  constructor(...args) {
60199
60417
  var _a3, _b, _c, _d;
60200
60418
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60201
- super(args[0]);
60419
+ super(args[0], args[1]);
60202
60420
  } else if (args[0] instanceof AuthorityInfoAccessSyntax) {
60203
60421
  const value = new AuthorityInfoAccessSyntax(args[0]);
60204
60422
  super(id_pe_authorityInfoAccess, args[1], AsnConvert.serialize(value));
@@ -60222,7 +60440,7 @@ var AuthorityInfoAccessExtension = class extends Extension2 {
60222
60440
  this.caIssuers = [];
60223
60441
  this.timeStamping = [];
60224
60442
  this.caRepository = [];
60225
- const aia = AsnConvert.parse(asn.extnValue, AuthorityInfoAccessSyntax);
60443
+ const aia = AsnConvert.parse(asn.extnValue, AuthorityInfoAccessSyntax, this.parseOptions);
60226
60444
  aia.forEach((accessDescription) => {
60227
60445
  switch (accessDescription.accessMethod) {
60228
60446
  case id_ad_ocsp:
@@ -60294,14 +60512,14 @@ function addAccessDescriptions(value, params, method, key) {
60294
60512
  var IssuerAlternativeNameExtension = class extends Extension2 {
60295
60513
  constructor(...args) {
60296
60514
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60297
- super(args[0]);
60515
+ super(args[0], args[1]);
60298
60516
  } else {
60299
60517
  super(id_ce_issuerAltName, args[1], new GeneralNames3(args[0] || []).rawData);
60300
60518
  }
60301
60519
  }
60302
60520
  onInit(asn) {
60303
60521
  super.onInit(asn);
60304
- const value = AsnConvert.parse(asn.extnValue, GeneralNames);
60522
+ const value = AsnConvert.parse(asn.extnValue, GeneralNames, this.parseOptions);
60305
60523
  this.names = new GeneralNames3(value);
60306
60524
  }
60307
60525
  toTextObject() {
@@ -60317,8 +60535,10 @@ IssuerAlternativeNameExtension.NAME = "Issuer Alternative Name";
60317
60535
  var Attribute3 = class _Attribute extends AsnData {
60318
60536
  constructor(...args) {
60319
60537
  let raw;
60538
+ let options;
60320
60539
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60321
60540
  raw = import_pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]);
60541
+ options = args[1];
60322
60542
  } else {
60323
60543
  const type = args[0];
60324
60544
  const values = Array.isArray(args[1]) ? args[1].map((o) => import_pvtsutils.BufferSourceConverter.toArrayBuffer(o)) : [];
@@ -60327,7 +60547,7 @@ var Attribute3 = class _Attribute extends AsnData {
60327
60547
  values
60328
60548
  }));
60329
60549
  }
60330
- super(raw, Attribute);
60550
+ super(raw, Attribute, options);
60331
60551
  }
60332
60552
  onInit(asn) {
60333
60553
  this.type = asn.type;
@@ -60351,7 +60571,7 @@ var ChallengePasswordAttribute = class extends Attribute3 {
60351
60571
  constructor(...args) {
60352
60572
  var _a3;
60353
60573
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60354
- super(args[0]);
60574
+ super(args[0], args[1]);
60355
60575
  } else {
60356
60576
  const value = new ChallengePassword({ printableString: args[0] });
60357
60577
  super(id_pkcs9_at_challengePassword, [AsnConvert.serialize(value)]);
@@ -60361,7 +60581,7 @@ var ChallengePasswordAttribute = class extends Attribute3 {
60361
60581
  onInit(asn) {
60362
60582
  super.onInit(asn);
60363
60583
  if (this.values[0]) {
60364
- const value = AsnConvert.parse(this.values[0], ChallengePassword);
60584
+ const value = AsnConvert.parse(this.values[0], ChallengePassword, this.parseOptions);
60365
60585
  this.password = value.toString();
60366
60586
  }
60367
60587
  }
@@ -60376,7 +60596,7 @@ var ExtensionsAttribute = class extends Attribute3 {
60376
60596
  constructor(...args) {
60377
60597
  var _a3;
60378
60598
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
60379
- super(args[0]);
60599
+ super(args[0], args[1]);
60380
60600
  } else {
60381
60601
  const extensions = args[0];
60382
60602
  const value = new Extensions();
@@ -60390,8 +60610,8 @@ var ExtensionsAttribute = class extends Attribute3 {
60390
60610
  onInit(asn) {
60391
60611
  super.onInit(asn);
60392
60612
  if (this.values[0]) {
60393
- const value = AsnConvert.parse(this.values[0], Extensions);
60394
- this.items = value.map((o) => ExtensionFactory.create(AsnConvert.serialize(o)));
60613
+ const value = AsnConvert.parse(this.values[0], Extensions, this.parseOptions);
60614
+ this.items = value.map((o) => ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions));
60395
60615
  }
60396
60616
  }
60397
60617
  toTextObject() {
@@ -60408,11 +60628,11 @@ var AttributeFactory = class {
60408
60628
  static register(id, type) {
60409
60629
  this.items.set(id, type);
60410
60630
  }
60411
- static create(data) {
60412
- const attribute = new Attribute3(data);
60631
+ static create(data, options) {
60632
+ const attribute = new Attribute3(data, options);
60413
60633
  const Type = this.items.get(attribute.type);
60414
60634
  if (Type) {
60415
- return new Type(data);
60635
+ return new Type(data, options);
60416
60636
  }
60417
60637
  return attribute;
60418
60638
  }
@@ -60705,6 +60925,121 @@ EdAlgorithm = __decorate([
60705
60925
  injectable_default()
60706
60926
  ], EdAlgorithm);
60707
60927
  instance.registerSingleton(diAlgorithm, EdAlgorithm);
60928
+ var MlDsaAlgorithm = class MlDsaAlgorithm2 {
60929
+ toAsnAlgorithm(alg) {
60930
+ let algorithm = null;
60931
+ switch (alg.name.toLowerCase()) {
60932
+ case "ml-dsa-44":
60933
+ algorithm = id_ml_dsa_44;
60934
+ break;
60935
+ case "ml-dsa-65":
60936
+ algorithm = id_ml_dsa_65;
60937
+ break;
60938
+ case "ml-dsa-87":
60939
+ algorithm = id_ml_dsa_87;
60940
+ break;
60941
+ }
60942
+ if (algorithm) {
60943
+ return new AlgorithmIdentifier({ algorithm });
60944
+ }
60945
+ return null;
60946
+ }
60947
+ toWebAlgorithm(alg) {
60948
+ switch (alg.algorithm) {
60949
+ case id_ml_dsa_44:
60950
+ return { name: "ML-DSA-44" };
60951
+ case id_ml_dsa_65:
60952
+ return { name: "ML-DSA-65" };
60953
+ case id_ml_dsa_87:
60954
+ return { name: "ML-DSA-87" };
60955
+ }
60956
+ return null;
60957
+ }
60958
+ };
60959
+ MlDsaAlgorithm = __decorate([
60960
+ injectable_default()
60961
+ ], MlDsaAlgorithm);
60962
+ instance.registerSingleton(diAlgorithm, MlDsaAlgorithm);
60963
+ var SlhDsaAlgorithm = class SlhDsaAlgorithm2 {
60964
+ toAsnAlgorithm(alg) {
60965
+ let algorithm = null;
60966
+ switch (alg.name.toLowerCase()) {
60967
+ case "slh-dsa-sha2-128s":
60968
+ algorithm = id_slh_dsa_sha2_128s;
60969
+ break;
60970
+ case "slh-dsa-sha2-128f":
60971
+ algorithm = id_slh_dsa_sha2_128f;
60972
+ break;
60973
+ case "slh-dsa-sha2-192s":
60974
+ algorithm = id_slh_dsa_sha2_192s;
60975
+ break;
60976
+ case "slh-dsa-sha2-192f":
60977
+ algorithm = id_slh_dsa_sha2_192f;
60978
+ break;
60979
+ case "slh-dsa-sha2-256s":
60980
+ algorithm = id_slh_dsa_sha2_256s;
60981
+ break;
60982
+ case "slh-dsa-sha2-256f":
60983
+ algorithm = id_slh_dsa_sha2_256f;
60984
+ break;
60985
+ case "slh-dsa-shake-128s":
60986
+ algorithm = id_slh_dsa_shake_128s;
60987
+ break;
60988
+ case "slh-dsa-shake-128f":
60989
+ algorithm = id_slh_dsa_shake_128f;
60990
+ break;
60991
+ case "slh-dsa-shake-192s":
60992
+ algorithm = id_slh_dsa_shake_192s;
60993
+ break;
60994
+ case "slh-dsa-shake-192f":
60995
+ algorithm = id_slh_dsa_shake_192f;
60996
+ break;
60997
+ case "slh-dsa-shake-256s":
60998
+ algorithm = id_slh_dsa_shake_256s;
60999
+ break;
61000
+ case "slh-dsa-shake-256f":
61001
+ algorithm = id_slh_dsa_shake_256f;
61002
+ break;
61003
+ }
61004
+ if (algorithm) {
61005
+ return new AlgorithmIdentifier({ algorithm });
61006
+ }
61007
+ return null;
61008
+ }
61009
+ toWebAlgorithm(alg) {
61010
+ switch (alg.algorithm) {
61011
+ case id_slh_dsa_sha2_128s:
61012
+ return { name: "SLH-DSA-SHA2-128s" };
61013
+ case id_slh_dsa_sha2_128f:
61014
+ return { name: "SLH-DSA-SHA2-128f" };
61015
+ case id_slh_dsa_sha2_192s:
61016
+ return { name: "SLH-DSA-SHA2-192s" };
61017
+ case id_slh_dsa_sha2_192f:
61018
+ return { name: "SLH-DSA-SHA2-192f" };
61019
+ case id_slh_dsa_sha2_256s:
61020
+ return { name: "SLH-DSA-SHA2-256s" };
61021
+ case id_slh_dsa_sha2_256f:
61022
+ return { name: "SLH-DSA-SHA2-256f" };
61023
+ case id_slh_dsa_shake_128s:
61024
+ return { name: "SLH-DSA-SHAKE-128s" };
61025
+ case id_slh_dsa_shake_128f:
61026
+ return { name: "SLH-DSA-SHAKE-128f" };
61027
+ case id_slh_dsa_shake_192s:
61028
+ return { name: "SLH-DSA-SHAKE-192s" };
61029
+ case id_slh_dsa_shake_192f:
61030
+ return { name: "SLH-DSA-SHAKE-192f" };
61031
+ case id_slh_dsa_shake_256s:
61032
+ return { name: "SLH-DSA-SHAKE-256s" };
61033
+ case id_slh_dsa_shake_256f:
61034
+ return { name: "SLH-DSA-SHAKE-256f" };
61035
+ }
61036
+ return null;
61037
+ }
61038
+ };
61039
+ SlhDsaAlgorithm = __decorate([
61040
+ injectable_default()
61041
+ ], SlhDsaAlgorithm);
61042
+ instance.registerSingleton(diAlgorithm, SlhDsaAlgorithm);
60708
61043
  var _Pkcs10CertificateRequest_tbs;
60709
61044
  var _Pkcs10CertificateRequest_subjectName;
60710
61045
  var _Pkcs10CertificateRequest_subject;
@@ -60741,13 +61076,13 @@ var Pkcs10CertificateRequest = class extends PemData {
60741
61076
  }
60742
61077
  get publicKey() {
60743
61078
  if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_publicKey, "f")) {
60744
- __classPrivateFieldSet(this, _Pkcs10CertificateRequest_publicKey, new PublicKey(this.asn.certificationRequestInfo.subjectPKInfo), "f");
61079
+ __classPrivateFieldSet(this, _Pkcs10CertificateRequest_publicKey, new PublicKey(this.asn.certificationRequestInfo.subjectPKInfo, this.parseOptions), "f");
60745
61080
  }
60746
61081
  return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_publicKey, "f");
60747
61082
  }
60748
61083
  get attributes() {
60749
61084
  if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_attributes, "f")) {
60750
- __classPrivateFieldSet(this, _Pkcs10CertificateRequest_attributes, this.asn.certificationRequestInfo.attributes.map((o) => AttributeFactory.create(AsnConvert.serialize(o))), "f");
61085
+ __classPrivateFieldSet(this, _Pkcs10CertificateRequest_attributes, this.asn.certificationRequestInfo.attributes.map((o) => AttributeFactory.create(AsnConvert.serialize(o), this.parseOptions)), "f");
60751
61086
  }
60752
61087
  return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_attributes, "f");
60753
61088
  }
@@ -60767,9 +61102,9 @@ var Pkcs10CertificateRequest = class extends PemData {
60767
61102
  }
60768
61103
  return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_tbs, "f");
60769
61104
  }
60770
- constructor(param) {
60771
- const args = PemData.isAsnEncoded(param) ? [param, CertificationRequest] : [param];
60772
- super(args[0], args[1]);
61105
+ constructor(param, options) {
61106
+ const args = PemData.isAsnEncoded(param) ? [param, CertificationRequest, options] : [param, options];
61107
+ super(args[0], args[1], args[2]);
60773
61108
  _Pkcs10CertificateRequest_tbs.set(this, void 0);
60774
61109
  _Pkcs10CertificateRequest_subjectName.set(this, void 0);
60775
61110
  _Pkcs10CertificateRequest_subject.set(this, void 0);
@@ -60826,7 +61161,7 @@ var Pkcs10CertificateRequest = class extends PemData {
60826
61161
  }
60827
61162
  toTextObject() {
60828
61163
  const obj = this.toTextObjectEmpty();
60829
- const req = AsnConvert.parse(this.rawData, CertificationRequest);
61164
+ const req = AsnConvert.parse(this.rawData, CertificationRequest, this.parseOptions);
60830
61165
  const tbs = req.certificationRequestInfo;
60831
61166
  const data = new TextObject("", {
60832
61167
  Version: `${Version[tbs.version]} (${tbs.version})`,
@@ -60861,7 +61196,9 @@ var Pkcs10CertificateRequestGenerator = class {
60861
61196
  }
60862
61197
  const spki = await crypto4.subtle.exportKey("spki", params.keys.publicKey);
60863
61198
  const asnReq = new CertificationRequest({
60864
- certificationRequestInfo: new CertificationRequestInfo({ subjectPKInfo: AsnConvert.parse(spki, SubjectPublicKeyInfo) })
61199
+ certificationRequestInfo: new CertificationRequestInfo({
61200
+ subjectPKInfo: AsnConvert.parse(spki, SubjectPublicKeyInfo)
61201
+ })
60865
61202
  });
60866
61203
  if (params.name) {
60867
61204
  const name = params.name instanceof Name3 ? params.name : new Name3(params.name);
@@ -60904,6 +61241,38 @@ var Pkcs10CertificateRequestGenerator = class {
60904
61241
  return new Pkcs10CertificateRequest(AsnConvert.serialize(asnReq));
60905
61242
  }
60906
61243
  };
61244
+ function toPositiveIntegerOctets(input) {
61245
+ let firstNonZero = 0;
61246
+ while (firstNonZero < input.length - 1 && input[firstNonZero] === 0) {
61247
+ firstNonZero++;
61248
+ }
61249
+ let serialNumber = input.slice(firstNonZero);
61250
+ if (!serialNumber.length) {
61251
+ serialNumber = new Uint8Array([0]);
61252
+ }
61253
+ if (serialNumber[0] > 127) {
61254
+ const newSerialNumber = new Uint8Array(serialNumber.length + 1);
61255
+ newSerialNumber[0] = 0;
61256
+ newSerialNumber.set(serialNumber, 1);
61257
+ serialNumber = newSerialNumber;
61258
+ }
61259
+ return serialNumber.buffer;
61260
+ }
61261
+ function normalizeCertificateSerialNumber(input) {
61262
+ return toPositiveIntegerOctets(import_pvtsutils.BufferSourceConverter.toUint8Array(import_pvtsutils.Convert.FromHex(input || "")));
61263
+ }
61264
+ function generateCertificateSerialNumber(input, crypto4 = cryptoProvider.get()) {
61265
+ const inputView = import_pvtsutils.BufferSourceConverter.toUint8Array(import_pvtsutils.Convert.FromHex(input || ""));
61266
+ const serialNumber = inputView.length && inputView.some((o) => o > 0) ? inputView : crypto4.getRandomValues(new Uint8Array(16));
61267
+ return toPositiveIntegerOctets(serialNumber);
61268
+ }
61269
+ function getCertificateSerialNumber(raw) {
61270
+ let serialNumber = import_pvtsutils.BufferSourceConverter.toUint8Array(raw);
61271
+ if (serialNumber.length > 1 && serialNumber[0] === 0 && serialNumber[1] > 127) {
61272
+ serialNumber = serialNumber.slice(1);
61273
+ }
61274
+ return import_pvtsutils.Convert.ToHex(serialNumber);
61275
+ }
60907
61276
  var _X509Certificate_tbs;
60908
61277
  var _X509Certificate_serialNumber;
60909
61278
  var _X509Certificate_subjectName;
@@ -60919,18 +61288,13 @@ var _X509Certificate_publicKey;
60919
61288
  var X509Certificate = class extends PemData {
60920
61289
  get publicKey() {
60921
61290
  if (!__classPrivateFieldGet(this, _X509Certificate_publicKey, "f")) {
60922
- __classPrivateFieldSet(this, _X509Certificate_publicKey, new PublicKey(this.asn.tbsCertificate.subjectPublicKeyInfo), "f");
61291
+ __classPrivateFieldSet(this, _X509Certificate_publicKey, new PublicKey(this.asn.tbsCertificate.subjectPublicKeyInfo, this.parseOptions), "f");
60923
61292
  }
60924
61293
  return __classPrivateFieldGet(this, _X509Certificate_publicKey, "f");
60925
61294
  }
60926
61295
  get serialNumber() {
60927
61296
  if (!__classPrivateFieldGet(this, _X509Certificate_serialNumber, "f")) {
60928
- const tbs = this.asn.tbsCertificate;
60929
- let serialNumberBytes = new Uint8Array(tbs.serialNumber);
60930
- if (serialNumberBytes.length > 1 && serialNumberBytes[0] === 0 && serialNumberBytes[1] > 127) {
60931
- serialNumberBytes = serialNumberBytes.slice(1);
60932
- }
60933
- __classPrivateFieldSet(this, _X509Certificate_serialNumber, import_pvtsutils.Convert.ToHex(serialNumberBytes), "f");
61297
+ __classPrivateFieldSet(this, _X509Certificate_serialNumber, getCertificateSerialNumber(this.asn.tbsCertificate.serialNumber), "f");
60934
61298
  }
60935
61299
  return __classPrivateFieldGet(this, _X509Certificate_serialNumber, "f");
60936
61300
  }
@@ -60995,7 +61359,7 @@ var X509Certificate = class extends PemData {
60995
61359
  if (!__classPrivateFieldGet(this, _X509Certificate_extensions, "f")) {
60996
61360
  __classPrivateFieldSet(this, _X509Certificate_extensions, [], "f");
60997
61361
  if (this.asn.tbsCertificate.extensions) {
60998
- __classPrivateFieldSet(this, _X509Certificate_extensions, this.asn.tbsCertificate.extensions.map((o) => ExtensionFactory.create(AsnConvert.serialize(o))), "f");
61362
+ __classPrivateFieldSet(this, _X509Certificate_extensions, this.asn.tbsCertificate.extensions.map((o) => ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions)), "f");
60999
61363
  }
61000
61364
  }
61001
61365
  return __classPrivateFieldGet(this, _X509Certificate_extensions, "f");
@@ -61006,9 +61370,9 @@ var X509Certificate = class extends PemData {
61006
61370
  }
61007
61371
  return __classPrivateFieldGet(this, _X509Certificate_tbs, "f");
61008
61372
  }
61009
- constructor(param) {
61010
- const args = PemData.isAsnEncoded(param) ? [param, Certificate] : [param];
61011
- super(args[0], args[1]);
61373
+ constructor(param, options) {
61374
+ const args = PemData.isAsnEncoded(param) ? [param, Certificate, options] : [param, options];
61375
+ super(args[0], args[1], args[2]);
61012
61376
  _X509Certificate_tbs.set(this, void 0);
61013
61377
  _X509Certificate_serialNumber.set(this, void 0);
61014
61378
  _X509Certificate_subjectName.set(this, void 0);
@@ -61127,7 +61491,7 @@ var X509Certificate = class extends PemData {
61127
61491
  }
61128
61492
  toTextObject() {
61129
61493
  const obj = this.toTextObjectEmpty();
61130
- const cert = AsnConvert.parse(this.rawData, Certificate);
61494
+ const cert = AsnConvert.parse(this.rawData, Certificate, this.parseOptions);
61131
61495
  const tbs = cert.tbsCertificate;
61132
61496
  const data = new TextObject("", {
61133
61497
  Version: `${Version[tbs.version]} (${tbs.version})`,
@@ -61165,11 +61529,13 @@ var X509Certificate = class extends PemData {
61165
61529
  };
61166
61530
  _X509Certificate_tbs = /* @__PURE__ */ new WeakMap(), _X509Certificate_serialNumber = /* @__PURE__ */ new WeakMap(), _X509Certificate_subjectName = /* @__PURE__ */ new WeakMap(), _X509Certificate_subject = /* @__PURE__ */ new WeakMap(), _X509Certificate_issuerName = /* @__PURE__ */ new WeakMap(), _X509Certificate_issuer = /* @__PURE__ */ new WeakMap(), _X509Certificate_notBefore = /* @__PURE__ */ new WeakMap(), _X509Certificate_notAfter = /* @__PURE__ */ new WeakMap(), _X509Certificate_signatureAlgorithm = /* @__PURE__ */ new WeakMap(), _X509Certificate_signature = /* @__PURE__ */ new WeakMap(), _X509Certificate_extensions = /* @__PURE__ */ new WeakMap(), _X509Certificate_publicKey = /* @__PURE__ */ new WeakMap();
61167
61531
  X509Certificate.NAME = "Certificate";
61532
+ var _X509Certificates_options;
61168
61533
  var X509Certificates = class extends Array {
61169
- constructor(param) {
61534
+ constructor(param, options) {
61170
61535
  super();
61536
+ _X509Certificates_options.set(this, void 0);
61171
61537
  if (PemData.isAsnEncoded(param)) {
61172
- this.import(param);
61538
+ this.import(param, options);
61173
61539
  } else if (param instanceof X509Certificate) {
61174
61540
  this.push(param);
61175
61541
  } else if (Array.isArray(param)) {
@@ -61182,8 +61548,12 @@ var X509Certificates = class extends Array {
61182
61548
  const signedData = new SignedData();
61183
61549
  signedData.version = 1;
61184
61550
  signedData.encapContentInfo.eContentType = id_data;
61185
- signedData.encapContentInfo.eContent = new EncapsulatedContent({ single: new OctetString2() });
61186
- signedData.certificates = new CertificateSet(this.map((o) => new CertificateChoices({ certificate: AsnConvert.parse(o.rawData, Certificate) })));
61551
+ signedData.encapContentInfo.eContent = new EncapsulatedContent({
61552
+ single: new OctetString2()
61553
+ });
61554
+ signedData.certificates = new CertificateSet(this.map((o) => new CertificateChoices({
61555
+ certificate: AsnConvert.parse(o.rawData, Certificate, __classPrivateFieldGet(this, _X509Certificates_options, "f"))
61556
+ })));
61187
61557
  const cms = new ContentInfo({
61188
61558
  contentType: id_signedData,
61189
61559
  content: AsnConvert.serialize(signedData)
@@ -61194,19 +61564,24 @@ var X509Certificates = class extends Array {
61194
61564
  }
61195
61565
  return this.toString(format4);
61196
61566
  }
61197
- import(data) {
61567
+ import(data, options) {
61198
61568
  const raw = PemData.toArrayBuffer(data);
61199
- const cms = AsnConvert.parse(raw, ContentInfo);
61569
+ const cms = AsnConvert.parse(raw, ContentInfo, options);
61200
61570
  if (cms.contentType !== id_signedData) {
61201
61571
  throw new TypeError("Cannot parse CMS package. Incoming data is not a SignedData object.");
61202
61572
  }
61203
- const signedData = AsnConvert.parse(cms.content, SignedData);
61204
- this.clear();
61573
+ const signedData = AsnConvert.parse(cms.content, SignedData, options);
61574
+ const certificates = [];
61205
61575
  for (const item of signedData.certificates || []) {
61206
61576
  if (item.certificate) {
61207
- this.push(new X509Certificate(item.certificate));
61577
+ certificates.push(new X509Certificate(item.certificate, options));
61208
61578
  }
61209
61579
  }
61580
+ this.clear();
61581
+ for (const certificate of certificates) {
61582
+ this.push(certificate);
61583
+ }
61584
+ __classPrivateFieldSet(this, _X509Certificates_options, options, "f");
61210
61585
  }
61211
61586
  clear() {
61212
61587
  while (this.pop()) {
@@ -61220,7 +61595,7 @@ var X509Certificates = class extends Array {
61220
61595
  case "pem-chain":
61221
61596
  return this.map((o) => o.toString("pem")).join("\n");
61222
61597
  case "asn":
61223
- return AsnConvert.toString(raw);
61598
+ return AsnConvert.toString(raw, __classPrivateFieldGet(this, _X509Certificates_options, "f"));
61224
61599
  case "hex":
61225
61600
  return import_pvtsutils.Convert.ToHex(raw);
61226
61601
  case "base64":
@@ -61234,8 +61609,8 @@ var X509Certificates = class extends Array {
61234
61609
  }
61235
61610
  }
61236
61611
  toTextObject() {
61237
- const contentInfo = AsnConvert.parse(this.export("raw"), ContentInfo);
61238
- const signedData = AsnConvert.parse(contentInfo.content, SignedData);
61612
+ const contentInfo = AsnConvert.parse(this.export("raw"), ContentInfo, __classPrivateFieldGet(this, _X509Certificates_options, "f"));
61613
+ const signedData = AsnConvert.parse(contentInfo.content, SignedData, __classPrivateFieldGet(this, _X509Certificates_options, "f"));
61239
61614
  const obj = new TextObject("X509Certificates", {
61240
61615
  "Content Type": OidSerializer.toString(contentInfo.contentType),
61241
61616
  Content: new TextObject("", {
@@ -61246,6 +61621,7 @@ var X509Certificates = class extends Array {
61246
61621
  return obj;
61247
61622
  }
61248
61623
  };
61624
+ _X509Certificates_options = /* @__PURE__ */ new WeakMap();
61249
61625
  var X509ChainBuilder = class {
61250
61626
  constructor(params = {}) {
61251
61627
  this.certificates = [];
@@ -61310,25 +61686,6 @@ var X509ChainBuilder = class {
61310
61686
  return null;
61311
61687
  }
61312
61688
  };
61313
- function generateCertificateSerialNumber(input, crypto4 = cryptoProvider.get()) {
61314
- const inputView = import_pvtsutils.BufferSourceConverter.toUint8Array(import_pvtsutils.Convert.FromHex(input || ""));
61315
- let serialNumber = inputView && inputView.length && inputView.some((o) => o > 0) ? new Uint8Array(inputView) : void 0;
61316
- if (!serialNumber) {
61317
- serialNumber = crypto4.getRandomValues(new Uint8Array(16));
61318
- }
61319
- let firstNonZero = 0;
61320
- while (firstNonZero < serialNumber.length - 1 && serialNumber[firstNonZero] === 0) {
61321
- firstNonZero++;
61322
- }
61323
- serialNumber = serialNumber.slice(firstNonZero);
61324
- if (serialNumber[0] > 127) {
61325
- const newSerialNumber = new Uint8Array(serialNumber.length + 1);
61326
- newSerialNumber[0] = 0;
61327
- newSerialNumber.set(serialNumber, 1);
61328
- serialNumber = newSerialNumber;
61329
- }
61330
- return serialNumber.buffer;
61331
- }
61332
61689
  var X509CertificateGenerator = class {
61333
61690
  static async createSelfSigned(params, crypto4 = cryptoProvider.get()) {
61334
61691
  if (!params.keys.privateKey) {
@@ -61433,7 +61790,7 @@ var X509CrlReason;
61433
61790
  var X509CrlEntry = class extends AsnData {
61434
61791
  get serialNumber() {
61435
61792
  if (!__classPrivateFieldGet(this, _X509CrlEntry_serialNumber, "f")) {
61436
- __classPrivateFieldSet(this, _X509CrlEntry_serialNumber, import_pvtsutils.Convert.ToHex(this.asn.userCertificate), "f");
61793
+ __classPrivateFieldSet(this, _X509CrlEntry_serialNumber, getCertificateSerialNumber(this.asn.userCertificate), "f");
61437
61794
  }
61438
61795
  return __classPrivateFieldGet(this, _X509CrlEntry_serialNumber, "f");
61439
61796
  }
@@ -61460,16 +61817,16 @@ var X509CrlEntry = class extends AsnData {
61460
61817
  __classPrivateFieldSet(this, _X509CrlEntry_extensions, [], "f");
61461
61818
  if (this.asn.crlEntryExtensions) {
61462
61819
  __classPrivateFieldSet(this, _X509CrlEntry_extensions, this.asn.crlEntryExtensions.map((o) => {
61463
- const extension = ExtensionFactory.create(AsnConvert.serialize(o));
61820
+ const extension = ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions);
61464
61821
  switch (extension.type) {
61465
61822
  case id_ce_cRLReasons:
61466
61823
  if (__classPrivateFieldGet(this, _X509CrlEntry_reason, "f") === void 0) {
61467
- __classPrivateFieldSet(this, _X509CrlEntry_reason, AsnConvert.parse(extension.value, CRLReason).reason, "f");
61824
+ __classPrivateFieldSet(this, _X509CrlEntry_reason, AsnConvert.parse(extension.value, CRLReason, this.parseOptions).reason, "f");
61468
61825
  }
61469
61826
  break;
61470
61827
  case id_ce_invalidityDate:
61471
61828
  if (__classPrivateFieldGet(this, _X509CrlEntry_invalidity, "f") === void 0) {
61472
- __classPrivateFieldSet(this, _X509CrlEntry_invalidity, AsnConvert.parse(extension.value, InvalidityDate).value, "f");
61829
+ __classPrivateFieldSet(this, _X509CrlEntry_invalidity, AsnConvert.parse(extension.value, InvalidityDate, this.parseOptions).value, "f");
61473
61830
  }
61474
61831
  break;
61475
61832
  }
@@ -61481,21 +61838,25 @@ var X509CrlEntry = class extends AsnData {
61481
61838
  }
61482
61839
  constructor(...args) {
61483
61840
  let raw;
61841
+ let options;
61484
61842
  if (import_pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
61485
61843
  raw = import_pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]);
61844
+ options = args[1];
61486
61845
  } else if (typeof args[0] === "string") {
61487
61846
  raw = AsnConvert.serialize(new RevokedCertificate({
61488
- userCertificate: generateCertificateSerialNumber(args[0]),
61847
+ userCertificate: normalizeCertificateSerialNumber(args[0]),
61489
61848
  revocationDate: new Time(args[1]),
61490
61849
  crlEntryExtensions: args[2]
61491
61850
  }));
61492
61851
  } else if (args[0] instanceof RevokedCertificate) {
61493
61852
  raw = args[0];
61853
+ options = args[1];
61494
61854
  }
61495
61855
  if (!raw) {
61496
61856
  throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");
61497
61857
  }
61498
- super(raw, RevokedCertificate);
61858
+ const superArgs = raw instanceof RevokedCertificate ? [raw, options] : [raw, RevokedCertificate, options];
61859
+ super(superArgs[0], superArgs[1], superArgs[2]);
61499
61860
  _X509CrlEntry_serialNumber.set(this, void 0);
61500
61861
  _X509CrlEntry_revocationDate.set(this, void 0);
61501
61862
  _X509CrlEntry_reason.set(this, void 0);
@@ -61556,7 +61917,7 @@ var X509Crl = class extends PemData {
61556
61917
  get entries() {
61557
61918
  var _a3;
61558
61919
  if (!__classPrivateFieldGet(this, _X509Crl_entries, "f")) {
61559
- __classPrivateFieldSet(this, _X509Crl_entries, ((_a3 = this.asn.tbsCertList.revokedCertificates) === null || _a3 === void 0 ? void 0 : _a3.map((o) => new X509CrlEntry(o))) || [], "f");
61920
+ __classPrivateFieldSet(this, _X509Crl_entries, ((_a3 = this.asn.tbsCertList.revokedCertificates) === null || _a3 === void 0 ? void 0 : _a3.map((o) => new X509CrlEntry(o, this.parseOptions))) || [], "f");
61560
61921
  }
61561
61922
  return __classPrivateFieldGet(this, _X509Crl_entries, "f");
61562
61923
  }
@@ -61564,7 +61925,7 @@ var X509Crl = class extends PemData {
61564
61925
  if (!__classPrivateFieldGet(this, _X509Crl_extensions, "f")) {
61565
61926
  __classPrivateFieldSet(this, _X509Crl_extensions, [], "f");
61566
61927
  if (this.asn.tbsCertList.crlExtensions) {
61567
- __classPrivateFieldSet(this, _X509Crl_extensions, this.asn.tbsCertList.crlExtensions.map((o) => ExtensionFactory.create(AsnConvert.serialize(o))), "f");
61928
+ __classPrivateFieldSet(this, _X509Crl_extensions, this.asn.tbsCertList.crlExtensions.map((o) => ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions)), "f");
61568
61929
  }
61569
61930
  }
61570
61931
  return __classPrivateFieldGet(this, _X509Crl_extensions, "f");
@@ -61581,8 +61942,9 @@ var X509Crl = class extends PemData {
61581
61942
  get certListSignatureAlgorithm() {
61582
61943
  return this.asn.signatureAlgorithm;
61583
61944
  }
61584
- constructor(param) {
61585
- super(param, PemData.isAsnEncoded(param) ? CertificateList : void 0);
61945
+ constructor(param, options) {
61946
+ const args = PemData.isAsnEncoded(param) ? [param, CertificateList, options] : [param, options];
61947
+ super(args[0], args[1], args[2]);
61586
61948
  this.tag = PemConverter.CrlTag;
61587
61949
  _X509Crl_tbs.set(this, void 0);
61588
61950
  _X509Crl_signatureAlgorithm.set(this, void 0);
@@ -61676,10 +62038,10 @@ var X509Crl = class extends PemData {
61676
62038
  }
61677
62039
  findRevoked(certOrSerialNumber) {
61678
62040
  const serialNumber = typeof certOrSerialNumber === "string" ? certOrSerialNumber : certOrSerialNumber.serialNumber;
61679
- const serialBuffer = generateCertificateSerialNumber(serialNumber);
62041
+ const serialBuffer = normalizeCertificateSerialNumber(serialNumber);
61680
62042
  for (const revoked of this.asn.tbsCertList.revokedCertificates || []) {
61681
62043
  if (import_pvtsutils.BufferSourceConverter.isEqual(revoked.userCertificate, serialBuffer)) {
61682
- return new X509CrlEntry(AsnConvert.serialize(revoked));
62044
+ return new X509CrlEntry(AsnConvert.serialize(revoked), this.parseOptions);
61683
62045
  }
61684
62046
  }
61685
62047
  return null;
@@ -61706,7 +62068,7 @@ var X509CrlGenerator = class {
61706
62068
  if (params.entries && params.entries.length) {
61707
62069
  asnX509Crl.tbsCertList.revokedCertificates = [];
61708
62070
  for (const entry of params.entries) {
61709
- const userCertificate = PemData.toArrayBuffer(entry.serialNumber);
62071
+ const userCertificate = normalizeCertificateSerialNumber(entry.serialNumber);
61710
62072
  const index = asnX509Crl.tbsCertList.revokedCertificates.findIndex((cert) => (0, import_pvtsutils.isEqual)(cert.userCertificate, userCertificate));
61711
62073
  if (index > -1) {
61712
62074
  throw new Error(`Certificate serial number ${entry.serialNumber} already exists in tbsCertList`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-crypto-web",
3
- "version": "5.11.0",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "description": "Pre-bundled, zero-config browser build of node-opcua-crypto",
6
6
  "//why": "This package exists so node-opcua-crypto can stay lean for Node. The pre-bundled browser build inlines its polyfills (crypto-browserify, stream-browserify, ...) and weighs ~344 KB gzip - more than the entire node-opcua-crypto tarball. Shipping it there would make every Node consumer download a browser bundle they never import. Browser consumers install this package explicitly, or let node-opcua-crypto's \"browser\" export condition redirect to it (see node-opcua-crypto/browser/index.js).",
@@ -37,14 +37,14 @@
37
37
  "license": "MIT",
38
38
  "//devDependencies": "every one of these is inlined into dist/ at build time (tsup noExternal), so this package has no runtime dependencies at all.",
39
39
  "devDependencies": {
40
- "@types/node": "^24.13.3",
40
+ "@types/node": "^24.13.5",
41
41
  "assert": "^2.1.0",
42
42
  "buffer": "^6.0.3",
43
43
  "constants-browserify": "^1.0.0",
44
44
  "crypto-browserify": "^3.12.1",
45
45
  "esbuild": "^0.28.2",
46
46
  "events": "^3.3.0",
47
- "node-opcua-crypto": "^5.11.0",
47
+ "node-opcua-crypto": "^6.0.0",
48
48
  "path-browserify": "^1.0.1",
49
49
  "process": "^0.11.10",
50
50
  "stream-browserify": "^3.0.0",
@@ -67,5 +67,5 @@
67
67
  "LICENSE",
68
68
  "README.md"
69
69
  ],
70
- "gitHead": "114afd2e134735f5157acd1ee51d578bd596eaa4"
70
+ "gitHead": "a77d3e8cd96e5bd02bfd0c20c09f247619bf509a"
71
71
  }