@kya-brasil/mcp 0.1.0 → 0.1.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 (3) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +963 -632
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ var require_code = __commonJS({
59
59
  };
60
60
  exports._CodeOrName = _CodeOrName;
61
61
  exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
62
- var Name = class extends _CodeOrName {
62
+ var Name2 = class extends _CodeOrName {
63
63
  constructor(s) {
64
64
  super();
65
65
  if (!exports.IDENTIFIER.test(s))
@@ -76,7 +76,7 @@ var require_code = __commonJS({
76
76
  return { [this.str]: 1 };
77
77
  }
78
78
  };
79
- exports.Name = Name;
79
+ exports.Name = Name2;
80
80
  var _Code = class extends _CodeOrName {
81
81
  constructor(code) {
82
82
  super();
@@ -98,7 +98,7 @@ var require_code = __commonJS({
98
98
  get names() {
99
99
  var _a3;
100
100
  return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names, c) => {
101
- if (c instanceof Name)
101
+ if (c instanceof Name2)
102
102
  names[c.str] = (names[c.str] || 0) + 1;
103
103
  return names;
104
104
  }, {});
@@ -132,7 +132,7 @@ var require_code = __commonJS({
132
132
  function addCodeArg(code, arg) {
133
133
  if (arg instanceof _Code)
134
134
  code.push(...arg._items);
135
- else if (arg instanceof Name)
135
+ else if (arg instanceof Name2)
136
136
  code.push(arg);
137
137
  else
138
138
  code.push(interpolate(arg));
@@ -158,7 +158,7 @@ var require_code = __commonJS({
158
158
  if (a === '""')
159
159
  return b;
160
160
  if (typeof a == "string") {
161
- if (b instanceof Name || a[a.length - 1] !== '"')
161
+ if (b instanceof Name2 || a[a.length - 1] !== '"')
162
162
  return;
163
163
  if (typeof b != "string")
164
164
  return `${a.slice(0, -1)}${b}"`;
@@ -166,7 +166,7 @@ var require_code = __commonJS({
166
166
  return a.slice(0, -1) + b.slice(1);
167
167
  return;
168
168
  }
169
- if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
169
+ if (typeof b == "string" && b[0] === '"' && !(a instanceof Name2))
170
170
  return `"${a}${b.slice(1)}`;
171
171
  return;
172
172
  }
@@ -3119,9 +3119,9 @@ var require_data = __commonJS({
3119
3119
  }
3120
3120
  });
3121
3121
 
3122
- // ../../node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js
3122
+ // ../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/utils.js
3123
3123
  var require_utils = __commonJS({
3124
- "../../node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js"(exports, module) {
3124
+ "../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/utils.js"(exports, module) {
3125
3125
  "use strict";
3126
3126
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
3127
3127
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
@@ -3353,6 +3353,37 @@ var require_utils = __commonJS({
3353
3353
  }
3354
3354
  return output2.join("");
3355
3355
  }
3356
+ function removeDotSegmentsRelative(path) {
3357
+ if (path === "" || path[0] === "/") {
3358
+ return removeDotSegments(path);
3359
+ }
3360
+ const segments = path.split("/");
3361
+ const last = segments.length - 1;
3362
+ const output2 = [];
3363
+ let trailingDirectory = false;
3364
+ for (let i = 0; i <= last; i++) {
3365
+ const segment = segments[i];
3366
+ if (segment === "." || segment === "..") {
3367
+ if (segment === "..") {
3368
+ if (output2.length !== 0 && output2[output2.length - 1] !== "..") {
3369
+ output2.pop();
3370
+ } else {
3371
+ output2.push("..");
3372
+ }
3373
+ }
3374
+ trailingDirectory = i === last;
3375
+ } else {
3376
+ output2.push(segment);
3377
+ }
3378
+ }
3379
+ if (trailingDirectory && output2[output2.length - 1] !== "..") {
3380
+ output2.push("");
3381
+ }
3382
+ if (output2.length === 0 || output2[0] === "" || output2[0].includes(":")) {
3383
+ output2.unshift(".");
3384
+ }
3385
+ return output2.join("/");
3386
+ }
3356
3387
  var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3357
3388
  var HOST_DELIM_RE = /[@/?#:]/g;
3358
3389
  var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
@@ -3613,6 +3644,7 @@ var require_utils = __commonJS({
3613
3644
  encodeFragment,
3614
3645
  escapePreservingEscapes,
3615
3646
  removeDotSegments,
3647
+ removeDotSegmentsRelative,
3616
3648
  isIPv4,
3617
3649
  isUUID,
3618
3650
  normalizeIPv6,
@@ -3621,9 +3653,9 @@ var require_utils = __commonJS({
3621
3653
  }
3622
3654
  });
3623
3655
 
3624
- // ../../node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js
3656
+ // ../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/schemes.js
3625
3657
  var require_schemes = __commonJS({
3626
- "../../node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js"(exports, module) {
3658
+ "../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/schemes.js"(exports, module) {
3627
3659
  "use strict";
3628
3660
  var { isUUID } = require_utils();
3629
3661
  var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
@@ -3832,20 +3864,22 @@ var require_schemes = __commonJS({
3832
3864
  }
3833
3865
  });
3834
3866
 
3835
- // ../../node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js
3867
+ // ../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/index.js
3836
3868
  var require_fast_uri = __commonJS({
3837
- "../../node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js"(exports, module) {
3869
+ "../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/index.js"(exports, module) {
3838
3870
  "use strict";
3839
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3871
+ var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3840
3872
  var { SCHEMES, getSchemeHandler } = require_schemes();
3841
3873
  var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
3842
3874
  var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
3843
- function decodeValidScheme(scheme) {
3844
- const decodedScheme = unescape(String(scheme));
3845
- if (!VALID_SCHEME.test(decodedScheme)) {
3875
+ var MALFORMED_HOST_ERROR = "URI host is malformed.";
3876
+ var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
3877
+ function validateScheme(scheme) {
3878
+ const stringScheme = String(scheme);
3879
+ if (!VALID_SCHEME.test(stringScheme)) {
3846
3880
  throw new TypeError(MALFORMED_SCHEME_ERROR);
3847
3881
  }
3848
- return decodedScheme;
3882
+ return stringScheme;
3849
3883
  }
3850
3884
  function normalize(uri, options) {
3851
3885
  if (typeof uri === "string") {
@@ -3882,6 +3916,9 @@ var require_fast_uri = __commonJS({
3882
3916
  const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
3883
3917
  const resolvedHost = resolved.host;
3884
3918
  const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
3919
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
3920
+ throw new Error(MALFORMED_HOST_ERROR);
3921
+ }
3885
3922
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
3886
3923
  const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
3887
3924
  if (resolved.error && !encodedASCIIHost) {
@@ -3923,14 +3960,15 @@ var require_fast_uri = __commonJS({
3923
3960
  if (relative.path[0] === "/") {
3924
3961
  target.path = removeDotSegments(relative.path);
3925
3962
  } else {
3926
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3963
+ const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
3964
+ if (baseHasAuthority && !base.path) {
3927
3965
  target.path = "/" + relative.path;
3928
3966
  } else if (!base.path) {
3929
3967
  target.path = relative.path;
3930
3968
  } else {
3931
3969
  target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3932
3970
  }
3933
- target.path = removeDotSegments(target.path);
3971
+ target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
3934
3972
  }
3935
3973
  target.query = relative.query;
3936
3974
  }
@@ -3968,12 +4006,13 @@ var require_fast_uri = __commonJS({
3968
4006
  const options = Object.assign({}, opts);
3969
4007
  const uriTokens = [];
3970
4008
  if (component.scheme) {
3971
- component.scheme = decodeValidScheme(component.scheme);
4009
+ component.scheme = validateScheme(component.scheme);
3972
4010
  }
3973
4011
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
3974
4012
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
3975
4013
  const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
3976
- const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
4014
+ const schemelessReference = (component.scheme === void 0 || options.reference === "suffix") && !hasAuthority;
4015
+ const pathNoScheme = !options.skipEscape && schemelessReference;
3977
4016
  if (component.path !== void 0) {
3978
4017
  if (!options.skipEscape) {
3979
4018
  component.path = serializePathEncoding(component.path, pathNoScheme);
@@ -3982,7 +4021,7 @@ var require_fast_uri = __commonJS({
3982
4021
  }
3983
4022
  }
3984
4023
  if (options.reference !== "suffix" && component.scheme) {
3985
- component.scheme = decodeValidScheme(component.scheme);
4024
+ component.scheme = validateScheme(component.scheme);
3986
4025
  uriTokens.push(component.scheme, ":");
3987
4026
  }
3988
4027
  const authority = recomposeAuthority(component);
@@ -3998,9 +4037,9 @@ var require_fast_uri = __commonJS({
3998
4037
  if (component.path !== void 0) {
3999
4038
  let s = component.path;
4000
4039
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
4001
- s = removeDotSegments(s);
4040
+ s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
4002
4041
  }
4003
- if (pathNoScheme) {
4042
+ if (schemelessReference) {
4004
4043
  s = serializePathEncoding(s, true);
4005
4044
  }
4006
4045
  if (authority === void 0 && s[0] === "/" && s[1] === "/") {
@@ -4047,16 +4086,34 @@ var require_fast_uri = __commonJS({
4047
4086
  return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
4048
4087
  }
4049
4088
  function canonicalizeHost(parsed, options, schemeHandler, isIP) {
4089
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
4090
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4091
+ return true;
4092
+ }
4050
4093
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
4094
+ let url2;
4051
4095
  try {
4052
- parsed.host = new URL("http://" + parsed.host).hostname;
4096
+ url2 = new URL("http://" + parsed.host);
4053
4097
  } catch (e) {
4054
4098
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
4055
4099
  return true;
4056
4100
  }
4101
+ if (!isHostOnlyURL(url2)) {
4102
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4103
+ return true;
4104
+ }
4105
+ parsed.host = url2.hostname;
4057
4106
  }
4058
4107
  return false;
4059
4108
  }
4109
+ function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
4110
+ return Boolean(
4111
+ parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)
4112
+ );
4113
+ }
4114
+ function isHostOnlyURL(url2) {
4115
+ return url2.username === "" && url2.password === "" && url2.port === "" && url2.pathname === "/" && url2.search === "" && url2.hash === "" && url2.hostname !== "";
4116
+ }
4060
4117
  function parseWithStatus(uri, opts) {
4061
4118
  const options = Object.assign({}, opts);
4062
4119
  const parsed = {
@@ -4111,9 +4168,8 @@ var require_fast_uri = __commonJS({
4111
4168
  parsed.query = matches[7];
4112
4169
  parsed.fragment = matches[8];
4113
4170
  if (parsed.scheme !== void 0) {
4114
- const decodedScheme = unescape(parsed.scheme);
4115
- if (VALID_SCHEME.test(decodedScheme)) {
4116
- parsed.scheme = decodedScheme.toLowerCase();
4171
+ if (VALID_SCHEME.test(parsed.scheme)) {
4172
+ parsed.scheme = parsed.scheme.toLowerCase();
4117
4173
  } else {
4118
4174
  parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
4119
4175
  malformedScheme = true;
@@ -4141,7 +4197,7 @@ var require_fast_uri = __commonJS({
4141
4197
  malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
4142
4198
  parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
4143
4199
  if (malformedIPLiteral) {
4144
- parsed.error = parsed.error || "URI host is malformed.";
4200
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4145
4201
  malformedAuthorityOrPort = true;
4146
4202
  }
4147
4203
  } else {
@@ -4169,7 +4225,7 @@ var require_fast_uri = __commonJS({
4169
4225
  if (!isIP) {
4170
4226
  host = normalizePercentEncoding(host.toLowerCase());
4171
4227
  }
4172
- parsed.host = reescapeHostDelimiters(host, isIP);
4228
+ parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
4173
4229
  }
4174
4230
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4175
4231
  if (parsed.path) {
@@ -12948,8 +13004,8 @@ var require_build = __commonJS({
12948
13004
  return new Uint8Array(Buffer.from(formatted, "base64")).buffer;
12949
13005
  }
12950
13006
  }
12951
- static FromBase64Url(base64url3) {
12952
- const formatted = this.formatString(base64url3);
13007
+ static FromBase64Url(base64url4) {
13008
+ const formatted = this.formatString(base64url4);
12953
13009
  if (!formatted) {
12954
13010
  return new ArrayBuffer(0);
12955
13011
  }
@@ -14613,7 +14669,7 @@ ${values.join("\n")}` : `${blockName} :`;
14613
14669
  };
14614
14670
  LocalOctetStringValueBlock.NAME = "OctetStringValueBlock";
14615
14671
  var _a$r;
14616
- var OctetString2 = class extends BaseBlock {
14672
+ var OctetString3 = class extends BaseBlock {
14617
14673
  constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
14618
14674
  var _b, _c;
14619
14675
  (_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length);
@@ -14678,11 +14734,11 @@ ${values.join("\n")}` : `${blockName} :`;
14678
14734
  return pvtsutils__namespace.BufferSourceConverter.concat(array2);
14679
14735
  }
14680
14736
  };
14681
- _a$r = OctetString2;
14737
+ _a$r = OctetString3;
14682
14738
  (() => {
14683
14739
  typeStore.OctetString = _a$r;
14684
14740
  })();
14685
- OctetString2.NAME = OCTET_STRING_NAME;
14741
+ OctetString3.NAME = OCTET_STRING_NAME;
14686
14742
  var LocalBitStringValueBlock = class extends HexBlock(LocalConstructedValueBlock) {
14687
14743
  constructor({ unusedBits = 0, isConstructed = false, ...parameters } = {}) {
14688
14744
  super(parameters);
@@ -14776,7 +14832,7 @@ ${values.join("\n")}` : `${blockName} :`;
14776
14832
  };
14777
14833
  LocalBitStringValueBlock.NAME = "BitStringValueBlock";
14778
14834
  var _a$q;
14779
- var BitString = class extends BaseBlock {
14835
+ var BitString2 = class extends BaseBlock {
14780
14836
  constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
14781
14837
  var _b, _c;
14782
14838
  (_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length);
@@ -14815,11 +14871,11 @@ ${values.join("\n")}` : `${blockName} :`;
14815
14871
  }
14816
14872
  }
14817
14873
  };
14818
- _a$q = BitString;
14874
+ _a$q = BitString2;
14819
14875
  (() => {
14820
14876
  typeStore.BitString = _a$q;
14821
14877
  })();
14822
- BitString.NAME = BIT_STRING_NAME;
14878
+ BitString2.NAME = BIT_STRING_NAME;
14823
14879
  var _a$p;
14824
14880
  function viewAdd(first, second) {
14825
14881
  const c = new Uint8Array([0]);
@@ -16526,7 +16582,7 @@ ${values.join("\n")}` : `${blockName} :`;
16526
16582
  exports.Any = Any2;
16527
16583
  exports.BaseBlock = BaseBlock;
16528
16584
  exports.BaseStringBlock = BaseStringBlock;
16529
- exports.BitString = BitString;
16585
+ exports.BitString = BitString2;
16530
16586
  exports.BmpString = BmpString;
16531
16587
  exports.Boolean = Boolean2;
16532
16588
  exports.CharacterString = CharacterString;
@@ -16549,7 +16605,7 @@ ${values.join("\n")}` : `${blockName} :`;
16549
16605
  exports.Null = Null;
16550
16606
  exports.NumericString = NumericString;
16551
16607
  exports.ObjectIdentifier = ObjectIdentifier2;
16552
- exports.OctetString = OctetString2;
16608
+ exports.OctetString = OctetString3;
16553
16609
  exports.Primitive = Primitive;
16554
16610
  exports.PrintableString = PrintableString;
16555
16611
  exports.RawData = RawData;
@@ -19800,7 +19856,7 @@ var require_sha2 = __commonJS({
19800
19856
  var require_build3 = __commonJS({
19801
19857
  "../../node_modules/.pnpm/pkijs@3.4.1/node_modules/pkijs/build/index.js"(exports) {
19802
19858
  "use strict";
19803
- var asn1js3 = require_build2();
19859
+ var asn1js4 = require_build2();
19804
19860
  var pvtsutils = require_build();
19805
19861
  var pvutils = require_utils2();
19806
19862
  var bs = require_cjs();
@@ -19824,7 +19880,7 @@ var require_build3 = __commonJS({
19824
19880
  n.default = e;
19825
19881
  return Object.freeze(n);
19826
19882
  }
19827
- var asn1js__namespace = /* @__PURE__ */ _interopNamespaceDefault(asn1js3);
19883
+ var asn1js__namespace = /* @__PURE__ */ _interopNamespaceDefault(asn1js4);
19828
19884
  var pvtsutils__namespace = /* @__PURE__ */ _interopNamespaceDefault(pvtsutils);
19829
19885
  var pvutils__namespace = /* @__PURE__ */ _interopNamespaceDefault(pvutils);
19830
19886
  var bs__namespace = /* @__PURE__ */ _interopNamespaceDefault(bs);
@@ -20840,7 +20896,7 @@ var require_build3 = __commonJS({
20840
20896
  var ALGORITHM$2 = "algorithm";
20841
20897
  var PARAMS = "params";
20842
20898
  var CLEAR_PROPS$1u = [ALGORITHM$2, PARAMS];
20843
- var AlgorithmIdentifier2 = class _AlgorithmIdentifier extends PkiObject {
20899
+ var AlgorithmIdentifier3 = class _AlgorithmIdentifier extends PkiObject {
20844
20900
  constructor(parameters = {}) {
20845
20901
  super();
20846
20902
  this.algorithmId = pvutils__namespace.getParametersValue(parameters, ALGORITHM_ID, _AlgorithmIdentifier.defaultValues(ALGORITHM_ID));
@@ -20934,7 +20990,7 @@ var require_build3 = __commonJS({
20934
20990
  return true;
20935
20991
  }
20936
20992
  };
20937
- AlgorithmIdentifier2.CLASS_NAME = "AlgorithmIdentifier";
20993
+ AlgorithmIdentifier3.CLASS_NAME = "AlgorithmIdentifier";
20938
20994
  var ALT_NAMES = "altNames";
20939
20995
  var CLEAR_PROPS$1t = [ALT_NAMES];
20940
20996
  var AltName = class _AltName extends PkiObject {
@@ -23440,7 +23496,7 @@ var require_build3 = __commonJS({
23440
23496
  static defaultValues(memberName) {
23441
23497
  switch (memberName) {
23442
23498
  case ALGORITHM$1:
23443
- return new AlgorithmIdentifier2();
23499
+ return new AlgorithmIdentifier3();
23444
23500
  case SUBJECT_PUBLIC_KEY:
23445
23501
  return new asn1js__namespace.BitString();
23446
23502
  default:
@@ -23452,7 +23508,7 @@ var require_build3 = __commonJS({
23452
23508
  return new asn1js__namespace.Sequence({
23453
23509
  name: names.blockName || EMPTY_STRING,
23454
23510
  value: [
23455
- AlgorithmIdentifier2.schema(names.algorithm || {}),
23511
+ AlgorithmIdentifier3.schema(names.algorithm || {}),
23456
23512
  new asn1js__namespace.BitString({ name: names.subjectPublicKey || EMPTY_STRING })
23457
23513
  ]
23458
23514
  });
@@ -23470,7 +23526,7 @@ var require_build3 = __commonJS({
23470
23526
  }
23471
23527
  }));
23472
23528
  AsnError.assertSchema(asn1, this.className);
23473
- this.algorithm = new AlgorithmIdentifier2({ schema: asn1.result.algorithm });
23529
+ this.algorithm = new AlgorithmIdentifier3({ schema: asn1.result.algorithm });
23474
23530
  this.subjectPublicKey = asn1.result.subjectPublicKey;
23475
23531
  }
23476
23532
  toSchema() {
@@ -23504,14 +23560,14 @@ var require_build3 = __commonJS({
23504
23560
  switch (json2.kty.toUpperCase()) {
23505
23561
  case "EC":
23506
23562
  this.parsedKey = new ECPublicKey({ json: json2 });
23507
- this.algorithm = new AlgorithmIdentifier2({
23563
+ this.algorithm = new AlgorithmIdentifier3({
23508
23564
  algorithmId: "1.2.840.10045.2.1",
23509
23565
  algorithmParams: new asn1js__namespace.ObjectIdentifier({ value: this.parsedKey.namedCurve })
23510
23566
  });
23511
23567
  break;
23512
23568
  case "RSA":
23513
23569
  this.parsedKey = new RSAPublicKey({ json: json2 });
23514
- this.algorithm = new AlgorithmIdentifier2({
23570
+ this.algorithm = new AlgorithmIdentifier3({
23515
23571
  algorithmId: "1.2.840.113549.1.1.1",
23516
23572
  algorithmParams: new asn1js__namespace.Null()
23517
23573
  });
@@ -23524,7 +23580,7 @@ var require_build3 = __commonJS({
23524
23580
  });
23525
23581
  }
23526
23582
  }
23527
- async importKey(publicKey, crypto3 = getCrypto2(true)) {
23583
+ async importKey(publicKey, crypto3 = getCrypto3(true)) {
23528
23584
  try {
23529
23585
  if (!publicKey) {
23530
23586
  throw new Error("Need to provide publicKey input parameter");
@@ -24003,7 +24059,7 @@ var require_build3 = __commonJS({
24003
24059
  case VERSION$j:
24004
24060
  return 0;
24005
24061
  case PRIVATE_KEY_ALGORITHM:
24006
- return new AlgorithmIdentifier2();
24062
+ return new AlgorithmIdentifier3();
24007
24063
  case PRIVATE_KEY:
24008
24064
  return new asn1js__namespace.OctetString();
24009
24065
  case ATTRIBUTES$5:
@@ -24020,7 +24076,7 @@ var require_build3 = __commonJS({
24020
24076
  name: names.blockName || EMPTY_STRING,
24021
24077
  value: [
24022
24078
  new asn1js__namespace.Integer({ name: names.version || EMPTY_STRING }),
24023
- AlgorithmIdentifier2.schema(names.privateKeyAlgorithm || {}),
24079
+ AlgorithmIdentifier3.schema(names.privateKeyAlgorithm || {}),
24024
24080
  new asn1js__namespace.OctetString({ name: names.privateKey || EMPTY_STRING }),
24025
24081
  new asn1js__namespace.Constructed({
24026
24082
  optional: true,
@@ -24054,7 +24110,7 @@ var require_build3 = __commonJS({
24054
24110
  }));
24055
24111
  AsnError.assertSchema(asn1, this.className);
24056
24112
  this.version = asn1.result.version.valueBlock.valueDec;
24057
- this.privateKeyAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.privateKeyAlgorithm });
24113
+ this.privateKeyAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.privateKeyAlgorithm });
24058
24114
  this.privateKey = asn1.result.privateKey;
24059
24115
  if (ATTRIBUTES$5 in asn1.result)
24060
24116
  this.attributes = Array.from(asn1.result.attributes, (element) => new Attribute2({ schema: element }));
@@ -24131,14 +24187,14 @@ var require_build3 = __commonJS({
24131
24187
  switch (json2.kty.toUpperCase()) {
24132
24188
  case "EC":
24133
24189
  this.parsedKey = new ECPrivateKey({ json: json2 });
24134
- this.privateKeyAlgorithm = new AlgorithmIdentifier2({
24190
+ this.privateKeyAlgorithm = new AlgorithmIdentifier3({
24135
24191
  algorithmId: "1.2.840.10045.2.1",
24136
24192
  algorithmParams: new asn1js__namespace.ObjectIdentifier({ value: this.parsedKey.namedCurve })
24137
24193
  });
24138
24194
  break;
24139
24195
  case "RSA":
24140
24196
  this.parsedKey = new RSAPrivateKey({ json: json2 });
24141
- this.privateKeyAlgorithm = new AlgorithmIdentifier2({
24197
+ this.privateKeyAlgorithm = new AlgorithmIdentifier3({
24142
24198
  algorithmId: "1.2.840.113549.1.1.1",
24143
24199
  algorithmParams: new asn1js__namespace.Null()
24144
24200
  });
@@ -24197,7 +24253,7 @@ var require_build3 = __commonJS({
24197
24253
  case CONTENT_TYPE$1:
24198
24254
  return EMPTY_STRING;
24199
24255
  case CONTENT_ENCRYPTION_ALGORITHM:
24200
- return new AlgorithmIdentifier2();
24256
+ return new AlgorithmIdentifier3();
24201
24257
  case ENCRYPTED_CONTENT:
24202
24258
  return new asn1js__namespace.OctetString();
24203
24259
  default:
@@ -24222,7 +24278,7 @@ var require_build3 = __commonJS({
24222
24278
  name: names.blockName || EMPTY_STRING,
24223
24279
  value: [
24224
24280
  new asn1js__namespace.ObjectIdentifier({ name: names.contentType || EMPTY_STRING }),
24225
- AlgorithmIdentifier2.schema(names.contentEncryptionAlgorithm || {}),
24281
+ AlgorithmIdentifier3.schema(names.contentEncryptionAlgorithm || {}),
24226
24282
  new asn1js__namespace.Choice({
24227
24283
  value: [
24228
24284
  new asn1js__namespace.Constructed({
@@ -24264,7 +24320,7 @@ var require_build3 = __commonJS({
24264
24320
  }));
24265
24321
  AsnError.assertSchema(asn1, this.className);
24266
24322
  this.contentType = asn1.result.contentType.valueBlock.toString();
24267
- this.contentEncryptionAlgorithm = new AlgorithmIdentifier2({
24323
+ this.contentEncryptionAlgorithm = new AlgorithmIdentifier3({
24268
24324
  schema: asn1.result.contentEncryptionAlgorithm
24269
24325
  });
24270
24326
  if (ENCRYPTED_CONTENT in asn1.result) {
@@ -24330,14 +24386,14 @@ var require_build3 = __commonJS({
24330
24386
  static defaultValues(memberName) {
24331
24387
  switch (memberName) {
24332
24388
  case HASH_ALGORITHM$4:
24333
- return new AlgorithmIdentifier2({
24389
+ return new AlgorithmIdentifier3({
24334
24390
  algorithmId: "1.3.14.3.2.26",
24335
24391
  algorithmParams: new asn1js__namespace.Null()
24336
24392
  });
24337
24393
  case MASK_GEN_ALGORITHM$1:
24338
- return new AlgorithmIdentifier2({
24394
+ return new AlgorithmIdentifier3({
24339
24395
  algorithmId: "1.2.840.113549.1.1.8",
24340
- algorithmParams: new AlgorithmIdentifier2({
24396
+ algorithmParams: new AlgorithmIdentifier3({
24341
24397
  algorithmId: "1.3.14.3.2.26",
24342
24398
  algorithmParams: new asn1js__namespace.Null()
24343
24399
  }).toSchema()
@@ -24361,7 +24417,7 @@ var require_build3 = __commonJS({
24361
24417
  tagNumber: 0
24362
24418
  },
24363
24419
  optional: true,
24364
- value: [AlgorithmIdentifier2.schema(names.hashAlgorithm || {})]
24420
+ value: [AlgorithmIdentifier3.schema(names.hashAlgorithm || {})]
24365
24421
  }),
24366
24422
  new asn1js__namespace.Constructed({
24367
24423
  idBlock: {
@@ -24369,7 +24425,7 @@ var require_build3 = __commonJS({
24369
24425
  tagNumber: 1
24370
24426
  },
24371
24427
  optional: true,
24372
- value: [AlgorithmIdentifier2.schema(names.maskGenAlgorithm || {})]
24428
+ value: [AlgorithmIdentifier3.schema(names.maskGenAlgorithm || {})]
24373
24429
  }),
24374
24430
  new asn1js__namespace.Constructed({
24375
24431
  idBlock: {
@@ -24410,9 +24466,9 @@ var require_build3 = __commonJS({
24410
24466
  }));
24411
24467
  AsnError.assertSchema(asn1, this.className);
24412
24468
  if (HASH_ALGORITHM$4 in asn1.result)
24413
- this.hashAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.hashAlgorithm });
24469
+ this.hashAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.hashAlgorithm });
24414
24470
  if (MASK_GEN_ALGORITHM$1 in asn1.result)
24415
- this.maskGenAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.maskGenAlgorithm });
24471
+ this.maskGenAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.maskGenAlgorithm });
24416
24472
  if (SALT_LENGTH in asn1.result)
24417
24473
  this.saltLength = asn1.result.saltLength.valueBlock.valueDec;
24418
24474
  if (TRAILER_FIELD in asn1.result)
@@ -24507,7 +24563,7 @@ var require_build3 = __commonJS({
24507
24563
  case KEY_LENGTH:
24508
24564
  return 0;
24509
24565
  case PRF:
24510
- return new AlgorithmIdentifier2({
24566
+ return new AlgorithmIdentifier3({
24511
24567
  algorithmId: "1.3.14.3.2.26",
24512
24568
  algorithmParams: new asn1js__namespace.Null()
24513
24569
  });
@@ -24523,7 +24579,7 @@ var require_build3 = __commonJS({
24523
24579
  new asn1js__namespace.Choice({
24524
24580
  value: [
24525
24581
  new asn1js__namespace.OctetString({ name: names.saltPrimitive || EMPTY_STRING }),
24526
- AlgorithmIdentifier2.schema(names.saltConstructed || {})
24582
+ AlgorithmIdentifier3.schema(names.saltConstructed || {})
24527
24583
  ]
24528
24584
  }),
24529
24585
  new asn1js__namespace.Integer({ name: names.iterationCount || EMPTY_STRING }),
@@ -24531,7 +24587,7 @@ var require_build3 = __commonJS({
24531
24587
  name: names.keyLength || EMPTY_STRING,
24532
24588
  optional: true
24533
24589
  }),
24534
- AlgorithmIdentifier2.schema(names.prf || {
24590
+ AlgorithmIdentifier3.schema(names.prf || {
24535
24591
  names: {
24536
24592
  optional: true
24537
24593
  }
@@ -24565,7 +24621,7 @@ var require_build3 = __commonJS({
24565
24621
  if (KEY_LENGTH in asn1.result)
24566
24622
  this.keyLength = asn1.result.keyLength.valueBlock.valueDec;
24567
24623
  if (PRF in asn1.result)
24568
- this.prf = new AlgorithmIdentifier2({ schema: asn1.result.prf });
24624
+ this.prf = new AlgorithmIdentifier3({ schema: asn1.result.prf });
24569
24625
  }
24570
24626
  toSchema() {
24571
24627
  const outputArray = [];
@@ -24615,9 +24671,9 @@ var require_build3 = __commonJS({
24615
24671
  static defaultValues(memberName) {
24616
24672
  switch (memberName) {
24617
24673
  case KEY_DERIVATION_FUNC:
24618
- return new AlgorithmIdentifier2();
24674
+ return new AlgorithmIdentifier3();
24619
24675
  case ENCRYPTION_SCHEME:
24620
- return new AlgorithmIdentifier2();
24676
+ return new AlgorithmIdentifier3();
24621
24677
  default:
24622
24678
  return super.defaultValues(memberName);
24623
24679
  }
@@ -24627,8 +24683,8 @@ var require_build3 = __commonJS({
24627
24683
  return new asn1js__namespace.Sequence({
24628
24684
  name: names.blockName || EMPTY_STRING,
24629
24685
  value: [
24630
- AlgorithmIdentifier2.schema(names.keyDerivationFunc || {}),
24631
- AlgorithmIdentifier2.schema(names.encryptionScheme || {})
24686
+ AlgorithmIdentifier3.schema(names.keyDerivationFunc || {}),
24687
+ AlgorithmIdentifier3.schema(names.encryptionScheme || {})
24632
24688
  ]
24633
24689
  });
24634
24690
  }
@@ -24649,8 +24705,8 @@ var require_build3 = __commonJS({
24649
24705
  }
24650
24706
  }));
24651
24707
  AsnError.assertSchema(asn1, this.className);
24652
- this.keyDerivationFunc = new AlgorithmIdentifier2({ schema: asn1.result.keyDerivationFunc });
24653
- this.encryptionScheme = new AlgorithmIdentifier2({ schema: asn1.result.encryptionScheme });
24708
+ this.keyDerivationFunc = new AlgorithmIdentifier3({ schema: asn1.result.keyDerivationFunc });
24709
+ this.encryptionScheme = new AlgorithmIdentifier3({ schema: asn1.result.encryptionScheme });
24654
24710
  }
24655
24711
  toSchema() {
24656
24712
  return new asn1js__namespace.Sequence({
@@ -24798,7 +24854,7 @@ var require_build3 = __commonJS({
24798
24854
  }
24799
24855
  return res;
24800
24856
  }
24801
- var CryptoEngine4 = class extends AbstractCryptoEngine {
24857
+ var CryptoEngine5 = class extends AbstractCryptoEngine {
24802
24858
  async importKey(format3, keyData, algorithm, extractable, keyUsages) {
24803
24859
  var _a4, _b, _c, _d, _e, _f;
24804
24860
  let jwk = {};
@@ -25985,7 +26041,7 @@ var require_build3 = __commonJS({
25985
26041
  const pbkdf2Params = new PBKDF2Params({
25986
26042
  salt: new asn1js__namespace.OctetString({ valueHex: saltBuffer }),
25987
26043
  iterationCount: parameters.iterationCount,
25988
- prf: new AlgorithmIdentifier2({
26044
+ prf: new AlgorithmIdentifier3({
25989
26045
  algorithmId: hmacOID,
25990
26046
  algorithmParams: new asn1js__namespace.Null()
25991
26047
  })
@@ -26005,18 +26061,18 @@ var require_build3 = __commonJS({
26005
26061
  iv: ivView
26006
26062
  }, derivedKey, contentView);
26007
26063
  const pbes2Parameters = new PBES2Params({
26008
- keyDerivationFunc: new AlgorithmIdentifier2({
26064
+ keyDerivationFunc: new AlgorithmIdentifier3({
26009
26065
  algorithmId: pbkdf2OID,
26010
26066
  algorithmParams: pbkdf2Params.toSchema()
26011
26067
  }),
26012
- encryptionScheme: new AlgorithmIdentifier2({
26068
+ encryptionScheme: new AlgorithmIdentifier3({
26013
26069
  algorithmId: contentEncryptionOID,
26014
26070
  algorithmParams: new asn1js__namespace.OctetString({ valueHex: ivBuffer })
26015
26071
  })
26016
26072
  });
26017
26073
  return new EncryptedContentInfo({
26018
26074
  contentType: parameters.contentType,
26019
- contentEncryptionAlgorithm: new AlgorithmIdentifier2({
26075
+ contentEncryptionAlgorithm: new AlgorithmIdentifier3({
26020
26076
  algorithmId: "1.2.840.113549.1.5.13",
26021
26077
  algorithmParams: pbes2Parameters.toSchema()
26022
26078
  }),
@@ -26139,7 +26195,7 @@ var require_build3 = __commonJS({
26139
26195
  }
26140
26196
  async getSignatureParameters(privateKey, hashAlgorithm = "SHA-1") {
26141
26197
  this.getOIDByAlgorithm({ name: hashAlgorithm }, true, "hashAlgorithm");
26142
- const signatureAlgorithm = new AlgorithmIdentifier2();
26198
+ const signatureAlgorithm = new AlgorithmIdentifier3();
26143
26199
  const parameters = this.getAlgorithmParameters(privateKey.algorithm.name, "sign");
26144
26200
  if (!Object.keys(parameters.algorithm).length) {
26145
26201
  throw new Error("Parameter 'algorithm' is empty");
@@ -26171,11 +26227,11 @@ var require_build3 = __commonJS({
26171
26227
  const paramsObject = {};
26172
26228
  if (algorithm.hash.name.toUpperCase() !== "SHA-1") {
26173
26229
  const hashAlgorithmOID = this.getOIDByAlgorithm({ name: algorithm.hash.name }, true, "hashAlgorithm");
26174
- paramsObject.hashAlgorithm = new AlgorithmIdentifier2({
26230
+ paramsObject.hashAlgorithm = new AlgorithmIdentifier3({
26175
26231
  algorithmId: hashAlgorithmOID,
26176
26232
  algorithmParams: new asn1js__namespace.Null()
26177
26233
  });
26178
- paramsObject.maskGenAlgorithm = new AlgorithmIdentifier2({
26234
+ paramsObject.maskGenAlgorithm = new AlgorithmIdentifier3({
26179
26235
  algorithmId: "1.2.840.113549.1.1.8",
26180
26236
  algorithmParams: paramsObject.hashAlgorithm.toSchema()
26181
26237
  });
@@ -26312,13 +26368,13 @@ var require_build3 = __commonJS({
26312
26368
  function getEngineGlobalKey() {
26313
26369
  return typeof process !== "undefined" && Number.isInteger(process.pid) ? process.pid : /* @__PURE__ */ Symbol.for("pkijs.engine");
26314
26370
  }
26315
- function setEngine4(name, ...args) {
26371
+ function setEngine5(name, ...args) {
26316
26372
  let crypto3 = null;
26317
26373
  if (args.length < 2) {
26318
26374
  if (args.length) {
26319
26375
  crypto3 = args[0];
26320
26376
  } else {
26321
- crypto3 = typeof self !== "undefined" && self.crypto ? new CryptoEngine4({ name: "browser", crypto: self.crypto }) : null;
26377
+ crypto3 = typeof self !== "undefined" && self.crypto ? new CryptoEngine5({ name: "browser", crypto: self.crypto }) : null;
26322
26378
  }
26323
26379
  } else {
26324
26380
  const cryptoArg = args[0];
@@ -26328,7 +26384,7 @@ var require_build3 = __commonJS({
26328
26384
  } else if (isCryptoEngine(cryptoArg)) {
26329
26385
  crypto3 = cryptoArg;
26330
26386
  } else if ("subtle" in cryptoArg && "getRandomValues" in cryptoArg) {
26331
- crypto3 = new CryptoEngine4({
26387
+ crypto3 = new CryptoEngine5({
26332
26388
  crypto: cryptoArg
26333
26389
  });
26334
26390
  }
@@ -26372,7 +26428,7 @@ var require_build3 = __commonJS({
26372
26428
  }
26373
26429
  return exports.engine;
26374
26430
  }
26375
- function getCrypto2(safety = false) {
26431
+ function getCrypto3(safety = false) {
26376
26432
  const _engine = getEngine();
26377
26433
  if (!_engine.crypto && safety) {
26378
26434
  throw new Error("Unable to create WebCrypto object");
@@ -26380,13 +26436,13 @@ var require_build3 = __commonJS({
26380
26436
  return _engine.crypto;
26381
26437
  }
26382
26438
  function getRandomValues(view) {
26383
- return getCrypto2(true).getRandomValues(view);
26439
+ return getCrypto3(true).getRandomValues(view);
26384
26440
  }
26385
26441
  function getOIDByAlgorithm(algorithm, safety, target) {
26386
- return getCrypto2(true).getOIDByAlgorithm(algorithm, safety, target);
26442
+ return getCrypto3(true).getOIDByAlgorithm(algorithm, safety, target);
26387
26443
  }
26388
26444
  function getAlgorithmParameters(algorithmName, operation) {
26389
- return getCrypto2(true).getAlgorithmParameters(algorithmName, operation);
26445
+ return getCrypto3(true).getAlgorithmParameters(algorithmName, operation);
26390
26446
  }
26391
26447
  function createCMSECDSASignature(signatureBuffer) {
26392
26448
  if (signatureBuffer.byteLength % 2 !== 0)
@@ -26415,10 +26471,10 @@ var require_build3 = __commonJS({
26415
26471
  return res.buffer;
26416
26472
  }
26417
26473
  function getAlgorithmByOID(oid, safety = false, target) {
26418
- return getCrypto2(true).getAlgorithmByOID(oid, safety, target);
26474
+ return getCrypto3(true).getAlgorithmByOID(oid, safety, target);
26419
26475
  }
26420
26476
  function getHashAlgorithm(signatureAlgorithm) {
26421
- return getCrypto2(true).getHashAlgorithm(signatureAlgorithm);
26477
+ return getCrypto3(true).getHashAlgorithm(signatureAlgorithm);
26422
26478
  }
26423
26479
  async function kdfWithCounter(hashFunction, zBuffer, Counter, SharedInfo, crypto3) {
26424
26480
  switch (hashFunction.toUpperCase()) {
@@ -26452,7 +26508,7 @@ var require_build3 = __commonJS({
26452
26508
  result
26453
26509
  };
26454
26510
  }
26455
- async function kdf(hashFunction, Zbuffer, keydatalen, SharedInfo, crypto3 = getCrypto2(true)) {
26511
+ async function kdf(hashFunction, Zbuffer, keydatalen, SharedInfo, crypto3 = getCrypto3(true)) {
26456
26512
  let hashLength;
26457
26513
  let maxCounter = 1;
26458
26514
  switch (hashFunction.toUpperCase()) {
@@ -26705,7 +26761,7 @@ var require_build3 = __commonJS({
26705
26761
  signature: pvutils__namespace.bufferToHexCodes(this.signature)
26706
26762
  };
26707
26763
  }
26708
- async verify(logs, data, dataType = 0, crypto3 = getCrypto2(true)) {
26764
+ async verify(logs, data, dataType = 0, crypto3 = getCrypto3(true)) {
26709
26765
  const logId = pvutils__namespace.toBase64(pvutils__namespace.arrayBufferToString(this.logID));
26710
26766
  let publicKeyBase64 = null;
26711
26767
  const stream = new bs__namespace.SeqStream();
@@ -26738,7 +26794,7 @@ var require_build3 = __commonJS({
26738
26794
  }
26739
26795
  };
26740
26796
  SignedCertificateTimestamp.CLASS_NAME = "SignedCertificateTimestamp";
26741
- async function verifySCTsForCertificate(certificate, issuerCertificate, logs, index2 = -1, crypto3 = getCrypto2(true)) {
26797
+ async function verifySCTsForCertificate(certificate, issuerCertificate, logs, index2 = -1, crypto3 = getCrypto3(true)) {
26742
26798
  let parsedValue = null;
26743
26799
  const stream = new bs__namespace.SeqStream();
26744
26800
  if (certificate.extensions) {
@@ -27248,7 +27304,7 @@ var require_build3 = __commonJS({
27248
27304
  case ISSUER$4:
27249
27305
  return new GeneralNames();
27250
27306
  case SIGNATURE$6:
27251
- return new AlgorithmIdentifier2();
27307
+ return new AlgorithmIdentifier3();
27252
27308
  case SERIAL_NUMBER$5:
27253
27309
  return new asn1js__namespace.Integer();
27254
27310
  case ATTR_CERT_VALIDITY_PERIOD$1:
@@ -27294,7 +27350,7 @@ var require_build3 = __commonJS({
27294
27350
  blockName: names.issuer || EMPTY_STRING
27295
27351
  }
27296
27352
  }),
27297
- AlgorithmIdentifier2.schema(names.signature || {}),
27353
+ AlgorithmIdentifier3.schema(names.signature || {}),
27298
27354
  new asn1js__namespace.Integer({ name: names.serialNumber || EMPTY_STRING }),
27299
27355
  AttCertValidityPeriod.schema(names.attrCertValidityPeriod || {}),
27300
27356
  new asn1js__namespace.Sequence({
@@ -27358,7 +27414,7 @@ var require_build3 = __commonJS({
27358
27414
  });
27359
27415
  }
27360
27416
  this.issuer = asn1.result.issuer;
27361
- this.signature = new AlgorithmIdentifier2({ schema: asn1.result.signature });
27417
+ this.signature = new AlgorithmIdentifier3({ schema: asn1.result.signature });
27362
27418
  this.serialNumber = asn1.result.serialNumber;
27363
27419
  this.attrCertValidityPeriod = new AttCertValidityPeriod({
27364
27420
  schema: asn1.result.attrCertValidityPeriod
@@ -27452,7 +27508,7 @@ var require_build3 = __commonJS({
27452
27508
  case ACINFO$1:
27453
27509
  return new AttributeCertificateInfoV1();
27454
27510
  case SIGNATURE_ALGORITHM$7:
27455
- return new AlgorithmIdentifier2();
27511
+ return new AlgorithmIdentifier3();
27456
27512
  case SIGNATURE_VALUE$4:
27457
27513
  return new asn1js__namespace.BitString();
27458
27514
  default:
@@ -27465,7 +27521,7 @@ var require_build3 = __commonJS({
27465
27521
  name: names.blockName || EMPTY_STRING,
27466
27522
  value: [
27467
27523
  AttributeCertificateInfoV1.schema(names.acinfo || {}),
27468
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {}),
27524
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {}),
27469
27525
  new asn1js__namespace.BitString({ name: names.signatureValue || EMPTY_STRING })
27470
27526
  ]
27471
27527
  });
@@ -27489,7 +27545,7 @@ var require_build3 = __commonJS({
27489
27545
  }));
27490
27546
  AsnError.assertSchema(asn1, this.className);
27491
27547
  this.acinfo = new AttributeCertificateInfoV1({ schema: asn1.result.acinfo });
27492
- this.signatureAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.signatureAlgorithm });
27548
+ this.signatureAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.signatureAlgorithm });
27493
27549
  this.signatureValue = asn1.result.signatureValue;
27494
27550
  }
27495
27551
  toSchema() {
@@ -27531,7 +27587,7 @@ var require_build3 = __commonJS({
27531
27587
  case OTHER_OBJECT_TYPE_ID:
27532
27588
  return new asn1js__namespace.ObjectIdentifier();
27533
27589
  case DIGEST_ALGORITHM$2:
27534
- return new AlgorithmIdentifier2();
27590
+ return new AlgorithmIdentifier3();
27535
27591
  case OBJECT_DIGEST:
27536
27592
  return new asn1js__namespace.BitString();
27537
27593
  default:
@@ -27548,7 +27604,7 @@ var require_build3 = __commonJS({
27548
27604
  optional: true,
27549
27605
  name: names.otherObjectTypeID || EMPTY_STRING
27550
27606
  }),
27551
- AlgorithmIdentifier2.schema(names.digestAlgorithm || {}),
27607
+ AlgorithmIdentifier3.schema(names.digestAlgorithm || {}),
27552
27608
  new asn1js__namespace.BitString({ name: names.objectDigest || EMPTY_STRING })
27553
27609
  ]
27554
27610
  });
@@ -27572,7 +27628,7 @@ var require_build3 = __commonJS({
27572
27628
  if (OTHER_OBJECT_TYPE_ID in asn1.result) {
27573
27629
  this.otherObjectTypeID = asn1.result.otherObjectTypeID;
27574
27630
  }
27575
- this.digestAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.digestAlgorithm });
27631
+ this.digestAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.digestAlgorithm });
27576
27632
  this.objectDigest = asn1.result.objectDigest;
27577
27633
  }
27578
27634
  toSchema() {
@@ -27922,7 +27978,7 @@ var require_build3 = __commonJS({
27922
27978
  case ISSUER$3:
27923
27979
  return {};
27924
27980
  case SIGNATURE$5:
27925
- return new AlgorithmIdentifier2();
27981
+ return new AlgorithmIdentifier3();
27926
27982
  case SERIAL_NUMBER$4:
27927
27983
  return new asn1js__namespace.Integer();
27928
27984
  case ATTR_CERT_VALIDITY_PERIOD:
@@ -27961,7 +28017,7 @@ var require_build3 = __commonJS({
27961
28017
  })
27962
28018
  ]
27963
28019
  }),
27964
- AlgorithmIdentifier2.schema(names.signature || {}),
28020
+ AlgorithmIdentifier3.schema(names.signature || {}),
27965
28021
  new asn1js__namespace.Integer({ name: names.serialNumber || EMPTY_STRING }),
27966
28022
  AttCertValidityPeriod.schema(names.attrCertValidityPeriod || {}),
27967
28023
  new asn1js__namespace.Sequence({
@@ -28026,7 +28082,7 @@ var require_build3 = __commonJS({
28026
28082
  default:
28027
28083
  throw new Error("Incorrect value for 'issuer' in AttributeCertificateInfoV2");
28028
28084
  }
28029
- this.signature = new AlgorithmIdentifier2({ schema: asn1.result.signature });
28085
+ this.signature = new AlgorithmIdentifier3({ schema: asn1.result.signature });
28030
28086
  this.serialNumber = asn1.result.serialNumber;
28031
28087
  this.attrCertValidityPeriod = new AttCertValidityPeriod({
28032
28088
  schema: asn1.result.attrCertValidityPeriod
@@ -28106,7 +28162,7 @@ var require_build3 = __commonJS({
28106
28162
  case ACINFO:
28107
28163
  return new AttributeCertificateInfoV2();
28108
28164
  case SIGNATURE_ALGORITHM$6:
28109
- return new AlgorithmIdentifier2();
28165
+ return new AlgorithmIdentifier3();
28110
28166
  case SIGNATURE_VALUE$3:
28111
28167
  return new asn1js__namespace.BitString();
28112
28168
  default:
@@ -28119,7 +28175,7 @@ var require_build3 = __commonJS({
28119
28175
  name: names.blockName || EMPTY_STRING,
28120
28176
  value: [
28121
28177
  AttributeCertificateInfoV2.schema(names.acinfo || {}),
28122
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {}),
28178
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {}),
28123
28179
  new asn1js__namespace.BitString({ name: names.signatureValue || EMPTY_STRING })
28124
28180
  ]
28125
28181
  });
@@ -28143,7 +28199,7 @@ var require_build3 = __commonJS({
28143
28199
  }));
28144
28200
  AsnError.assertSchema(asn1, this.className);
28145
28201
  this.acinfo = new AttributeCertificateInfoV2({ schema: asn1.result.acinfo });
28146
- this.signatureAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.signatureAlgorithm });
28202
+ this.signatureAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.signatureAlgorithm });
28147
28203
  this.signatureValue = asn1.result.signatureValue;
28148
28204
  }
28149
28205
  toSchema() {
@@ -28163,7 +28219,7 @@ var require_build3 = __commonJS({
28163
28219
  var CONTENT_TYPE = "contentType";
28164
28220
  var CONTENT = "content";
28165
28221
  var CLEAR_PROPS$S = [CONTENT_TYPE, CONTENT];
28166
- var ContentInfo4 = class _ContentInfo extends PkiObject {
28222
+ var ContentInfo6 = class _ContentInfo extends PkiObject {
28167
28223
  constructor(parameters = {}) {
28168
28224
  super();
28169
28225
  this.contentType = pvutils__namespace.getParametersValue(parameters, CONTENT_TYPE, _ContentInfo.defaultValues(CONTENT_TYPE));
@@ -28243,11 +28299,11 @@ var require_build3 = __commonJS({
28243
28299
  return object3;
28244
28300
  }
28245
28301
  };
28246
- ContentInfo4.CLASS_NAME = "ContentInfo";
28247
- ContentInfo4.DATA = id_ContentType_Data;
28248
- ContentInfo4.SIGNED_DATA = id_ContentType_SignedData;
28249
- ContentInfo4.ENVELOPED_DATA = id_ContentType_EnvelopedData;
28250
- ContentInfo4.ENCRYPTED_DATA = id_ContentType_EncryptedData;
28302
+ ContentInfo6.CLASS_NAME = "ContentInfo";
28303
+ ContentInfo6.DATA = id_ContentType_Data;
28304
+ ContentInfo6.SIGNED_DATA = id_ContentType_SignedData;
28305
+ ContentInfo6.ENVELOPED_DATA = id_ContentType_EnvelopedData;
28306
+ ContentInfo6.ENCRYPTED_DATA = id_ContentType_EncryptedData;
28251
28307
  var TYPE$1 = "type";
28252
28308
  var VALUE$4 = "value";
28253
28309
  var UTC_TIME_NAME = "utcTimeName";
@@ -28382,7 +28438,7 @@ var require_build3 = __commonJS({
28382
28438
  new asn1js__namespace.Integer({
28383
28439
  name: names.tbsCertificateSerialNumber || TBS_CERTIFICATE_SERIAL_NUMBER
28384
28440
  }),
28385
- AlgorithmIdentifier2.schema(names.signature || {
28441
+ AlgorithmIdentifier3.schema(names.signature || {
28386
28442
  names: {
28387
28443
  blockName: TBS_CERTIFICATE_SIGNATURE
28388
28444
  }
@@ -28452,7 +28508,7 @@ var require_build3 = __commonJS({
28452
28508
  ]
28453
28509
  });
28454
28510
  }
28455
- var Certificate4 = class _Certificate extends PkiObject {
28511
+ var Certificate6 = class _Certificate extends PkiObject {
28456
28512
  get tbs() {
28457
28513
  return pvtsutils__namespace.BufferSourceConverter.toArrayBuffer(this.tbsView);
28458
28514
  }
@@ -28494,7 +28550,7 @@ var require_build3 = __commonJS({
28494
28550
  case SERIAL_NUMBER$3:
28495
28551
  return new asn1js__namespace.Integer();
28496
28552
  case SIGNATURE$4:
28497
- return new AlgorithmIdentifier2();
28553
+ return new AlgorithmIdentifier3();
28498
28554
  case ISSUER$2:
28499
28555
  return new RelativeDistinguishedNames();
28500
28556
  case NOT_BEFORE:
@@ -28512,7 +28568,7 @@ var require_build3 = __commonJS({
28512
28568
  case EXTENSIONS$2:
28513
28569
  return [];
28514
28570
  case SIGNATURE_ALGORITHM$5:
28515
- return new AlgorithmIdentifier2();
28571
+ return new AlgorithmIdentifier3();
28516
28572
  case SIGNATURE_VALUE$2:
28517
28573
  return new asn1js__namespace.BitString();
28518
28574
  default:
@@ -28525,7 +28581,7 @@ var require_build3 = __commonJS({
28525
28581
  name: names.blockName || EMPTY_STRING,
28526
28582
  value: [
28527
28583
  tbsCertificate(names.tbsCertificate),
28528
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {
28584
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {
28529
28585
  names: {
28530
28586
  blockName: SIGNATURE_ALGORITHM$5
28531
28587
  }
@@ -28554,7 +28610,7 @@ var require_build3 = __commonJS({
28554
28610
  if (TBS_CERTIFICATE_VERSION in asn1.result)
28555
28611
  this.version = asn1.result[TBS_CERTIFICATE_VERSION].valueBlock.valueDec;
28556
28612
  this.serialNumber = asn1.result[TBS_CERTIFICATE_SERIAL_NUMBER];
28557
- this.signature = new AlgorithmIdentifier2({ schema: asn1.result[TBS_CERTIFICATE_SIGNATURE] });
28613
+ this.signature = new AlgorithmIdentifier3({ schema: asn1.result[TBS_CERTIFICATE_SIGNATURE] });
28558
28614
  this.issuer = new RelativeDistinguishedNames({ schema: asn1.result[TBS_CERTIFICATE_ISSUER] });
28559
28615
  this.notBefore = new Time({ schema: asn1.result[TBS_CERTIFICATE_NOT_BEFORE] });
28560
28616
  this.notAfter = new Time({ schema: asn1.result[TBS_CERTIFICATE_NOT_AFTER] });
@@ -28568,7 +28624,7 @@ var require_build3 = __commonJS({
28568
28624
  this.subjectUniqueID = asn1.result[TBS_CERTIFICATE_SUBJECT_UNIQUE_ID].valueBlock.valueHex;
28569
28625
  if (TBS_CERTIFICATE_EXTENSIONS in asn1.result)
28570
28626
  this.extensions = Array.from(asn1.result[TBS_CERTIFICATE_EXTENSIONS], (element) => new Extension({ schema: element }));
28571
- this.signatureAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.signatureAlgorithm });
28627
+ this.signatureAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.signatureAlgorithm });
28572
28628
  this.signatureValue = asn1.result.signatureValue;
28573
28629
  }
28574
28630
  encodeTBS() {
@@ -28675,13 +28731,13 @@ var require_build3 = __commonJS({
28675
28731
  }
28676
28732
  return res;
28677
28733
  }
28678
- async getPublicKey(parameters, crypto3 = getCrypto2(true)) {
28734
+ async getPublicKey(parameters, crypto3 = getCrypto3(true)) {
28679
28735
  return crypto3.getPublicKey(this.subjectPublicKeyInfo, this.signatureAlgorithm, parameters);
28680
28736
  }
28681
- async getKeyHash(hashAlgorithm = "SHA-1", crypto3 = getCrypto2(true)) {
28737
+ async getKeyHash(hashAlgorithm = "SHA-1", crypto3 = getCrypto3(true)) {
28682
28738
  return crypto3.digest({ name: hashAlgorithm }, this.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);
28683
28739
  }
28684
- async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto2(true)) {
28740
+ async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto3(true)) {
28685
28741
  if (!privateKey) {
28686
28742
  throw new Error("Need to provide a private key for signing");
28687
28743
  }
@@ -28693,7 +28749,7 @@ var require_build3 = __commonJS({
28693
28749
  const signature = await crypto3.signWithPrivateKey(this.tbsView, privateKey, parameters);
28694
28750
  this.signatureValue = new asn1js__namespace.BitString({ valueHex: signature });
28695
28751
  }
28696
- async verify(issuerCertificate, crypto3 = getCrypto2(true)) {
28752
+ async verify(issuerCertificate, crypto3 = getCrypto3(true)) {
28697
28753
  let subjectPublicKeyInfo;
28698
28754
  if (issuerCertificate) {
28699
28755
  subjectPublicKeyInfo = issuerCertificate.subjectPublicKeyInfo;
@@ -28706,7 +28762,7 @@ var require_build3 = __commonJS({
28706
28762
  return crypto3.verifyWithPublicKey(this.tbsView, this.signatureValue, subjectPublicKeyInfo, this.signatureAlgorithm);
28707
28763
  }
28708
28764
  };
28709
- Certificate4.CLASS_NAME = "Certificate";
28765
+ Certificate6.CLASS_NAME = "Certificate";
28710
28766
  function checkCA(cert, signerCert = null) {
28711
28767
  if (signerCert && cert.issuer.isEqual(signerCert.issuer) && cert.serialNumber.isEqual(signerCert.serialNumber)) {
28712
28768
  return null;
@@ -28799,7 +28855,7 @@ var require_build3 = __commonJS({
28799
28855
  case id_CertBag_X509Certificate:
28800
28856
  {
28801
28857
  try {
28802
- this.parsedValue = Certificate4.fromBER(certValueHex);
28858
+ this.parsedValue = Certificate6.fromBER(certValueHex);
28803
28859
  } catch {
28804
28860
  AttributeCertificateV2.fromBER(certValueHex);
28805
28861
  }
@@ -28966,7 +29022,7 @@ var require_build3 = __commonJS({
28966
29022
  name: names.tbsCertListVersion || TBS_CERT_LIST_VERSION,
28967
29023
  value: 2
28968
29024
  }),
28969
- AlgorithmIdentifier2.schema(names.signature || {
29025
+ AlgorithmIdentifier3.schema(names.signature || {
28970
29026
  names: {
28971
29027
  blockName: TBS_CERT_LIST_SIGNATURE
28972
29028
  }
@@ -29064,7 +29120,7 @@ var require_build3 = __commonJS({
29064
29120
  case VERSION$e:
29065
29121
  return 0;
29066
29122
  case SIGNATURE$3:
29067
- return new AlgorithmIdentifier2();
29123
+ return new AlgorithmIdentifier3();
29068
29124
  case ISSUER$1:
29069
29125
  return new RelativeDistinguishedNames();
29070
29126
  case THIS_UPDATE$1:
@@ -29076,7 +29132,7 @@ var require_build3 = __commonJS({
29076
29132
  case CRL_EXTENSIONS:
29077
29133
  return new Extensions();
29078
29134
  case SIGNATURE_ALGORITHM$4:
29079
- return new AlgorithmIdentifier2();
29135
+ return new AlgorithmIdentifier3();
29080
29136
  case SIGNATURE_VALUE$1:
29081
29137
  return new asn1js__namespace.BitString();
29082
29138
  default:
@@ -29089,7 +29145,7 @@ var require_build3 = __commonJS({
29089
29145
  name: names.blockName || "CertificateList",
29090
29146
  value: [
29091
29147
  tbsCertList(parameters),
29092
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {
29148
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {
29093
29149
  names: {
29094
29150
  blockName: SIGNATURE_ALGORITHM$4
29095
29151
  }
@@ -29106,7 +29162,7 @@ var require_build3 = __commonJS({
29106
29162
  if (TBS_CERT_LIST_VERSION in asn1.result) {
29107
29163
  this.version = asn1.result[TBS_CERT_LIST_VERSION].valueBlock.valueDec;
29108
29164
  }
29109
- this.signature = new AlgorithmIdentifier2({ schema: asn1.result[TBS_CERT_LIST_SIGNATURE] });
29165
+ this.signature = new AlgorithmIdentifier3({ schema: asn1.result[TBS_CERT_LIST_SIGNATURE] });
29110
29166
  this.issuer = new RelativeDistinguishedNames({ schema: asn1.result[TBS_CERT_LIST_ISSUER] });
29111
29167
  this.thisUpdate = new Time({ schema: asn1.result[TBS_CERT_LIST_THIS_UPDATE] });
29112
29168
  if (TBS_CERT_LIST_NEXT_UPDATE in asn1.result) {
@@ -29118,7 +29174,7 @@ var require_build3 = __commonJS({
29118
29174
  if (TBS_CERT_LIST_EXTENSIONS in asn1.result) {
29119
29175
  this.crlExtensions = new Extensions({ schema: asn1.result[TBS_CERT_LIST_EXTENSIONS] });
29120
29176
  }
29121
- this.signatureAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.signatureAlgorithm });
29177
+ this.signatureAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.signatureAlgorithm });
29122
29178
  this.signatureValue = asn1.result.signatureValue;
29123
29179
  }
29124
29180
  encodeTBS() {
@@ -29204,7 +29260,7 @@ var require_build3 = __commonJS({
29204
29260
  }
29205
29261
  return false;
29206
29262
  }
29207
- async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto2(true)) {
29263
+ async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto3(true)) {
29208
29264
  if (!privateKey) {
29209
29265
  throw new Error("Need to provide a private key for signing");
29210
29266
  }
@@ -29216,7 +29272,7 @@ var require_build3 = __commonJS({
29216
29272
  const signature = await crypto3.signWithPrivateKey(this.tbsView, privateKey, parameters);
29217
29273
  this.signatureValue = new asn1js__namespace.BitString({ valueHex: signature });
29218
29274
  }
29219
- async verify(parameters = {}, crypto3 = getCrypto2(true)) {
29275
+ async verify(parameters = {}, crypto3 = getCrypto3(true)) {
29220
29276
  let subjectPublicKeyInfo;
29221
29277
  if (parameters.issuerCertificate) {
29222
29278
  subjectPublicKeyInfo = parameters.issuerCertificate.subjectPublicKeyInfo;
@@ -29458,7 +29514,7 @@ var require_build3 = __commonJS({
29458
29514
  res.unprotectedAttrs = Array.from(this.unprotectedAttrs, (o) => o.toJSON());
29459
29515
  return res;
29460
29516
  }
29461
- async encrypt(parameters, crypto3 = getCrypto2(true)) {
29517
+ async encrypt(parameters, crypto3 = getCrypto3(true)) {
29462
29518
  ArgumentError.assert(parameters, "parameters", "object");
29463
29519
  const encryptParams = {
29464
29520
  ...parameters,
@@ -29466,7 +29522,7 @@ var require_build3 = __commonJS({
29466
29522
  };
29467
29523
  this.encryptedContentInfo = await crypto3.encryptEncryptedContentInfo(encryptParams);
29468
29524
  }
29469
- async decrypt(parameters, crypto3 = getCrypto2(true)) {
29525
+ async decrypt(parameters, crypto3 = getCrypto3(true)) {
29470
29526
  ArgumentError.assert(parameters, "parameters", "object");
29471
29527
  const decryptParams = {
29472
29528
  ...parameters,
@@ -29495,7 +29551,7 @@ var require_build3 = __commonJS({
29495
29551
  static defaultValues(memberName) {
29496
29552
  switch (memberName) {
29497
29553
  case ENCRYPTION_ALGORITHM:
29498
- return new AlgorithmIdentifier2();
29554
+ return new AlgorithmIdentifier3();
29499
29555
  case ENCRYPTED_DATA:
29500
29556
  return new asn1js__namespace.OctetString();
29501
29557
  case PARSED_VALUE$2:
@@ -29507,7 +29563,7 @@ var require_build3 = __commonJS({
29507
29563
  static compareWithDefault(memberName, memberValue) {
29508
29564
  switch (memberName) {
29509
29565
  case ENCRYPTION_ALGORITHM:
29510
- return AlgorithmIdentifier2.compareWithDefault("algorithmId", memberValue.algorithmId) && "algorithmParams" in memberValue === false;
29566
+ return AlgorithmIdentifier3.compareWithDefault("algorithmId", memberValue.algorithmId) && "algorithmParams" in memberValue === false;
29511
29567
  case ENCRYPTED_DATA:
29512
29568
  return memberValue.isEqual(_PKCS8ShroudedKeyBag.defaultValues(memberName));
29513
29569
  case PARSED_VALUE$2:
@@ -29521,7 +29577,7 @@ var require_build3 = __commonJS({
29521
29577
  return new asn1js__namespace.Sequence({
29522
29578
  name: names.blockName || EMPTY_STRING,
29523
29579
  value: [
29524
- AlgorithmIdentifier2.schema(names.encryptionAlgorithm || {
29580
+ AlgorithmIdentifier3.schema(names.encryptionAlgorithm || {
29525
29581
  names: {
29526
29582
  blockName: ENCRYPTION_ALGORITHM
29527
29583
  }
@@ -29553,7 +29609,7 @@ var require_build3 = __commonJS({
29553
29609
  }
29554
29610
  }));
29555
29611
  AsnError.assertSchema(asn1, this.className);
29556
- this.encryptionAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.encryptionAlgorithm });
29612
+ this.encryptionAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.encryptionAlgorithm });
29557
29613
  this.encryptedData = asn1.result.encryptedData;
29558
29614
  }
29559
29615
  toSchema() {
@@ -29567,7 +29623,7 @@ var require_build3 = __commonJS({
29567
29623
  encryptedData: this.encryptedData.toJSON()
29568
29624
  };
29569
29625
  }
29570
- async parseInternalValues(parameters, crypto3 = getCrypto2(true)) {
29626
+ async parseInternalValues(parameters, crypto3 = getCrypto3(true)) {
29571
29627
  const cmsEncrypted = new EncryptedData({
29572
29628
  encryptedContentInfo: new EncryptedContentInfo({
29573
29629
  contentEncryptionAlgorithm: this.encryptionAlgorithm,
@@ -29577,7 +29633,7 @@ var require_build3 = __commonJS({
29577
29633
  const decryptedData = await cmsEncrypted.decrypt(parameters, crypto3);
29578
29634
  this.parsedValue = PrivateKeyInfo.fromBER(decryptedData);
29579
29635
  }
29580
- async makeInternalValues(parameters, crypto3 = getCrypto2(true)) {
29636
+ async makeInternalValues(parameters, crypto3 = getCrypto3(true)) {
29581
29637
  if (!this.parsedValue) {
29582
29638
  throw new Error('Please initialize "parsedValue" first');
29583
29639
  }
@@ -29954,7 +30010,7 @@ var require_build3 = __commonJS({
29954
30010
  name: names.certificates || CERTIFICATES$1,
29955
30011
  value: new asn1js__namespace.Choice({
29956
30012
  value: [
29957
- Certificate4.schema(),
30013
+ Certificate6.schema(),
29958
30014
  new asn1js__namespace.Constructed({
29959
30015
  idBlock: {
29960
30016
  tagClass: 3,
@@ -29996,7 +30052,7 @@ var require_build3 = __commonJS({
29996
30052
  this.certificates = Array.from(asn1.result.certificates || [], (element) => {
29997
30053
  const initialTagNumber = element.idBlock.tagNumber;
29998
30054
  if (element.idBlock.tagClass === 1)
29999
- return new Certificate4({ schema: element });
30055
+ return new Certificate6({ schema: element });
30000
30056
  const elementSequence = new asn1js__namespace.Sequence({
30001
30057
  value: element.valueBlock.value
30002
30058
  });
@@ -30019,7 +30075,7 @@ var require_build3 = __commonJS({
30019
30075
  return new asn1js__namespace.Set({
30020
30076
  value: Array.from(this.certificates, (element) => {
30021
30077
  switch (true) {
30022
- case element instanceof Certificate4:
30078
+ case element instanceof Certificate6:
30023
30079
  return element.toSchema();
30024
30080
  case element instanceof AttributeCertificateV1:
30025
30081
  return new asn1js__namespace.Constructed({
@@ -30315,7 +30371,7 @@ var require_build3 = __commonJS({
30315
30371
  var ISSUER = "issuer";
30316
30372
  var SERIAL_NUMBER$2 = "serialNumber";
30317
30373
  var CLEAR_PROPS$C = [ISSUER, SERIAL_NUMBER$2];
30318
- var IssuerAndSerialNumber3 = class _IssuerAndSerialNumber extends PkiObject {
30374
+ var IssuerAndSerialNumber4 = class _IssuerAndSerialNumber extends PkiObject {
30319
30375
  constructor(parameters = {}) {
30320
30376
  super();
30321
30377
  this.issuer = pvutils__namespace.getParametersValue(parameters, ISSUER, _IssuerAndSerialNumber.defaultValues(ISSUER));
@@ -30372,7 +30428,7 @@ var require_build3 = __commonJS({
30372
30428
  };
30373
30429
  }
30374
30430
  };
30375
- IssuerAndSerialNumber3.CLASS_NAME = "IssuerAndSerialNumber";
30431
+ IssuerAndSerialNumber4.CLASS_NAME = "IssuerAndSerialNumber";
30376
30432
  var VARIANT$3 = "variant";
30377
30433
  var VALUE$3 = "value";
30378
30434
  var CLEAR_PROPS$B = ["blockName"];
@@ -30411,7 +30467,7 @@ var require_build3 = __commonJS({
30411
30467
  const names = pvutils__namespace.getParametersValue(parameters, "names", {});
30412
30468
  return new asn1js__namespace.Choice({
30413
30469
  value: [
30414
- IssuerAndSerialNumber3.schema({
30470
+ IssuerAndSerialNumber4.schema({
30415
30471
  names: {
30416
30472
  blockName: names.blockName || EMPTY_STRING
30417
30473
  }
@@ -30436,7 +30492,7 @@ var require_build3 = __commonJS({
30436
30492
  AsnError.assertSchema(asn1, this.className);
30437
30493
  if (asn1.result.blockName.idBlock.tagClass === 1) {
30438
30494
  this.variant = 1;
30439
- this.value = new IssuerAndSerialNumber3({ schema: asn1.result.blockName });
30495
+ this.value = new IssuerAndSerialNumber4({ schema: asn1.result.blockName });
30440
30496
  } else {
30441
30497
  this.variant = 2;
30442
30498
  this.value = new asn1js__namespace.OctetString({ valueHex: asn1.result.blockName.valueBlock.valueHex });
@@ -30445,7 +30501,7 @@ var require_build3 = __commonJS({
30445
30501
  toSchema() {
30446
30502
  switch (this.variant) {
30447
30503
  case 1:
30448
- if (!(this.value instanceof IssuerAndSerialNumber3)) {
30504
+ if (!(this.value instanceof IssuerAndSerialNumber4)) {
30449
30505
  throw new Error("Incorrect type of RecipientIdentifier.value. It should be IssuerAndSerialNumber.");
30450
30506
  }
30451
30507
  return this.value.toSchema();
@@ -30500,11 +30556,11 @@ var require_build3 = __commonJS({
30500
30556
  case RID$1:
30501
30557
  return {};
30502
30558
  case KEY_ENCRYPTION_ALGORITHM$3:
30503
- return new AlgorithmIdentifier2();
30559
+ return new AlgorithmIdentifier3();
30504
30560
  case ENCRYPTED_KEY$3:
30505
30561
  return new asn1js__namespace.OctetString();
30506
30562
  case RECIPIENT_CERTIFICATE$1:
30507
- return new Certificate4();
30563
+ return new Certificate6();
30508
30564
  default:
30509
30565
  return super.defaultValues(memberName);
30510
30566
  }
@@ -30531,7 +30587,7 @@ var require_build3 = __commonJS({
30531
30587
  value: [
30532
30588
  new asn1js__namespace.Integer({ name: names.version || EMPTY_STRING }),
30533
30589
  RecipientIdentifier.schema(names.rid || {}),
30534
- AlgorithmIdentifier2.schema(names.keyEncryptionAlgorithm || {}),
30590
+ AlgorithmIdentifier3.schema(names.keyEncryptionAlgorithm || {}),
30535
30591
  new asn1js__namespace.OctetString({ name: names.encryptedKey || EMPTY_STRING })
30536
30592
  ]
30537
30593
  });
@@ -30559,16 +30615,16 @@ var require_build3 = __commonJS({
30559
30615
  if (asn1.result.rid.idBlock.tagClass === 3) {
30560
30616
  this.rid = new asn1js__namespace.OctetString({ valueHex: asn1.result.rid.valueBlock.valueHex });
30561
30617
  } else {
30562
- this.rid = new IssuerAndSerialNumber3({ schema: asn1.result.rid });
30618
+ this.rid = new IssuerAndSerialNumber4({ schema: asn1.result.rid });
30563
30619
  }
30564
- this.keyEncryptionAlgorithm = new AlgorithmIdentifier2({
30620
+ this.keyEncryptionAlgorithm = new AlgorithmIdentifier3({
30565
30621
  schema: asn1.result.keyEncryptionAlgorithm
30566
30622
  });
30567
30623
  this.encryptedKey = asn1.result.encryptedKey;
30568
30624
  }
30569
30625
  toSchema() {
30570
30626
  const outputArray = [];
30571
- if (this.rid instanceof IssuerAndSerialNumber3) {
30627
+ if (this.rid instanceof IssuerAndSerialNumber4) {
30572
30628
  this.version = 0;
30573
30629
  outputArray.push(new asn1js__namespace.Integer({ value: this.version }));
30574
30630
  outputArray.push(this.rid.toSchema());
@@ -30614,7 +30670,7 @@ var require_build3 = __commonJS({
30614
30670
  static defaultValues(memberName) {
30615
30671
  switch (memberName) {
30616
30672
  case ALGORITHM:
30617
- return new AlgorithmIdentifier2();
30673
+ return new AlgorithmIdentifier3();
30618
30674
  case PUBLIC_KEY:
30619
30675
  return new asn1js__namespace.BitString();
30620
30676
  default:
@@ -30635,7 +30691,7 @@ var require_build3 = __commonJS({
30635
30691
  return new asn1js__namespace.Sequence({
30636
30692
  name: names.blockName || EMPTY_STRING,
30637
30693
  value: [
30638
- AlgorithmIdentifier2.schema(names.algorithm || {}),
30694
+ AlgorithmIdentifier3.schema(names.algorithm || {}),
30639
30695
  new asn1js__namespace.BitString({ name: names.publicKey || EMPTY_STRING })
30640
30696
  ]
30641
30697
  });
@@ -30653,7 +30709,7 @@ var require_build3 = __commonJS({
30653
30709
  }
30654
30710
  }));
30655
30711
  AsnError.assertSchema(asn1, this.className);
30656
- this.algorithm = new AlgorithmIdentifier2({ schema: asn1.result.algorithm });
30712
+ this.algorithm = new AlgorithmIdentifier3({ schema: asn1.result.algorithm });
30657
30713
  this.publicKey = asn1.result.publicKey;
30658
30714
  }
30659
30715
  toSchema() {
@@ -30707,7 +30763,7 @@ var require_build3 = __commonJS({
30707
30763
  const names = pvutils__namespace.getParametersValue(parameters, "names", {});
30708
30764
  return new asn1js__namespace.Choice({
30709
30765
  value: [
30710
- IssuerAndSerialNumber3.schema({
30766
+ IssuerAndSerialNumber4.schema({
30711
30767
  names: {
30712
30768
  blockName: names.blockName || EMPTY_STRING
30713
30769
  }
@@ -30740,7 +30796,7 @@ var require_build3 = __commonJS({
30740
30796
  AsnError.assertSchema(asn1, this.className);
30741
30797
  if (asn1.result.blockName.idBlock.tagClass === 1) {
30742
30798
  this.variant = 1;
30743
- this.value = new IssuerAndSerialNumber3({ schema: asn1.result.blockName });
30799
+ this.value = new IssuerAndSerialNumber4({ schema: asn1.result.blockName });
30744
30800
  } else {
30745
30801
  if (asn1.result.blockName.idBlock.tagNumber === 0) {
30746
30802
  asn1.result.blockName.idBlock.tagClass = 1;
@@ -31008,7 +31064,7 @@ var require_build3 = __commonJS({
31008
31064
  const names = pvutils__namespace.getParametersValue(parameters, "names", {});
31009
31065
  return new asn1js__namespace.Choice({
31010
31066
  value: [
31011
- IssuerAndSerialNumber3.schema(names.issuerAndSerialNumber || {
31067
+ IssuerAndSerialNumber4.schema(names.issuerAndSerialNumber || {
31012
31068
  names: {
31013
31069
  blockName: names.blockName || EMPTY_STRING
31014
31070
  }
@@ -31038,7 +31094,7 @@ var require_build3 = __commonJS({
31038
31094
  AsnError.assertSchema(asn1, this.className);
31039
31095
  if (asn1.result.blockName.idBlock.tagClass === 1) {
31040
31096
  this.variant = 1;
31041
- this.value = new IssuerAndSerialNumber3({ schema: asn1.result.blockName });
31097
+ this.value = new IssuerAndSerialNumber4({ schema: asn1.result.blockName });
31042
31098
  } else {
31043
31099
  this.variant = 2;
31044
31100
  this.value = new RecipientKeyIdentifier({
@@ -31240,11 +31296,11 @@ var require_build3 = __commonJS({
31240
31296
  case UKM:
31241
31297
  return new asn1js__namespace.OctetString();
31242
31298
  case KEY_ENCRYPTION_ALGORITHM$2:
31243
- return new AlgorithmIdentifier2();
31299
+ return new AlgorithmIdentifier3();
31244
31300
  case RECIPIENT_ENCRYPTED_KEY:
31245
31301
  return new RecipientEncryptedKeys();
31246
31302
  case RECIPIENT_CERTIFICATE:
31247
- return new Certificate4();
31303
+ return new Certificate6();
31248
31304
  case RECIPIENT_PUBLIC_KEY:
31249
31305
  return null;
31250
31306
  default:
@@ -31292,7 +31348,7 @@ var require_build3 = __commonJS({
31292
31348
  },
31293
31349
  value: [new asn1js__namespace.OctetString({ name: names.ukm || EMPTY_STRING })]
31294
31350
  }),
31295
- AlgorithmIdentifier2.schema(names.keyEncryptionAlgorithm || {}),
31351
+ AlgorithmIdentifier3.schema(names.keyEncryptionAlgorithm || {}),
31296
31352
  RecipientEncryptedKeys.schema(names.recipientEncryptedKeys || {})
31297
31353
  ]
31298
31354
  });
@@ -31325,7 +31381,7 @@ var require_build3 = __commonJS({
31325
31381
  this.originator = new OriginatorIdentifierOrKey({ schema: asn1.result.originator });
31326
31382
  if (UKM in asn1.result)
31327
31383
  this.ukm = asn1.result.ukm;
31328
- this.keyEncryptionAlgorithm = new AlgorithmIdentifier2({
31384
+ this.keyEncryptionAlgorithm = new AlgorithmIdentifier3({
31329
31385
  schema: asn1.result.keyEncryptionAlgorithm
31330
31386
  });
31331
31387
  this.recipientEncryptedKeys = new RecipientEncryptedKeys({
@@ -31500,7 +31556,7 @@ var require_build3 = __commonJS({
31500
31556
  case KEK_ID:
31501
31557
  return new KEKIdentifier();
31502
31558
  case KEY_ENCRYPTION_ALGORITHM$1:
31503
- return new AlgorithmIdentifier2();
31559
+ return new AlgorithmIdentifier3();
31504
31560
  case ENCRYPTED_KEY$1:
31505
31561
  return new asn1js__namespace.OctetString();
31506
31562
  case PER_DEFINED_KEK:
@@ -31532,7 +31588,7 @@ var require_build3 = __commonJS({
31532
31588
  value: [
31533
31589
  new asn1js__namespace.Integer({ name: names.version || EMPTY_STRING }),
31534
31590
  KEKIdentifier.schema(names.kekid || {}),
31535
- AlgorithmIdentifier2.schema(names.keyEncryptionAlgorithm || {}),
31591
+ AlgorithmIdentifier3.schema(names.keyEncryptionAlgorithm || {}),
31536
31592
  new asn1js__namespace.OctetString({ name: names.encryptedKey || EMPTY_STRING })
31537
31593
  ]
31538
31594
  });
@@ -31558,7 +31614,7 @@ var require_build3 = __commonJS({
31558
31614
  AsnError.assertSchema(asn1, this.className);
31559
31615
  this.version = asn1.result.version.valueBlock.valueDec;
31560
31616
  this.kekid = new KEKIdentifier({ schema: asn1.result.kekid });
31561
- this.keyEncryptionAlgorithm = new AlgorithmIdentifier2({
31617
+ this.keyEncryptionAlgorithm = new AlgorithmIdentifier3({
31562
31618
  schema: asn1.result.keyEncryptionAlgorithm
31563
31619
  });
31564
31620
  this.encryptedKey = asn1.result.encryptedKey;
@@ -31608,9 +31664,9 @@ var require_build3 = __commonJS({
31608
31664
  case VERSION$9:
31609
31665
  return -1;
31610
31666
  case KEY_DERIVATION_ALGORITHM:
31611
- return new AlgorithmIdentifier2();
31667
+ return new AlgorithmIdentifier3();
31612
31668
  case KEY_ENCRYPTION_ALGORITHM:
31613
- return new AlgorithmIdentifier2();
31669
+ return new AlgorithmIdentifier3();
31614
31670
  case ENCRYPTED_KEY:
31615
31671
  return new asn1js__namespace.OctetString();
31616
31672
  case PASSWORD:
@@ -31647,9 +31703,9 @@ var require_build3 = __commonJS({
31647
31703
  tagClass: 3,
31648
31704
  tagNumber: 0
31649
31705
  },
31650
- value: AlgorithmIdentifier2.schema().valueBlock.value
31706
+ value: AlgorithmIdentifier3.schema().valueBlock.value
31651
31707
  }),
31652
- AlgorithmIdentifier2.schema(names.keyEncryptionAlgorithm || {}),
31708
+ AlgorithmIdentifier3.schema(names.keyEncryptionAlgorithm || {}),
31653
31709
  new asn1js__namespace.OctetString({ name: names.encryptedKey || EMPTY_STRING })
31654
31710
  ]
31655
31711
  });
@@ -31671,13 +31727,13 @@ var require_build3 = __commonJS({
31671
31727
  AsnError.assertSchema(asn1, this.className);
31672
31728
  this.version = asn1.result.version.valueBlock.valueDec;
31673
31729
  if (KEY_DERIVATION_ALGORITHM in asn1.result) {
31674
- this.keyDerivationAlgorithm = new AlgorithmIdentifier2({
31730
+ this.keyDerivationAlgorithm = new AlgorithmIdentifier3({
31675
31731
  schema: new asn1js__namespace.Sequence({
31676
31732
  value: asn1.result.keyDerivationAlgorithm.valueBlock.value
31677
31733
  })
31678
31734
  });
31679
31735
  }
31680
- this.keyEncryptionAlgorithm = new AlgorithmIdentifier2({
31736
+ this.keyEncryptionAlgorithm = new AlgorithmIdentifier3({
31681
31737
  schema: asn1.result.keyEncryptionAlgorithm
31682
31738
  });
31683
31739
  this.encryptedKey = asn1.result.encryptedKey;
@@ -31942,20 +31998,20 @@ var require_build3 = __commonJS({
31942
31998
  static defaultValues(memberName) {
31943
31999
  switch (memberName) {
31944
32000
  case HASH_ALGORITHM$2:
31945
- return new AlgorithmIdentifier2({
32001
+ return new AlgorithmIdentifier3({
31946
32002
  algorithmId: "1.3.14.3.2.26",
31947
32003
  algorithmParams: new asn1js__namespace.Null()
31948
32004
  });
31949
32005
  case MASK_GEN_ALGORITHM:
31950
- return new AlgorithmIdentifier2({
32006
+ return new AlgorithmIdentifier3({
31951
32007
  algorithmId: "1.2.840.113549.1.1.8",
31952
- algorithmParams: new AlgorithmIdentifier2({
32008
+ algorithmParams: new AlgorithmIdentifier3({
31953
32009
  algorithmId: "1.3.14.3.2.26",
31954
32010
  algorithmParams: new asn1js__namespace.Null()
31955
32011
  }).toSchema()
31956
32012
  });
31957
32013
  case P_SOURCE_ALGORITHM:
31958
- return new AlgorithmIdentifier2({
32014
+ return new AlgorithmIdentifier3({
31959
32015
  algorithmId: "1.2.840.113549.1.1.9",
31960
32016
  algorithmParams: new asn1js__namespace.OctetString({
31961
32017
  valueHex: new Uint8Array([
@@ -31997,7 +32053,7 @@ var require_build3 = __commonJS({
31997
32053
  tagNumber: 0
31998
32054
  },
31999
32055
  optional: true,
32000
- value: [AlgorithmIdentifier2.schema(names.hashAlgorithm || {})]
32056
+ value: [AlgorithmIdentifier3.schema(names.hashAlgorithm || {})]
32001
32057
  }),
32002
32058
  new asn1js__namespace.Constructed({
32003
32059
  idBlock: {
@@ -32005,7 +32061,7 @@ var require_build3 = __commonJS({
32005
32061
  tagNumber: 1
32006
32062
  },
32007
32063
  optional: true,
32008
- value: [AlgorithmIdentifier2.schema(names.maskGenAlgorithm || {})]
32064
+ value: [AlgorithmIdentifier3.schema(names.maskGenAlgorithm || {})]
32009
32065
  }),
32010
32066
  new asn1js__namespace.Constructed({
32011
32067
  idBlock: {
@@ -32013,7 +32069,7 @@ var require_build3 = __commonJS({
32013
32069
  tagNumber: 2
32014
32070
  },
32015
32071
  optional: true,
32016
- value: [AlgorithmIdentifier2.schema(names.pSourceAlgorithm || {})]
32072
+ value: [AlgorithmIdentifier3.schema(names.pSourceAlgorithm || {})]
32017
32073
  })
32018
32074
  ]
32019
32075
  });
@@ -32041,11 +32097,11 @@ var require_build3 = __commonJS({
32041
32097
  }));
32042
32098
  AsnError.assertSchema(asn1, this.className);
32043
32099
  if (HASH_ALGORITHM$2 in asn1.result)
32044
- this.hashAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.hashAlgorithm });
32100
+ this.hashAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.hashAlgorithm });
32045
32101
  if (MASK_GEN_ALGORITHM in asn1.result)
32046
- this.maskGenAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.maskGenAlgorithm });
32102
+ this.maskGenAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.maskGenAlgorithm });
32047
32103
  if (P_SOURCE_ALGORITHM in asn1.result)
32048
- this.pSourceAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.pSourceAlgorithm });
32104
+ this.pSourceAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.pSourceAlgorithm });
32049
32105
  }
32050
32106
  toSchema() {
32051
32107
  const outputArray = [];
@@ -32114,7 +32170,7 @@ var require_build3 = __commonJS({
32114
32170
  static defaultValues(memberName) {
32115
32171
  switch (memberName) {
32116
32172
  case KEY_INFO:
32117
- return new AlgorithmIdentifier2();
32173
+ return new AlgorithmIdentifier3();
32118
32174
  case ENTITY_U_INFO:
32119
32175
  return new asn1js__namespace.OctetString();
32120
32176
  case SUPP_PUB_INFO:
@@ -32138,7 +32194,7 @@ var require_build3 = __commonJS({
32138
32194
  return new asn1js__namespace.Sequence({
32139
32195
  name: names.blockName || EMPTY_STRING,
32140
32196
  value: [
32141
- AlgorithmIdentifier2.schema(names.keyInfo || {}),
32197
+ AlgorithmIdentifier3.schema(names.keyInfo || {}),
32142
32198
  new asn1js__namespace.Constructed({
32143
32199
  name: names.entityUInfo || EMPTY_STRING,
32144
32200
  idBlock: {
@@ -32173,7 +32229,7 @@ var require_build3 = __commonJS({
32173
32229
  }
32174
32230
  }));
32175
32231
  AsnError.assertSchema(asn1, this.className);
32176
- this.keyInfo = new AlgorithmIdentifier2({ schema: asn1.result.keyInfo });
32232
+ this.keyInfo = new AlgorithmIdentifier3({ schema: asn1.result.keyInfo });
32177
32233
  if (ENTITY_U_INFO in asn1.result)
32178
32234
  this.entityUInfo = asn1.result.entityUInfo.valueBlock.value[0];
32179
32235
  this.suppPubInfo = asn1.result.suppPubInfo.valueBlock.value[0];
@@ -32398,7 +32454,7 @@ var require_build3 = __commonJS({
32398
32454
  res.unprotectedAttrs = Array.from(this.unprotectedAttrs, (o) => o.toJSON());
32399
32455
  return res;
32400
32456
  }
32401
- addRecipientByCertificate(certificate, parameters, variant, crypto3 = getCrypto2(true)) {
32457
+ addRecipientByCertificate(certificate, parameters, variant, crypto3 = getCrypto3(true)) {
32402
32458
  const encryptionParameters = Object.assign({ useOAEP: true, oaepHashAlgorithm: "SHA-512" }, defaultEncryptionParams, parameters || {});
32403
32459
  if (certificate.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.113549") !== -1)
32404
32460
  variant = 1;
@@ -32420,13 +32476,13 @@ var require_build3 = __commonJS({
32420
32476
  const hashOID = crypto3.getOIDByAlgorithm({
32421
32477
  name: encryptionParameters.oaepHashAlgorithm
32422
32478
  }, true, "RSAES-OAEP-params");
32423
- const hashAlgorithm = new AlgorithmIdentifier2({
32479
+ const hashAlgorithm = new AlgorithmIdentifier3({
32424
32480
  algorithmId: hashOID,
32425
32481
  algorithmParams: new asn1js__namespace.Null()
32426
32482
  });
32427
32483
  const rsaOAEPParams = new RSAESOAEPParams({
32428
32484
  hashAlgorithm,
32429
- maskGenAlgorithm: new AlgorithmIdentifier2({
32485
+ maskGenAlgorithm: new AlgorithmIdentifier3({
32430
32486
  algorithmId: "1.2.840.113549.1.1.8",
32431
32487
  algorithmParams: hashAlgorithm.toSchema()
32432
32488
  })
@@ -32442,11 +32498,11 @@ var require_build3 = __commonJS({
32442
32498
  }
32443
32499
  const keyInfo = new KeyTransRecipientInfo({
32444
32500
  version: 0,
32445
- rid: new IssuerAndSerialNumber3({
32501
+ rid: new IssuerAndSerialNumber4({
32446
32502
  issuer: certificate.issuer,
32447
32503
  serialNumber: certificate.serialNumber
32448
32504
  }),
32449
- keyEncryptionAlgorithm: new AlgorithmIdentifier2({
32505
+ keyEncryptionAlgorithm: new AlgorithmIdentifier3({
32450
32506
  algorithmId,
32451
32507
  algorithmParams
32452
32508
  }),
@@ -32462,7 +32518,7 @@ var require_build3 = __commonJS({
32462
32518
  {
32463
32519
  const recipientIdentifier = new KeyAgreeRecipientIdentifier({
32464
32520
  variant: 1,
32465
- value: new IssuerAndSerialNumber3({
32521
+ value: new IssuerAndSerialNumber4({
32466
32522
  issuer: certificate.issuer,
32467
32523
  serialNumber: certificate.serialNumber
32468
32524
  })
@@ -32475,7 +32531,7 @@ var require_build3 = __commonJS({
32475
32531
  }
32476
32532
  return true;
32477
32533
  }
32478
- addRecipientByPreDefinedData(preDefinedData, parameters = {}, variant, crypto3 = getCrypto2(true)) {
32534
+ addRecipientByPreDefinedData(preDefinedData, parameters = {}, variant, crypto3 = getCrypto3(true)) {
32479
32535
  ArgumentError.assert(preDefinedData, "preDefinedData", "ArrayBuffer");
32480
32536
  if (!preDefinedData.byteLength) {
32481
32537
  throw new Error("Pre-defined data could have zero length");
@@ -32508,7 +32564,7 @@ var require_build3 = __commonJS({
32508
32564
  kekid: new KEKIdentifier({
32509
32565
  keyIdentifier: new asn1js__namespace.OctetString({ valueHex: parameters.keyIdentifier })
32510
32566
  }),
32511
- keyEncryptionAlgorithm: new AlgorithmIdentifier2({
32567
+ keyEncryptionAlgorithm: new AlgorithmIdentifier3({
32512
32568
  algorithmId: kekOID,
32513
32569
  algorithmParams: parameters.keyEncryptionAlgorithmParams
32514
32570
  }),
@@ -32535,7 +32591,7 @@ var require_build3 = __commonJS({
32535
32591
  const pbkdf2Params = new PBKDF2Params({
32536
32592
  salt: new asn1js__namespace.OctetString({ valueHex: saltBuffer }),
32537
32593
  iterationCount: parameters.iterationCount,
32538
- prf: new AlgorithmIdentifier2({
32594
+ prf: new AlgorithmIdentifier3({
32539
32595
  algorithmId: hmacOID,
32540
32596
  algorithmParams: new asn1js__namespace.Null()
32541
32597
  })
@@ -32543,11 +32599,11 @@ var require_build3 = __commonJS({
32543
32599
  const kekOID = crypto3.getOIDByAlgorithm(parameters.keyEncryptionAlgorithm, true, "keyEncryptionAlgorithm");
32544
32600
  const keyInfo = new PasswordRecipientinfo({
32545
32601
  version: 0,
32546
- keyDerivationAlgorithm: new AlgorithmIdentifier2({
32602
+ keyDerivationAlgorithm: new AlgorithmIdentifier3({
32547
32603
  algorithmId: pbkdf2OID,
32548
32604
  algorithmParams: pbkdf2Params.toSchema()
32549
32605
  }),
32550
- keyEncryptionAlgorithm: new AlgorithmIdentifier2({
32606
+ keyEncryptionAlgorithm: new AlgorithmIdentifier3({
32551
32607
  algorithmId: kekOID,
32552
32608
  algorithmParams: parameters.keyEncryptionAlgorithmParams
32553
32609
  }),
@@ -32563,7 +32619,7 @@ var require_build3 = __commonJS({
32563
32619
  throw new Error(`Unknown value for "variant": ${variant}`);
32564
32620
  }
32565
32621
  }
32566
- addRecipientByKeyIdentifier(key2, keyId, parameters, crypto3 = getCrypto2(true)) {
32622
+ addRecipientByKeyIdentifier(key2, keyId, parameters, crypto3 = getCrypto3(true)) {
32567
32623
  const encryptionParameters = Object.assign({}, defaultEncryptionParams, parameters || {});
32568
32624
  const recipientIdentifier = new KeyAgreeRecipientIdentifier({
32569
32625
  variant: 2,
@@ -32573,7 +32629,7 @@ var require_build3 = __commonJS({
32573
32629
  });
32574
32630
  this._addKeyAgreeRecipientInfo(recipientIdentifier, encryptionParameters, { recipientPublicKey: key2 }, crypto3);
32575
32631
  }
32576
- _addKeyAgreeRecipientInfo(recipientIdentifier, encryptionParameters, extraRecipientInfoParams, crypto3 = getCrypto2(true)) {
32632
+ _addKeyAgreeRecipientInfo(recipientIdentifier, encryptionParameters, extraRecipientInfoParams, crypto3 = getCrypto3(true)) {
32577
32633
  const encryptedKey = new RecipientEncryptedKey({
32578
32634
  rid: recipientIdentifier
32579
32635
  });
@@ -32581,7 +32637,7 @@ var require_build3 = __commonJS({
32581
32637
  name: "AES-KW",
32582
32638
  length: encryptionParameters.kekEncryptionLength
32583
32639
  }, true, "keyEncryptionAlgorithm");
32584
- const aesKW = new AlgorithmIdentifier2({
32640
+ const aesKW = new AlgorithmIdentifier3({
32585
32641
  algorithmId: aesKWoid
32586
32642
  });
32587
32643
  const ecdhOID = crypto3.getOIDByAlgorithm({
@@ -32594,7 +32650,7 @@ var require_build3 = __commonJS({
32594
32650
  const recipientInfoParams = {
32595
32651
  version: 3,
32596
32652
  ukm: new asn1js__namespace.OctetString({ valueHex: ukmBuffer }),
32597
- keyEncryptionAlgorithm: new AlgorithmIdentifier2({
32653
+ keyEncryptionAlgorithm: new AlgorithmIdentifier3({
32598
32654
  algorithmId: ecdhOID,
32599
32655
  algorithmParams: aesKW.toSchema()
32600
32656
  }),
@@ -32608,7 +32664,7 @@ var require_build3 = __commonJS({
32608
32664
  value: keyInfo
32609
32665
  }));
32610
32666
  }
32611
- async encrypt(contentEncryptionAlgorithm, contentToEncrypt, crypto3 = getCrypto2(true)) {
32667
+ async encrypt(contentEncryptionAlgorithm, contentToEncrypt, crypto3 = getCrypto3(true)) {
32612
32668
  const ivBuffer = new ArrayBuffer(16);
32613
32669
  const ivView = new Uint8Array(ivBuffer);
32614
32670
  crypto3.getRandomValues(ivView);
@@ -32624,7 +32680,7 @@ var require_build3 = __commonJS({
32624
32680
  this.encryptedContentInfo = new EncryptedContentInfo({
32625
32681
  disableSplit: this.policy.disableSplit,
32626
32682
  contentType: "1.2.840.113549.1.7.1",
32627
- contentEncryptionAlgorithm: new AlgorithmIdentifier2({
32683
+ contentEncryptionAlgorithm: new AlgorithmIdentifier3({
32628
32684
  algorithmId: contentEncryptionOID,
32629
32685
  algorithmParams: new asn1js__namespace.OctetString({ valueHex: ivBuffer })
32630
32686
  }),
@@ -32674,7 +32730,7 @@ var require_build3 = __commonJS({
32674
32730
  name: "ECDH",
32675
32731
  public: recipientPublicKey
32676
32732
  }, ecdhKeys.privateKey, recipientCurveLength);
32677
- const aesKWAlgorithm = new AlgorithmIdentifier2({
32733
+ const aesKWAlgorithm = new AlgorithmIdentifier3({
32678
32734
  schema: recipientInfo.keyEncryptionAlgorithm.algorithmParams
32679
32735
  });
32680
32736
  const kwAlgorithm = crypto3.getAlgorithmByOID(aesKWAlgorithm.algorithmId, true, "aesKWAlgorithm");
@@ -32686,7 +32742,7 @@ var require_build3 = __commonJS({
32686
32742
  kwLength >>= 8;
32687
32743
  }
32688
32744
  const eccInfo = new ECCCMSSharedInfo({
32689
- keyInfo: new AlgorithmIdentifier2({
32745
+ keyInfo: new AlgorithmIdentifier3({
32690
32746
  algorithmId: aesKWAlgorithm.algorithmId
32691
32747
  }),
32692
32748
  entityUInfo: recipientInfo.ukm,
@@ -32795,7 +32851,7 @@ var require_build3 = __commonJS({
32795
32851
  }
32796
32852
  return res;
32797
32853
  }
32798
- async decrypt(recipientIndex, parameters, crypto3 = getCrypto2(true)) {
32854
+ async decrypt(recipientIndex, parameters, crypto3 = getCrypto3(true)) {
32799
32855
  const decryptionParameters = parameters || {};
32800
32856
  if (recipientIndex + 1 > this.recipientInfos.length) {
32801
32857
  throw new Error(`Maximum value for "index" is: ${this.recipientInfos.length - 1}`);
@@ -32867,7 +32923,7 @@ var require_build3 = __commonJS({
32867
32923
  }, ecdhPrivateKey, recipientCurveLength);
32868
32924
  async function applyKDF(includeAlgorithmParams) {
32869
32925
  includeAlgorithmParams = includeAlgorithmParams || false;
32870
- const aesKWAlgorithm = new AlgorithmIdentifier2({
32926
+ const aesKWAlgorithm = new AlgorithmIdentifier3({
32871
32927
  schema: recipientInfo.keyEncryptionAlgorithm.algorithmParams
32872
32928
  });
32873
32929
  const kwAlgorithm = crypto3.getAlgorithmByOID(aesKWAlgorithm.algorithmId, true, "kwAlgorithm");
@@ -32885,7 +32941,7 @@ var require_build3 = __commonJS({
32885
32941
  keyInfoAlgorithm.algorithmParams = new asn1js__namespace.Null();
32886
32942
  }
32887
32943
  const eccInfo = new ECCCMSSharedInfo({
32888
- keyInfo: new AlgorithmIdentifier2(keyInfoAlgorithm),
32944
+ keyInfo: new AlgorithmIdentifier3(keyInfoAlgorithm),
32889
32945
  entityUInfo: recipientInfo.ukm,
32890
32946
  suppPubInfo: new asn1js__namespace.OctetString({ valueHex: kwLengthBuffer })
32891
32947
  });
@@ -33066,7 +33122,7 @@ var require_build3 = __commonJS({
33066
33122
  value: [
33067
33123
  new asn1js__namespace.Repeated({
33068
33124
  name: names.contentInfos || EMPTY_STRING,
33069
- value: ContentInfo4.schema()
33125
+ value: ContentInfo6.schema()
33070
33126
  })
33071
33127
  ]
33072
33128
  });
@@ -33079,7 +33135,7 @@ var require_build3 = __commonJS({
33079
33135
  }
33080
33136
  }));
33081
33137
  AsnError.assertSchema(asn1, this.className);
33082
- this.safeContents = Array.from(asn1.result.contentInfos, (element) => new ContentInfo4({ schema: element }));
33138
+ this.safeContents = Array.from(asn1.result.contentInfos, (element) => new ContentInfo6({ schema: element }));
33083
33139
  }
33084
33140
  toSchema() {
33085
33141
  return new asn1js__namespace.Sequence({
@@ -33091,7 +33147,7 @@ var require_build3 = __commonJS({
33091
33147
  safeContents: Array.from(this.safeContents, (o) => o.toJSON())
33092
33148
  };
33093
33149
  }
33094
- async parseInternalValues(parameters, crypto3 = getCrypto2(true)) {
33150
+ async parseInternalValues(parameters, crypto3 = getCrypto3(true)) {
33095
33151
  ParameterError.assert(parameters, SAFE_CONTENTS);
33096
33152
  ArgumentError.assert(parameters.safeContents, SAFE_CONTENTS, "Array");
33097
33153
  if (parameters.safeContents.length !== this.safeContents.length) {
@@ -33150,7 +33206,7 @@ var require_build3 = __commonJS({
33150
33206
  }
33151
33207
  }
33152
33208
  }
33153
- async makeInternalValues(parameters, crypto3 = getCrypto2(true)) {
33209
+ async makeInternalValues(parameters, crypto3 = getCrypto3(true)) {
33154
33210
  if (!this.parsedValue) {
33155
33211
  throw new Error('Please run "parseValues" first or add "parsedValue" manually');
33156
33212
  }
@@ -33170,7 +33226,7 @@ var require_build3 = __commonJS({
33170
33226
  case 0:
33171
33227
  {
33172
33228
  const contentBuffer = content.value.toSchema().toBER(false);
33173
- this.safeContents.push(new ContentInfo4({
33229
+ this.safeContents.push(new ContentInfo6({
33174
33230
  contentType: "1.2.840.113549.1.7.1",
33175
33231
  content: new asn1js__namespace.OctetString({ valueHex: contentBuffer })
33176
33232
  }));
@@ -33182,7 +33238,7 @@ var require_build3 = __commonJS({
33182
33238
  const currentParameters = parameters.safeContents[index2];
33183
33239
  currentParameters.contentToEncrypt = content.value.toSchema().toBER(false);
33184
33240
  await cmsEncrypted.encrypt(currentParameters, crypto3);
33185
- this.safeContents.push(new ContentInfo4({
33241
+ this.safeContents.push(new ContentInfo6({
33186
33242
  contentType: "1.2.840.113549.1.7.6",
33187
33243
  content: cmsEncrypted.toSchema()
33188
33244
  }));
@@ -33212,7 +33268,7 @@ var require_build3 = __commonJS({
33212
33268
  const encryptionAlgorithm = safeContent.encryptionAlgorithm;
33213
33269
  cmsEnveloped.addRecipientByCertificate(safeContent.encryptingCertificate, {}, void 0, crypto3);
33214
33270
  await cmsEnveloped.encrypt(encryptionAlgorithm, contentToEncrypt, crypto3);
33215
- this.safeContents.push(new ContentInfo4({
33271
+ this.safeContents.push(new ContentInfo6({
33216
33272
  contentType: "1.2.840.113549.1.7.3",
33217
33273
  content: cmsEnveloped.toSchema()
33218
33274
  }));
@@ -33232,7 +33288,7 @@ var require_build3 = __commonJS({
33232
33288
  var SERIAL_NUMBER$1 = "serialNumber";
33233
33289
  var CLEAR_PROPS$j = [HASH_ALGORITHM$1, ISSUER_NAME_HASH, ISSUER_KEY_HASH, SERIAL_NUMBER$1];
33234
33290
  var CertID = class _CertID extends PkiObject {
33235
- static async create(certificate, parameters, crypto3 = getCrypto2(true)) {
33291
+ static async create(certificate, parameters, crypto3 = getCrypto3(true)) {
33236
33292
  const certID = new _CertID();
33237
33293
  await certID.createForCertificate(certificate, parameters, crypto3);
33238
33294
  return certID;
@@ -33250,7 +33306,7 @@ var require_build3 = __commonJS({
33250
33306
  static defaultValues(memberName) {
33251
33307
  switch (memberName) {
33252
33308
  case HASH_ALGORITHM$1:
33253
- return new AlgorithmIdentifier2();
33309
+ return new AlgorithmIdentifier3();
33254
33310
  case ISSUER_NAME_HASH:
33255
33311
  case ISSUER_KEY_HASH:
33256
33312
  return new asn1js__namespace.OctetString();
@@ -33277,7 +33333,7 @@ var require_build3 = __commonJS({
33277
33333
  return new asn1js__namespace.Sequence({
33278
33334
  name: names.blockName || EMPTY_STRING,
33279
33335
  value: [
33280
- AlgorithmIdentifier2.schema(names.hashAlgorithmObject || {
33336
+ AlgorithmIdentifier3.schema(names.hashAlgorithmObject || {
33281
33337
  names: {
33282
33338
  blockName: names.hashAlgorithm || EMPTY_STRING
33283
33339
  }
@@ -33299,7 +33355,7 @@ var require_build3 = __commonJS({
33299
33355
  }
33300
33356
  }));
33301
33357
  AsnError.assertSchema(asn1, this.className);
33302
- this.hashAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.hashAlgorithm });
33358
+ this.hashAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.hashAlgorithm });
33303
33359
  this.issuerNameHash = asn1.result.issuerNameHash;
33304
33360
  this.issuerKeyHash = asn1.result.issuerKeyHash;
33305
33361
  this.serialNumber = asn1.result.serialNumber;
@@ -33337,10 +33393,10 @@ var require_build3 = __commonJS({
33337
33393
  }
33338
33394
  return true;
33339
33395
  }
33340
- async createForCertificate(certificate, parameters, crypto3 = getCrypto2(true)) {
33396
+ async createForCertificate(certificate, parameters, crypto3 = getCrypto3(true)) {
33341
33397
  ParameterError.assert(parameters, HASH_ALGORITHM$1, "issuerCertificate");
33342
33398
  const hashOID = crypto3.getOIDByAlgorithm({ name: parameters.hashAlgorithm }, true, "hashAlgorithm");
33343
- this.hashAlgorithm = new AlgorithmIdentifier2({
33399
+ this.hashAlgorithm = new AlgorithmIdentifier3({
33344
33400
  algorithmId: hashOID,
33345
33401
  algorithmParams: new asn1js__namespace.Null()
33346
33402
  });
@@ -33813,7 +33869,7 @@ var require_build3 = __commonJS({
33813
33869
  }
33814
33870
  return false;
33815
33871
  }
33816
- var CertificateChainValidationEngine2 = class _CertificateChainValidationEngine {
33872
+ var CertificateChainValidationEngine3 = class _CertificateChainValidationEngine {
33817
33873
  constructor(parameters = {}) {
33818
33874
  this.trustedCerts = pvutils__namespace.getParametersValue(parameters, TRUSTED_CERTS, this.defaultValues(TRUSTED_CERTS));
33819
33875
  this.certs = pvutils__namespace.getParametersValue(parameters, CERTS$2, this.defaultValues(CERTS$2));
@@ -33842,7 +33898,7 @@ var require_build3 = __commonJS({
33842
33898
  }
33843
33899
  return "Unknown";
33844
33900
  }
33845
- async defaultFindIssuer(certificate, validationEngine, crypto3 = getCrypto2(true)) {
33901
+ async defaultFindIssuer(certificate, validationEngine, crypto3 = getCrypto3(true)) {
33846
33902
  const result = [];
33847
33903
  let keyIdentifier = null;
33848
33904
  let authorityCertIssuer = null;
@@ -33941,7 +33997,7 @@ var require_build3 = __commonJS({
33941
33997
  throw new Error(`Invalid member name for CertificateChainValidationEngine class: ${memberName}`);
33942
33998
  }
33943
33999
  }
33944
- async sort(passedWhenNotRevValues = false, crypto3 = getCrypto2(true)) {
34000
+ async sort(passedWhenNotRevValues = false, crypto3 = getCrypto3(true)) {
33945
34001
  const localCerts = [];
33946
34002
  const buildPath = async (certificate, crypto4) => {
33947
34003
  const result2 = [];
@@ -34293,7 +34349,7 @@ var require_build3 = __commonJS({
34293
34349
  throw result;
34294
34350
  return certificatePath;
34295
34351
  }
34296
- async verify(parameters = {}, crypto3 = getCrypto2(true)) {
34352
+ async verify(parameters = {}, crypto3 = getCrypto3(true)) {
34297
34353
  function compareDNSName(name, constraint) {
34298
34354
  const namePrepared = stringPrep(name);
34299
34355
  const constraintPrepared = stringPrep(constraint);
@@ -34941,7 +34997,7 @@ var require_build3 = __commonJS({
34941
34997
  case TBS_RESPONSE_DATA:
34942
34998
  return new ResponseData();
34943
34999
  case SIGNATURE_ALGORITHM$3:
34944
- return new AlgorithmIdentifier2();
35000
+ return new AlgorithmIdentifier3();
34945
35001
  case SIGNATURE$2:
34946
35002
  return new asn1js__namespace.BitString();
34947
35003
  case CERTS$1:
@@ -34978,7 +35034,7 @@ var require_build3 = __commonJS({
34978
35034
  blockName: BASIC_OCSP_RESPONSE_TBS_RESPONSE_DATA
34979
35035
  }
34980
35036
  }),
34981
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {
35037
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {
34982
35038
  names: {
34983
35039
  blockName: BASIC_OCSP_RESPONSE_SIGNATURE_ALGORITHM
34984
35040
  }
@@ -34995,7 +35051,7 @@ var require_build3 = __commonJS({
34995
35051
  value: [
34996
35052
  new asn1js__namespace.Repeated({
34997
35053
  name: BASIC_OCSP_RESPONSE_CERTS,
34998
- value: Certificate4.schema(names.certs || {})
35054
+ value: Certificate6.schema(names.certs || {})
34999
35055
  })
35000
35056
  ]
35001
35057
  })
@@ -35011,12 +35067,12 @@ var require_build3 = __commonJS({
35011
35067
  this.tbsResponseData = new ResponseData({
35012
35068
  schema: asn1.result[BASIC_OCSP_RESPONSE_TBS_RESPONSE_DATA]
35013
35069
  });
35014
- this.signatureAlgorithm = new AlgorithmIdentifier2({
35070
+ this.signatureAlgorithm = new AlgorithmIdentifier3({
35015
35071
  schema: asn1.result[BASIC_OCSP_RESPONSE_SIGNATURE_ALGORITHM]
35016
35072
  });
35017
35073
  this.signature = asn1.result[BASIC_OCSP_RESPONSE_SIGNATURE];
35018
35074
  if (BASIC_OCSP_RESPONSE_CERTS in asn1.result) {
35019
- this.certs = Array.from(asn1.result[BASIC_OCSP_RESPONSE_CERTS], (element) => new Certificate4({ schema: element }));
35075
+ this.certs = Array.from(asn1.result[BASIC_OCSP_RESPONSE_CERTS], (element) => new Certificate6({ schema: element }));
35020
35076
  }
35021
35077
  }
35022
35078
  toSchema() {
@@ -35052,7 +35108,7 @@ var require_build3 = __commonJS({
35052
35108
  }
35053
35109
  return res;
35054
35110
  }
35055
- async getCertificateStatus(certificate, issuerCertificate, crypto3 = getCrypto2(true)) {
35111
+ async getCertificateStatus(certificate, issuerCertificate, crypto3 = getCrypto3(true)) {
35056
35112
  const result = {
35057
35113
  isForCertificate: false,
35058
35114
  status: 2
@@ -35102,7 +35158,7 @@ var require_build3 = __commonJS({
35102
35158
  }
35103
35159
  return result;
35104
35160
  }
35105
- async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto2(true)) {
35161
+ async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto3(true)) {
35106
35162
  if (!privateKey) {
35107
35163
  throw new Error("Need to provide a private key for signing");
35108
35164
  }
@@ -35116,7 +35172,7 @@ var require_build3 = __commonJS({
35116
35172
  const signature = await crypto3.signWithPrivateKey(this.tbsResponseData.tbsView, privateKey, { algorithm });
35117
35173
  this.signature = new asn1js__namespace.BitString({ valueHex: signature });
35118
35174
  }
35119
- async verify(params = {}, crypto3 = getCrypto2(true)) {
35175
+ async verify(params = {}, crypto3 = getCrypto3(true)) {
35120
35176
  if (!this.certs || this.certs.length === 0) {
35121
35177
  throw new Error("No certificates attached to the BasicOCSPResponse");
35122
35178
  }
@@ -35198,7 +35254,7 @@ var require_build3 = __commonJS({
35198
35254
  const certDer = cert.toSchema(true).toBER(false);
35199
35255
  return certs.some((c) => pvtsutils__namespace.BufferSourceConverter.isEqual(c.toSchema(true).toBER(false), certDer));
35200
35256
  }
35201
- static async collectResponderCandidates(certs, responderID, crypto3 = getCrypto2(true)) {
35257
+ static async collectResponderCandidates(certs, responderID, crypto3 = getCrypto3(true)) {
35202
35258
  var _a4;
35203
35259
  const indices = [];
35204
35260
  if (responderID instanceof RelativeDistinguishedNames) {
@@ -35223,10 +35279,10 @@ var require_build3 = __commonJS({
35223
35279
  }
35224
35280
  return indices;
35225
35281
  }
35226
- async verifyResponseSignature(candidateCert, crypto3 = getCrypto2(true)) {
35282
+ async verifyResponseSignature(candidateCert, crypto3 = getCrypto3(true)) {
35227
35283
  return crypto3.verifyWithPublicKey(this.tbsResponseData.tbsView, this.signature, candidateCert.subjectPublicKeyInfo, this.signatureAlgorithm);
35228
35284
  }
35229
- static async validateSignerChain(signerCert, embeddedCerts, issuerCerts, trustedCerts, crypto3 = getCrypto2(true)) {
35285
+ static async validateSignerChain(signerCert, embeddedCerts, issuerCerts, trustedCerts, crypto3 = getCrypto3(true)) {
35230
35286
  const additionalCerts = [];
35231
35287
  const addIfCa = (cert) => {
35232
35288
  const caCert = checkCA(cert, signerCert);
@@ -35241,7 +35297,7 @@ var require_build3 = __commonJS({
35241
35297
  addIfCa(cert);
35242
35298
  }
35243
35299
  additionalCerts.push(signerCert);
35244
- const engine = new CertificateChainValidationEngine2({
35300
+ const engine = new CertificateChainValidationEngine3({
35245
35301
  certs: additionalCerts,
35246
35302
  trustedCerts
35247
35303
  });
@@ -35251,7 +35307,7 @@ var require_build3 = __commonJS({
35251
35307
  }
35252
35308
  return result.certificatePath.slice(1);
35253
35309
  }
35254
- static async findIssuersForCertID(certID, issuerCandidates, crypto3 = getCrypto2(true)) {
35310
+ static async findIssuersForCertID(certID, issuerCandidates, crypto3 = getCrypto3(true)) {
35255
35311
  const responseHashAlg = crypto3.getAlgorithmByOID(certID.hashAlgorithm.algorithmId, false);
35256
35312
  if (!responseHashAlg || !("name" in responseHashAlg)) {
35257
35313
  return [];
@@ -35287,7 +35343,7 @@ var require_build3 = __commonJS({
35287
35343
  }
35288
35344
  return matched;
35289
35345
  }
35290
- static async certificateMatchesIssuerID(certificate, certID, crypto3 = getCrypto2(true)) {
35346
+ static async certificateMatchesIssuerID(certificate, certID, crypto3 = getCrypto3(true)) {
35291
35347
  const responseHashAlg = crypto3.getAlgorithmByOID(certID.hashAlgorithm.algorithmId, false);
35292
35348
  if (!responseHashAlg || !("name" in responseHashAlg)) {
35293
35349
  return false;
@@ -35305,7 +35361,7 @@ var require_build3 = __commonJS({
35305
35361
  return false;
35306
35362
  }
35307
35363
  }
35308
- static async isAuthorizedResponderForCertID(signerCert, certID, issuerCandidates, trustedResponders, crypto3 = getCrypto2(true)) {
35364
+ static async isAuthorizedResponderForCertID(signerCert, certID, issuerCandidates, trustedResponders, crypto3 = getCrypto3(true)) {
35309
35365
  if (trustedResponders.length > 0 && _BasicOCSPResponse.containsCertificateByDer(trustedResponders, signerCert)) {
35310
35366
  return true;
35311
35367
  }
@@ -35466,7 +35522,7 @@ var require_build3 = __commonJS({
35466
35522
  case ATTRIBUTES$1:
35467
35523
  return [];
35468
35524
  case SIGNATURE_ALGORITHM$2:
35469
- return new AlgorithmIdentifier2();
35525
+ return new AlgorithmIdentifier3();
35470
35526
  case SIGNATURE_VALUE:
35471
35527
  return new asn1js__namespace.BitString();
35472
35528
  default:
@@ -35497,7 +35553,7 @@ var require_build3 = __commonJS({
35497
35553
  if (CSR_INFO_ATTRS in asn1.result) {
35498
35554
  this.attributes = Array.from(asn1.result[CSR_INFO_ATTRS], (element) => new Attribute2({ schema: element }));
35499
35555
  }
35500
- this.signatureAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.signatureAlgorithm });
35556
+ this.signatureAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.signatureAlgorithm });
35501
35557
  this.signatureValue = asn1.result.signatureValue;
35502
35558
  }
35503
35559
  encodeTBS() {
@@ -35549,7 +35605,7 @@ var require_build3 = __commonJS({
35549
35605
  }
35550
35606
  return object3;
35551
35607
  }
35552
- async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto2(true)) {
35608
+ async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto3(true)) {
35553
35609
  if (!privateKey) {
35554
35610
  throw new Error("Need to provide a private key for signing");
35555
35611
  }
@@ -35560,10 +35616,10 @@ var require_build3 = __commonJS({
35560
35616
  const signature = await crypto3.signWithPrivateKey(this.tbsView, privateKey, parameters);
35561
35617
  this.signatureValue = new asn1js__namespace.BitString({ valueHex: signature });
35562
35618
  }
35563
- async verify(crypto3 = getCrypto2(true)) {
35619
+ async verify(crypto3 = getCrypto3(true)) {
35564
35620
  return crypto3.verifyWithPublicKey(this.tbsView, this.signatureValue, this.subjectPublicKeyInfo, this.signatureAlgorithm);
35565
35621
  }
35566
- async getPublicKey(parameters, crypto3 = getCrypto2(true)) {
35622
+ async getPublicKey(parameters, crypto3 = getCrypto3(true)) {
35567
35623
  return crypto3.getPublicKey(this.subjectPublicKeyInfo, this.signatureAlgorithm, parameters);
35568
35624
  }
35569
35625
  };
@@ -35583,7 +35639,7 @@ var require_build3 = __commonJS({
35583
35639
  static defaultValues(memberName) {
35584
35640
  switch (memberName) {
35585
35641
  case DIGEST_ALGORITHM$1:
35586
- return new AlgorithmIdentifier2();
35642
+ return new AlgorithmIdentifier3();
35587
35643
  case DIGEST:
35588
35644
  return new asn1js__namespace.OctetString();
35589
35645
  default:
@@ -35593,7 +35649,7 @@ var require_build3 = __commonJS({
35593
35649
  static compareWithDefault(memberName, memberValue) {
35594
35650
  switch (memberName) {
35595
35651
  case DIGEST_ALGORITHM$1:
35596
- return AlgorithmIdentifier2.compareWithDefault("algorithmId", memberValue.algorithmId) && "algorithmParams" in memberValue === false;
35652
+ return AlgorithmIdentifier3.compareWithDefault("algorithmId", memberValue.algorithmId) && "algorithmParams" in memberValue === false;
35597
35653
  case DIGEST:
35598
35654
  return memberValue.isEqual(_DigestInfo.defaultValues(memberName));
35599
35655
  default:
@@ -35605,7 +35661,7 @@ var require_build3 = __commonJS({
35605
35661
  return new asn1js__namespace.Sequence({
35606
35662
  name: names.blockName || EMPTY_STRING,
35607
35663
  value: [
35608
- AlgorithmIdentifier2.schema(names.digestAlgorithm || {
35664
+ AlgorithmIdentifier3.schema(names.digestAlgorithm || {
35609
35665
  names: {
35610
35666
  blockName: DIGEST_ALGORITHM$1
35611
35667
  }
@@ -35627,7 +35683,7 @@ var require_build3 = __commonJS({
35627
35683
  }
35628
35684
  }));
35629
35685
  AsnError.assertSchema(asn1, this.className);
35630
- this.digestAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.digestAlgorithm });
35686
+ this.digestAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.digestAlgorithm });
35631
35687
  this.digest = asn1.result.digest;
35632
35688
  }
35633
35689
  toSchema() {
@@ -35872,12 +35928,12 @@ var require_build3 = __commonJS({
35872
35928
  var HASH_ALGORITHM = "hashAlgorithm";
35873
35929
  var HASHED_MESSAGE = "hashedMessage";
35874
35930
  var CLEAR_PROPS$b = [HASH_ALGORITHM, HASHED_MESSAGE];
35875
- var MessageImprint = class _MessageImprint extends PkiObject {
35876
- static async create(hashAlgorithm, message, crypto3 = getCrypto2(true)) {
35931
+ var MessageImprint2 = class _MessageImprint extends PkiObject {
35932
+ static async create(hashAlgorithm, message, crypto3 = getCrypto3(true)) {
35877
35933
  const hashAlgorithmOID = crypto3.getOIDByAlgorithm({ name: hashAlgorithm }, true, "hashAlgorithm");
35878
35934
  const hashedMessage = await crypto3.digest(hashAlgorithm, message);
35879
35935
  const res = new _MessageImprint({
35880
- hashAlgorithm: new AlgorithmIdentifier2({
35936
+ hashAlgorithm: new AlgorithmIdentifier3({
35881
35937
  algorithmId: hashAlgorithmOID,
35882
35938
  algorithmParams: new asn1js__namespace.Null()
35883
35939
  }),
@@ -35896,7 +35952,7 @@ var require_build3 = __commonJS({
35896
35952
  static defaultValues(memberName) {
35897
35953
  switch (memberName) {
35898
35954
  case HASH_ALGORITHM:
35899
- return new AlgorithmIdentifier2();
35955
+ return new AlgorithmIdentifier3();
35900
35956
  case HASHED_MESSAGE:
35901
35957
  return new asn1js__namespace.OctetString();
35902
35958
  default:
@@ -35918,7 +35974,7 @@ var require_build3 = __commonJS({
35918
35974
  return new asn1js__namespace.Sequence({
35919
35975
  name: names.blockName || EMPTY_STRING,
35920
35976
  value: [
35921
- AlgorithmIdentifier2.schema(names.hashAlgorithm || {}),
35977
+ AlgorithmIdentifier3.schema(names.hashAlgorithm || {}),
35922
35978
  new asn1js__namespace.OctetString({ name: names.hashedMessage || EMPTY_STRING })
35923
35979
  ]
35924
35980
  });
@@ -35936,7 +35992,7 @@ var require_build3 = __commonJS({
35936
35992
  }
35937
35993
  }));
35938
35994
  AsnError.assertSchema(asn1, this.className);
35939
- this.hashAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.hashAlgorithm });
35995
+ this.hashAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.hashAlgorithm });
35940
35996
  this.hashedMessage = asn1.result.hashedMessage;
35941
35997
  }
35942
35998
  toSchema() {
@@ -35951,7 +36007,7 @@ var require_build3 = __commonJS({
35951
36007
  };
35952
36008
  }
35953
36009
  };
35954
- MessageImprint.CLASS_NAME = "MessageImprint";
36010
+ MessageImprint2.CLASS_NAME = "MessageImprint";
35955
36011
  var REQ_CERT = "reqCert";
35956
36012
  var SINGLE_REQUEST_EXTENSIONS = "singleRequestExtensions";
35957
36013
  var CLEAR_PROPS$a = [REQ_CERT, SINGLE_REQUEST_EXTENSIONS];
@@ -36286,7 +36342,7 @@ var require_build3 = __commonJS({
36286
36342
  static defaultValues(memberName) {
36287
36343
  switch (memberName) {
36288
36344
  case SIGNATURE_ALGORITHM$1:
36289
- return new AlgorithmIdentifier2();
36345
+ return new AlgorithmIdentifier3();
36290
36346
  case SIGNATURE$1:
36291
36347
  return new asn1js__namespace.BitString();
36292
36348
  case CERTS:
@@ -36312,7 +36368,7 @@ var require_build3 = __commonJS({
36312
36368
  return new asn1js__namespace.Sequence({
36313
36369
  name: names.blockName || EMPTY_STRING,
36314
36370
  value: [
36315
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {}),
36371
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {}),
36316
36372
  new asn1js__namespace.BitString({ name: names.signature || EMPTY_STRING }),
36317
36373
  new asn1js__namespace.Constructed({
36318
36374
  optional: true,
@@ -36325,7 +36381,7 @@ var require_build3 = __commonJS({
36325
36381
  value: [
36326
36382
  new asn1js__namespace.Repeated({
36327
36383
  name: names.certs || EMPTY_STRING,
36328
- value: Certificate4.schema({})
36384
+ value: Certificate6.schema({})
36329
36385
  })
36330
36386
  ]
36331
36387
  })
@@ -36348,10 +36404,10 @@ var require_build3 = __commonJS({
36348
36404
  }
36349
36405
  }));
36350
36406
  AsnError.assertSchema(asn1, this.className);
36351
- this.signatureAlgorithm = new AlgorithmIdentifier2({ schema: asn1.result.signatureAlgorithm });
36407
+ this.signatureAlgorithm = new AlgorithmIdentifier3({ schema: asn1.result.signatureAlgorithm });
36352
36408
  this.signature = asn1.result.signature;
36353
36409
  if (CERTS in asn1.result)
36354
- this.certs = Array.from(asn1.result.certs, (element) => new Certificate4({ schema: element }));
36410
+ this.certs = Array.from(asn1.result.certs, (element) => new Certificate6({ schema: element }));
36355
36411
  }
36356
36412
  toSchema() {
36357
36413
  const outputArray = [];
@@ -36481,14 +36537,14 @@ var require_build3 = __commonJS({
36481
36537
  }
36482
36538
  return res;
36483
36539
  }
36484
- async createForCertificate(certificate, parameters, crypto3 = getCrypto2(true)) {
36540
+ async createForCertificate(certificate, parameters, crypto3 = getCrypto3(true)) {
36485
36541
  const certID = new CertID();
36486
36542
  await certID.createForCertificate(certificate, parameters, crypto3);
36487
36543
  this.tbsRequest.requestList.push(new Request2({
36488
36544
  reqCert: certID
36489
36545
  }));
36490
36546
  }
36491
- async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto2(true)) {
36547
+ async sign(privateKey, hashAlgorithm = "SHA-1", crypto3 = getCrypto3(true)) {
36492
36548
  ParameterError.assertEmpty(privateKey, "privateKey", "OCSPRequest.sign method");
36493
36549
  if (!this.optionalSignature) {
36494
36550
  throw new Error('Need to create "optionalSignature" field before signing');
@@ -36660,7 +36716,7 @@ var require_build3 = __commonJS({
36660
36716
  }
36661
36717
  return res;
36662
36718
  }
36663
- async getCertificateStatus(certificate, issuerCertificate, crypto3 = getCrypto2(true)) {
36719
+ async getCertificateStatus(certificate, issuerCertificate, crypto3 = getCrypto3(true)) {
36664
36720
  let basicResponse;
36665
36721
  const result = {
36666
36722
  isForCertificate: false,
@@ -36679,7 +36735,7 @@ var require_build3 = __commonJS({
36679
36735
  }
36680
36736
  return basicResponse.getCertificateStatus(certificate, issuerCertificate, crypto3);
36681
36737
  }
36682
- async sign(privateKey, hashAlgorithm, crypto3 = getCrypto2(true)) {
36738
+ async sign(privateKey, hashAlgorithm, crypto3 = getCrypto3(true)) {
36683
36739
  var _a4;
36684
36740
  if (this.responseBytes && this.responseBytes.responseType === id_PKIX_OCSP_Basic) {
36685
36741
  const basicResponse = BasicOCSPResponse.fromBER(this.responseBytes.response.valueBlock.valueHexView);
@@ -36687,7 +36743,7 @@ var require_build3 = __commonJS({
36687
36743
  }
36688
36744
  throw new Error(`Unknown ResponseBytes type: ${((_a4 = this.responseBytes) === null || _a4 === void 0 ? void 0 : _a4.responseType) || "Unknown"}`);
36689
36745
  }
36690
- async verify(issuerCertificate = null, crypto3 = getCrypto2(true)) {
36746
+ async verify(issuerCertificate = null, crypto3 = getCrypto3(true)) {
36691
36747
  var _a4;
36692
36748
  if (RESPONSE_BYTES in this === false)
36693
36749
  throw new Error("Empty ResponseBytes field");
@@ -36852,11 +36908,11 @@ var require_build3 = __commonJS({
36852
36908
  case SID:
36853
36909
  return new asn1js__namespace.Any();
36854
36910
  case DIGEST_ALGORITHM:
36855
- return new AlgorithmIdentifier2();
36911
+ return new AlgorithmIdentifier3();
36856
36912
  case SIGNED_ATTRS:
36857
36913
  return new SignedAndUnsignedAttributes2({ type: 0 });
36858
36914
  case SIGNATURE_ALGORITHM:
36859
- return new AlgorithmIdentifier2();
36915
+ return new AlgorithmIdentifier3();
36860
36916
  case SIGNATURE:
36861
36917
  return new asn1js__namespace.OctetString();
36862
36918
  case UNSIGNED_ATTRS:
@@ -36872,13 +36928,13 @@ var require_build3 = __commonJS({
36872
36928
  case SID:
36873
36929
  return memberValue instanceof asn1js__namespace.Any;
36874
36930
  case DIGEST_ALGORITHM:
36875
- if (memberValue instanceof AlgorithmIdentifier2 === false)
36931
+ if (memberValue instanceof AlgorithmIdentifier3 === false)
36876
36932
  return false;
36877
36933
  return memberValue.isEqual(_SignerInfo.defaultValues(DIGEST_ALGORITHM));
36878
36934
  case SIGNED_ATTRS:
36879
36935
  return SignedAndUnsignedAttributes2.compareWithDefault("type", memberValue.type) && SignedAndUnsignedAttributes2.compareWithDefault("attributes", memberValue.attributes) && SignedAndUnsignedAttributes2.compareWithDefault("encodedValue", memberValue.encodedValue);
36880
36936
  case SIGNATURE_ALGORITHM:
36881
- if (memberValue instanceof AlgorithmIdentifier2 === false)
36937
+ if (memberValue instanceof AlgorithmIdentifier3 === false)
36882
36938
  return false;
36883
36939
  return memberValue.isEqual(_SignerInfo.defaultValues(SIGNATURE_ALGORITHM));
36884
36940
  case SIGNATURE:
@@ -36896,7 +36952,7 @@ var require_build3 = __commonJS({
36896
36952
  new asn1js__namespace.Integer({ name: names.version || SIGNER_INFO_VERSION }),
36897
36953
  new asn1js__namespace.Choice({
36898
36954
  value: [
36899
- IssuerAndSerialNumber3.schema(names.sidSchema || {
36955
+ IssuerAndSerialNumber4.schema(names.sidSchema || {
36900
36956
  names: {
36901
36957
  blockName: SIGNER_INFO_SID
36902
36958
  }
@@ -36924,7 +36980,7 @@ var require_build3 = __commonJS({
36924
36980
  })
36925
36981
  ]
36926
36982
  }),
36927
- AlgorithmIdentifier2.schema(names.digestAlgorithm || {
36983
+ AlgorithmIdentifier3.schema(names.digestAlgorithm || {
36928
36984
  names: {
36929
36985
  blockName: SIGNER_INFO_DIGEST_ALGORITHM
36930
36986
  }
@@ -36935,7 +36991,7 @@ var require_build3 = __commonJS({
36935
36991
  tagNumber: 0
36936
36992
  }
36937
36993
  }),
36938
- AlgorithmIdentifier2.schema(names.signatureAlgorithm || {
36994
+ AlgorithmIdentifier3.schema(names.signatureAlgorithm || {
36939
36995
  names: {
36940
36996
  blockName: SIGNER_INFO_SIGNATURE_ALGORITHM
36941
36997
  }
@@ -36957,10 +37013,10 @@ var require_build3 = __commonJS({
36957
37013
  this.version = asn1.result[SIGNER_INFO_VERSION].valueBlock.valueDec;
36958
37014
  const currentSid = asn1.result[SIGNER_INFO_SID];
36959
37015
  if (currentSid.idBlock.tagClass === 1)
36960
- this.sid = new IssuerAndSerialNumber3({ schema: currentSid });
37016
+ this.sid = new IssuerAndSerialNumber4({ schema: currentSid });
36961
37017
  else
36962
37018
  this.sid = currentSid;
36963
- this.digestAlgorithm = new AlgorithmIdentifier2({
37019
+ this.digestAlgorithm = new AlgorithmIdentifier3({
36964
37020
  schema: asn1.result[SIGNER_INFO_DIGEST_ALGORITHM]
36965
37021
  });
36966
37022
  if (SIGNER_INFO_SIGNED_ATTRS in asn1.result)
@@ -36968,7 +37024,7 @@ var require_build3 = __commonJS({
36968
37024
  type: 0,
36969
37025
  schema: asn1.result[SIGNER_INFO_SIGNED_ATTRS]
36970
37026
  });
36971
- this.signatureAlgorithm = new AlgorithmIdentifier2({
37027
+ this.signatureAlgorithm = new AlgorithmIdentifier3({
36972
37028
  schema: asn1.result[SIGNER_INFO_SIGNATURE_ALGORITHM]
36973
37029
  });
36974
37030
  this.signature = asn1.result[SIGNER_INFO_SIGNATURE];
@@ -36983,7 +37039,7 @@ var require_build3 = __commonJS({
36983
37039
  throw new Error('Incorrectly initialized "SignerInfo" class');
36984
37040
  const outputArray = [];
36985
37041
  outputArray.push(new asn1js__namespace.Integer({ value: this.version }));
36986
- if (this.sid instanceof IssuerAndSerialNumber3)
37042
+ if (this.sid instanceof IssuerAndSerialNumber4)
36987
37043
  outputArray.push(this.sid.toSchema());
36988
37044
  else
36989
37045
  outputArray.push(this.sid);
@@ -37057,7 +37113,7 @@ var require_build3 = __commonJS({
37057
37113
  TST_INFO_TSA,
37058
37114
  TST_INFO_EXTENSIONS
37059
37115
  ];
37060
- var TSTInfo = class _TSTInfo extends PkiObject {
37116
+ var TSTInfo2 = class _TSTInfo extends PkiObject {
37061
37117
  constructor(parameters = {}) {
37062
37118
  super();
37063
37119
  this.version = pvutils__namespace.getParametersValue(parameters, VERSION$3, _TSTInfo.defaultValues(VERSION$3));
@@ -37091,7 +37147,7 @@ var require_build3 = __commonJS({
37091
37147
  case POLICY:
37092
37148
  return EMPTY_STRING;
37093
37149
  case MESSAGE_IMPRINT$1:
37094
- return new MessageImprint();
37150
+ return new MessageImprint2();
37095
37151
  case SERIAL_NUMBER:
37096
37152
  return new asn1js__namespace.Integer();
37097
37153
  case GEN_TIME:
@@ -37118,7 +37174,7 @@ var require_build3 = __commonJS({
37118
37174
  case ORDERING:
37119
37175
  return memberValue === _TSTInfo.defaultValues(ORDERING);
37120
37176
  case MESSAGE_IMPRINT$1:
37121
- return MessageImprint.compareWithDefault(HASH_ALGORITHM, memberValue.hashAlgorithm) && MessageImprint.compareWithDefault(HASHED_MESSAGE, memberValue.hashedMessage);
37177
+ return MessageImprint2.compareWithDefault(HASH_ALGORITHM, memberValue.hashAlgorithm) && MessageImprint2.compareWithDefault(HASHED_MESSAGE, memberValue.hashedMessage);
37122
37178
  case SERIAL_NUMBER:
37123
37179
  case NONCE$1:
37124
37180
  return memberValue.isEqual(_TSTInfo.defaultValues(NONCE$1));
@@ -37139,7 +37195,7 @@ var require_build3 = __commonJS({
37139
37195
  value: [
37140
37196
  new asn1js__namespace.Integer({ name: names.version || TST_INFO_VERSION }),
37141
37197
  new asn1js__namespace.ObjectIdentifier({ name: names.policy || TST_INFO_POLICY }),
37142
- MessageImprint.schema(names.messageImprint || {
37198
+ MessageImprint2.schema(names.messageImprint || {
37143
37199
  names: {
37144
37200
  blockName: TST_INFO_MESSAGE_IMPRINT
37145
37201
  }
@@ -37195,7 +37251,7 @@ var require_build3 = __commonJS({
37195
37251
  AsnError.assertSchema(asn1, this.className);
37196
37252
  this.version = asn1.result[TST_INFO_VERSION].valueBlock.valueDec;
37197
37253
  this.policy = asn1.result[TST_INFO_POLICY].valueBlock.toString();
37198
- this.messageImprint = new MessageImprint({ schema: asn1.result[TST_INFO_MESSAGE_IMPRINT] });
37254
+ this.messageImprint = new MessageImprint2({ schema: asn1.result[TST_INFO_MESSAGE_IMPRINT] });
37199
37255
  this.serialNumber = asn1.result[TST_INFO_SERIAL_NUMBER];
37200
37256
  this.genTime = asn1.result[TST_INFO_GEN_TIME].toDate();
37201
37257
  if (TST_INFO_ACCURACY in asn1.result)
@@ -37266,7 +37322,7 @@ var require_build3 = __commonJS({
37266
37322
  res.extensions = Array.from(this.extensions, (o) => o.toJSON());
37267
37323
  return res;
37268
37324
  }
37269
- async verify(params, crypto3 = getCrypto2(true)) {
37325
+ async verify(params, crypto3 = getCrypto3(true)) {
37270
37326
  if (!params.data) {
37271
37327
  throw new Error('"data" is a mandatory attribute for TST_INFO verification');
37272
37328
  }
@@ -37284,7 +37340,7 @@ var require_build3 = __commonJS({
37284
37340
  return pvtsutils__namespace.BufferSourceConverter.isEqual(hash4, this.messageImprint.hashedMessage.valueBlock.valueHexView);
37285
37341
  }
37286
37342
  };
37287
- TSTInfo.CLASS_NAME = "TSTInfo";
37343
+ TSTInfo2.CLASS_NAME = "TSTInfo";
37288
37344
  var VERSION$2 = "version";
37289
37345
  var DIGEST_ALGORITHMS = "digestAlgorithms";
37290
37346
  var ENCAP_CONTENT_INFO = "encapContentInfo";
@@ -37320,7 +37376,7 @@ var require_build3 = __commonJS({
37320
37376
  this.certificatePath = certificatePath;
37321
37377
  }
37322
37378
  };
37323
- var SignedData4 = class _SignedData extends PkiObject {
37379
+ var SignedData6 = class _SignedData extends PkiObject {
37324
37380
  constructor(parameters = {}) {
37325
37381
  super();
37326
37382
  this.version = pvutils__namespace.getParametersValue(parameters, VERSION$2, _SignedData.defaultValues(VERSION$2));
@@ -37390,7 +37446,7 @@ var require_build3 = __commonJS({
37390
37446
  value: [
37391
37447
  new asn1js__namespace.Repeated({
37392
37448
  name: names.digestAlgorithms || SIGNED_DATA_DIGEST_ALGORITHMS,
37393
- value: AlgorithmIdentifier2.schema()
37449
+ value: AlgorithmIdentifier3.schema()
37394
37450
  })
37395
37451
  ]
37396
37452
  }),
@@ -37437,7 +37493,7 @@ var require_build3 = __commonJS({
37437
37493
  AsnError.assertSchema(asn1, this.className);
37438
37494
  this.version = asn1.result[SIGNED_DATA_VERSION].valueBlock.valueDec;
37439
37495
  if (SIGNED_DATA_DIGEST_ALGORITHMS in asn1.result)
37440
- this.digestAlgorithms = Array.from(asn1.result[SIGNED_DATA_DIGEST_ALGORITHMS], (algorithm) => new AlgorithmIdentifier2({ schema: algorithm }));
37496
+ this.digestAlgorithms = Array.from(asn1.result[SIGNED_DATA_DIGEST_ALGORITHMS], (algorithm) => new AlgorithmIdentifier3({ schema: algorithm }));
37441
37497
  this.encapContentInfo = new EncapsulatedContentInfo3({
37442
37498
  schema: asn1.result[SIGNED_DATA_ENCAP_CONTENT_INFO]
37443
37499
  });
@@ -37527,7 +37583,7 @@ var require_build3 = __commonJS({
37527
37583
  }
37528
37584
  return res;
37529
37585
  }
37530
- async verify({ signer = -1, data = EMPTY_BUFFER, trustedCerts = [], checkDate = /* @__PURE__ */ new Date(), checkChain = false, passedWhenNotRevValues = false, extendedMode = false, findOrigin = null, findIssuer = null } = {}, crypto3 = getCrypto2(true)) {
37586
+ async verify({ signer = -1, data = EMPTY_BUFFER, trustedCerts = [], checkDate = /* @__PURE__ */ new Date(), checkChain = false, passedWhenNotRevValues = false, extendedMode = false, findOrigin = null, findIssuer = null } = {}, crypto3 = getCrypto3(true)) {
37531
37587
  let signerCert = null;
37532
37588
  let timestampSerial = null;
37533
37589
  try {
@@ -37549,9 +37605,9 @@ var require_build3 = __commonJS({
37549
37605
  message: "No certificates attached to this signed data"
37550
37606
  });
37551
37607
  }
37552
- if (signerInfo.sid instanceof IssuerAndSerialNumber3) {
37608
+ if (signerInfo.sid instanceof IssuerAndSerialNumber4) {
37553
37609
  for (const certificate of this.certificates) {
37554
- if (!(certificate instanceof Certificate4))
37610
+ if (!(certificate instanceof Certificate6))
37555
37611
  continue;
37556
37612
  if (certificate.issuer.isEqual(signerInfo.sid.issuer) && certificate.serialNumber.isEqual(signerInfo.sid.serialNumber)) {
37557
37613
  signerCert = certificate;
@@ -37562,7 +37618,7 @@ var require_build3 = __commonJS({
37562
37618
  const sid = signerInfo.sid;
37563
37619
  const keyId = sid.idBlock.isConstructed ? sid.valueBlock.value[0].valueBlock.valueHex : sid.valueBlock.valueHex;
37564
37620
  for (const certificate of this.certificates) {
37565
- if (!(certificate instanceof Certificate4)) {
37621
+ if (!(certificate instanceof Certificate6)) {
37566
37622
  continue;
37567
37623
  }
37568
37624
  const digest = await crypto3.digest({ name: "sha-1" }, certificate.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);
@@ -37593,7 +37649,7 @@ var require_build3 = __commonJS({
37593
37649
  }
37594
37650
  let tstInfo;
37595
37651
  try {
37596
- tstInfo = TSTInfo.fromBER(this.encapContentInfo.eContent.valueBlock.valueHexView);
37652
+ tstInfo = TSTInfo2.fromBER(this.encapContentInfo.eContent.valueBlock.valueHexView);
37597
37653
  } catch {
37598
37654
  throw new SignedDataVerifyError({
37599
37655
  date: checkDate,
@@ -37627,7 +37683,7 @@ var require_build3 = __commonJS({
37627
37683
  }
37628
37684
  }
37629
37685
  if (checkChain) {
37630
- const certs = this.certificates.filter((certificate) => certificate instanceof Certificate4 && !!checkCA(certificate, signerCert));
37686
+ const certs = this.certificates.filter((certificate) => certificate instanceof Certificate6 && !!checkCA(certificate, signerCert));
37631
37687
  const chainParams = {
37632
37688
  checkDate,
37633
37689
  certs,
@@ -37639,7 +37695,7 @@ var require_build3 = __commonJS({
37639
37695
  if (findOrigin) {
37640
37696
  chainParams.findOrigin = findOrigin;
37641
37697
  }
37642
- const chainEngine = new CertificateChainValidationEngine2(chainParams);
37698
+ const chainEngine = new CertificateChainValidationEngine3(chainParams);
37643
37699
  chainEngine.certs.push(signerCert);
37644
37700
  if (this.crls) {
37645
37701
  for (const crl of this.crls) {
@@ -37781,7 +37837,7 @@ var require_build3 = __commonJS({
37781
37837
  });
37782
37838
  }
37783
37839
  }
37784
- async sign(privateKey, signerIndex, hashAlgorithm = "SHA-1", data = EMPTY_BUFFER, crypto3 = getCrypto2(true)) {
37840
+ async sign(privateKey, signerIndex, hashAlgorithm = "SHA-1", data = EMPTY_BUFFER, crypto3 = getCrypto3(true)) {
37785
37841
  var _a4;
37786
37842
  if (!privateKey)
37787
37843
  throw new Error("Need to provide a private key for signing");
@@ -37794,12 +37850,12 @@ var require_build3 = __commonJS({
37794
37850
  }
37795
37851
  const hashAlgorithmOID = crypto3.getOIDByAlgorithm({ name: hashAlgorithm }, true, "hashAlgorithm");
37796
37852
  if (this.digestAlgorithms.filter((algorithm) => algorithm.algorithmId === hashAlgorithmOID).length === 0) {
37797
- this.digestAlgorithms.push(new AlgorithmIdentifier2({
37853
+ this.digestAlgorithms.push(new AlgorithmIdentifier3({
37798
37854
  algorithmId: hashAlgorithmOID,
37799
37855
  algorithmParams: new asn1js__namespace.Null()
37800
37856
  }));
37801
37857
  }
37802
- signerInfo.digestAlgorithm = new AlgorithmIdentifier2({
37858
+ signerInfo.digestAlgorithm = new AlgorithmIdentifier3({
37803
37859
  algorithmId: hashAlgorithmOID,
37804
37860
  algorithmParams: new asn1js__namespace.Null()
37805
37861
  });
@@ -37830,8 +37886,8 @@ var require_build3 = __commonJS({
37830
37886
  signerInfo.signature = new asn1js__namespace.OctetString({ valueHex: signature });
37831
37887
  }
37832
37888
  };
37833
- SignedData4.CLASS_NAME = "SignedData";
37834
- SignedData4.ID_DATA = id_ContentType_Data;
37889
+ SignedData6.CLASS_NAME = "SignedData";
37890
+ SignedData6.ID_DATA = id_ContentType_Data;
37835
37891
  var VERSION$1 = "version";
37836
37892
  var AUTH_SAFE = "authSafe";
37837
37893
  var MAC_DATA = "macData";
@@ -37857,7 +37913,7 @@ var require_build3 = __commonJS({
37857
37913
  case VERSION$1:
37858
37914
  return 3;
37859
37915
  case AUTH_SAFE:
37860
- return new ContentInfo4();
37916
+ return new ContentInfo6();
37861
37917
  case MAC_DATA:
37862
37918
  return new MacData();
37863
37919
  case PARSED_VALUE:
@@ -37871,7 +37927,7 @@ var require_build3 = __commonJS({
37871
37927
  case VERSION$1:
37872
37928
  return memberValue === _PFX.defaultValues(memberName);
37873
37929
  case AUTH_SAFE:
37874
- return ContentInfo4.compareWithDefault("contentType", memberValue.contentType) && ContentInfo4.compareWithDefault("content", memberValue.content);
37930
+ return ContentInfo6.compareWithDefault("contentType", memberValue.contentType) && ContentInfo6.compareWithDefault("content", memberValue.content);
37875
37931
  case MAC_DATA:
37876
37932
  return MacData.compareWithDefault("mac", memberValue.mac) && MacData.compareWithDefault("macSalt", memberValue.macSalt) && MacData.compareWithDefault("iterations", memberValue.iterations);
37877
37933
  case PARSED_VALUE:
@@ -37886,7 +37942,7 @@ var require_build3 = __commonJS({
37886
37942
  name: names.blockName || EMPTY_STRING,
37887
37943
  value: [
37888
37944
  new asn1js__namespace.Integer({ name: names.version || VERSION$1 }),
37889
- ContentInfo4.schema(names.authSafe || {
37945
+ ContentInfo6.schema(names.authSafe || {
37890
37946
  names: {
37891
37947
  blockName: AUTH_SAFE
37892
37948
  }
@@ -37919,7 +37975,7 @@ var require_build3 = __commonJS({
37919
37975
  }));
37920
37976
  AsnError.assertSchema(asn1, this.className);
37921
37977
  this.version = asn1.result.version.valueBlock.valueDec;
37922
- this.authSafe = new ContentInfo4({ schema: asn1.result.authSafe });
37978
+ this.authSafe = new ContentInfo6({ schema: asn1.result.authSafe });
37923
37979
  if (MAC_DATA in asn1.result)
37924
37980
  this.macData = new MacData({ schema: asn1.result.macData });
37925
37981
  }
@@ -37942,7 +37998,7 @@ var require_build3 = __commonJS({
37942
37998
  }
37943
37999
  return output2;
37944
38000
  }
37945
- async makeInternalValues(parameters = {}, crypto3 = getCrypto2(true)) {
38001
+ async makeInternalValues(parameters = {}, crypto3 = getCrypto3(true)) {
37946
38002
  ArgumentError.assert(parameters, "parameters", "object");
37947
38003
  if (!this.parsedValue) {
37948
38004
  throw new Error('Please call "parseValues" function first in order to make "parsedValue" data');
@@ -37961,8 +38017,8 @@ var require_build3 = __commonJS({
37961
38017
  const saltView = new Uint8Array(saltBuffer);
37962
38018
  crypto3.getRandomValues(saltView);
37963
38019
  const data = this.parsedValue.authenticatedSafe.toSchema().toBER(false);
37964
- this.authSafe = new ContentInfo4({
37965
- contentType: ContentInfo4.DATA,
38020
+ this.authSafe = new ContentInfo6({
38021
+ contentType: ContentInfo6.DATA,
37966
38022
  content: new asn1js__namespace.OctetString({ valueHex: data })
37967
38023
  });
37968
38024
  const result = await crypto3.stampDataWithPassword({
@@ -37974,7 +38030,7 @@ var require_build3 = __commonJS({
37974
38030
  });
37975
38031
  this.macData = new MacData({
37976
38032
  mac: new DigestInfo({
37977
- digestAlgorithm: new AlgorithmIdentifier2({
38033
+ digestAlgorithm: new AlgorithmIdentifier3({
37978
38034
  algorithmId: crypto3.getOIDByAlgorithm({ name: parameters.hmacHashAlgorithm }, true, "hmacHashAlgorithm")
37979
38035
  }),
37980
38036
  digest: new asn1js__namespace.OctetString({ valueHex: result })
@@ -37992,7 +38048,7 @@ var require_build3 = __commonJS({
37992
38048
  ParameterError.assertEmpty(parameters.privateKey, "privateKey");
37993
38049
  ParameterError.assertEmpty(parameters.hashAlgorithm, "hashAlgorithm");
37994
38050
  const toBeSigned = this.parsedValue.authenticatedSafe.toSchema().toBER(false);
37995
- const cmsSigned = new SignedData4({
38051
+ const cmsSigned = new SignedData6({
37996
38052
  version: 1,
37997
38053
  encapContentInfo: new EncapsulatedContentInfo3({
37998
38054
  eContentType: "1.2.840.113549.1.7.1",
@@ -38016,7 +38072,7 @@ var require_build3 = __commonJS({
38016
38072
  }));
38017
38073
  cmsSigned.signerInfos.push(new SignerInfo3({
38018
38074
  version: 1,
38019
- sid: new IssuerAndSerialNumber3({
38075
+ sid: new IssuerAndSerialNumber4({
38020
38076
  issuer: parameters.signingCertificate.issuer,
38021
38077
  serialNumber: parameters.signingCertificate.serialNumber
38022
38078
  }),
@@ -38026,7 +38082,7 @@ var require_build3 = __commonJS({
38026
38082
  })
38027
38083
  }));
38028
38084
  await cmsSigned.sign(parameters.privateKey, 0, parameters.hashAlgorithm, void 0, crypto3);
38029
- this.authSafe = new ContentInfo4({
38085
+ this.authSafe = new ContentInfo6({
38030
38086
  contentType: "1.2.840.113549.1.7.2",
38031
38087
  content: cmsSigned.toSchema(true)
38032
38088
  });
@@ -38036,14 +38092,14 @@ var require_build3 = __commonJS({
38036
38092
  throw new Error(`Parameter "integrityMode" has unknown value: ${this.parsedValue.integrityMode}`);
38037
38093
  }
38038
38094
  }
38039
- async parseInternalValues(parameters, crypto3 = getCrypto2(true)) {
38095
+ async parseInternalValues(parameters, crypto3 = getCrypto3(true)) {
38040
38096
  ArgumentError.assert(parameters, "parameters", "object");
38041
38097
  if (parameters.checkIntegrity === void 0) {
38042
38098
  parameters.checkIntegrity = true;
38043
38099
  }
38044
38100
  this.parsedValue = {};
38045
38101
  switch (this.authSafe.contentType) {
38046
- case ContentInfo4.DATA:
38102
+ case ContentInfo6.DATA:
38047
38103
  {
38048
38104
  ParameterError.assertEmpty(parameters.password, "password");
38049
38105
  this.parsedValue.integrityMode = 0;
@@ -38069,10 +38125,10 @@ var require_build3 = __commonJS({
38069
38125
  }
38070
38126
  }
38071
38127
  break;
38072
- case ContentInfo4.SIGNED_DATA:
38128
+ case ContentInfo6.SIGNED_DATA:
38073
38129
  {
38074
38130
  this.parsedValue.integrityMode = 1;
38075
- const cmsSigned = new SignedData4({ schema: this.authSafe.content });
38131
+ const cmsSigned = new SignedData6({ schema: this.authSafe.content });
38076
38132
  const eContent = cmsSigned.encapContentInfo.eContent;
38077
38133
  ParameterError.assert(eContent, "eContent", "cmsSigned.encapContentInfo");
38078
38134
  ArgumentError.assert(eContent, "eContent", asn1js__namespace.OctetString);
@@ -38233,7 +38289,7 @@ var require_build3 = __commonJS({
38233
38289
  TIME_STAMP_REQ_CERT_REQ,
38234
38290
  TIME_STAMP_REQ_EXTENSIONS
38235
38291
  ];
38236
- var TimeStampReq = class _TimeStampReq extends PkiObject {
38292
+ var TimeStampReq2 = class _TimeStampReq extends PkiObject {
38237
38293
  constructor(parameters = {}) {
38238
38294
  super();
38239
38295
  this.version = pvutils__namespace.getParametersValue(parameters, VERSION, _TimeStampReq.defaultValues(VERSION));
@@ -38259,7 +38315,7 @@ var require_build3 = __commonJS({
38259
38315
  case VERSION:
38260
38316
  return 0;
38261
38317
  case MESSAGE_IMPRINT:
38262
- return new MessageImprint();
38318
+ return new MessageImprint2();
38263
38319
  case REQ_POLICY:
38264
38320
  return EMPTY_STRING;
38265
38321
  case NONCE:
@@ -38279,7 +38335,7 @@ var require_build3 = __commonJS({
38279
38335
  case CERT_REQ:
38280
38336
  return memberValue === _TimeStampReq.defaultValues(memberName);
38281
38337
  case MESSAGE_IMPRINT:
38282
- return MessageImprint.compareWithDefault("hashAlgorithm", memberValue.hashAlgorithm) && MessageImprint.compareWithDefault("hashedMessage", memberValue.hashedMessage);
38338
+ return MessageImprint2.compareWithDefault("hashAlgorithm", memberValue.hashAlgorithm) && MessageImprint2.compareWithDefault("hashedMessage", memberValue.hashedMessage);
38283
38339
  case NONCE:
38284
38340
  return memberValue.isEqual(_TimeStampReq.defaultValues(memberName));
38285
38341
  case EXTENSIONS:
@@ -38294,7 +38350,7 @@ var require_build3 = __commonJS({
38294
38350
  name: names.blockName || TIME_STAMP_REQ,
38295
38351
  value: [
38296
38352
  new asn1js__namespace.Integer({ name: names.version || TIME_STAMP_REQ_VERSION }),
38297
- MessageImprint.schema(names.messageImprint || {
38353
+ MessageImprint2.schema(names.messageImprint || {
38298
38354
  names: {
38299
38355
  blockName: TIME_STAMP_REQ_MESSAGE_IMPRINT
38300
38356
  }
@@ -38332,7 +38388,7 @@ var require_build3 = __commonJS({
38332
38388
  const asn1 = asn1js__namespace.compareSchema(schema, schema, _TimeStampReq.schema());
38333
38389
  AsnError.assertSchema(asn1, this.className);
38334
38390
  this.version = asn1.result[TIME_STAMP_REQ_VERSION].valueBlock.valueDec;
38335
- this.messageImprint = new MessageImprint({
38391
+ this.messageImprint = new MessageImprint2({
38336
38392
  schema: asn1.result[TIME_STAMP_REQ_MESSAGE_IMPRINT]
38337
38393
  });
38338
38394
  if (TIME_STAMP_REQ_POLICY in asn1.result)
@@ -38384,7 +38440,7 @@ var require_build3 = __commonJS({
38384
38440
  return res;
38385
38441
  }
38386
38442
  };
38387
- TimeStampReq.CLASS_NAME = "TimeStampReq";
38443
+ TimeStampReq2.CLASS_NAME = "TimeStampReq";
38388
38444
  var STATUS = "status";
38389
38445
  var TIME_STAMP_TOKEN = "timeStampToken";
38390
38446
  var TIME_STAMP_RESP = "TimeStampResp";
@@ -38407,7 +38463,7 @@ var require_build3 = __commonJS({
38407
38463
  case STATUS:
38408
38464
  return new PKIStatusInfo();
38409
38465
  case TIME_STAMP_TOKEN:
38410
- return new ContentInfo4();
38466
+ return new ContentInfo6();
38411
38467
  default:
38412
38468
  return super.defaultValues(memberName);
38413
38469
  }
@@ -38432,7 +38488,7 @@ var require_build3 = __commonJS({
38432
38488
  blockName: TIME_STAMP_RESP_STATUS
38433
38489
  }
38434
38490
  }),
38435
- ContentInfo4.schema(names.timeStampToken || {
38491
+ ContentInfo6.schema(names.timeStampToken || {
38436
38492
  names: {
38437
38493
  blockName: TIME_STAMP_RESP_TOKEN,
38438
38494
  optional: true
@@ -38447,7 +38503,7 @@ var require_build3 = __commonJS({
38447
38503
  AsnError.assertSchema(asn1, this.className);
38448
38504
  this.status = new PKIStatusInfo({ schema: asn1.result[TIME_STAMP_RESP_STATUS] });
38449
38505
  if (TIME_STAMP_RESP_TOKEN in asn1.result)
38450
- this.timeStampToken = new ContentInfo4({ schema: asn1.result[TIME_STAMP_RESP_TOKEN] });
38506
+ this.timeStampToken = new ContentInfo6({ schema: asn1.result[TIME_STAMP_RESP_TOKEN] });
38451
38507
  }
38452
38508
  toSchema() {
38453
38509
  const outputArray = [];
@@ -38468,18 +38524,18 @@ var require_build3 = __commonJS({
38468
38524
  }
38469
38525
  return res;
38470
38526
  }
38471
- async sign(privateKey, hashAlgorithm, crypto3 = getCrypto2(true)) {
38527
+ async sign(privateKey, hashAlgorithm, crypto3 = getCrypto3(true)) {
38472
38528
  this.assertContentType();
38473
- const signed = new SignedData4({ schema: this.timeStampToken.content });
38529
+ const signed = new SignedData6({ schema: this.timeStampToken.content });
38474
38530
  return signed.sign(privateKey, 0, hashAlgorithm, void 0, crypto3);
38475
38531
  }
38476
38532
  async verify(verificationParameters = {
38477
38533
  signer: 0,
38478
38534
  trustedCerts: [],
38479
38535
  data: EMPTY_BUFFER
38480
- }, crypto3 = getCrypto2(true)) {
38536
+ }, crypto3 = getCrypto3(true)) {
38481
38537
  this.assertContentType();
38482
- const signed = new SignedData4({ schema: this.timeStampToken.content });
38538
+ const signed = new SignedData6({ schema: this.timeStampToken.content });
38483
38539
  return signed.verify(verificationParameters, crypto3);
38484
38540
  }
38485
38541
  assertContentType() {
@@ -38498,18 +38554,18 @@ var require_build3 = __commonJS({
38498
38554
  if ("webkitSubtle" in globalThis.crypto) {
38499
38555
  engineName = "safari";
38500
38556
  }
38501
- setEngine4(engineName, new CryptoEngine4({ name: engineName, crypto: globalThis.crypto }));
38557
+ setEngine5(engineName, new CryptoEngine5({ name: engineName, crypto: globalThis.crypto }));
38502
38558
  } else if (typeof crypto !== "undefined" && "webcrypto" in crypto) {
38503
38559
  const name = "NodeJS ^15";
38504
38560
  const nodeCrypto = crypto.webcrypto;
38505
- setEngine4(name, new CryptoEngine4({ name, crypto: nodeCrypto }));
38561
+ setEngine5(name, new CryptoEngine5({ name, crypto: nodeCrypto }));
38506
38562
  }
38507
38563
  }
38508
38564
  initCryptoEngine();
38509
38565
  exports.AbstractCryptoEngine = AbstractCryptoEngine;
38510
38566
  exports.AccessDescription = AccessDescription;
38511
38567
  exports.Accuracy = Accuracy;
38512
- exports.AlgorithmIdentifier = AlgorithmIdentifier2;
38568
+ exports.AlgorithmIdentifier = AlgorithmIdentifier3;
38513
38569
  exports.AltName = AltName;
38514
38570
  exports.ArgumentError = ArgumentError;
38515
38571
  exports.AsnError = AsnError;
@@ -38529,16 +38585,16 @@ var require_build3 = __commonJS({
38529
38585
  exports.CRLDistributionPoints = CRLDistributionPoints;
38530
38586
  exports.CertBag = CertBag;
38531
38587
  exports.CertID = CertID;
38532
- exports.Certificate = Certificate4;
38533
- exports.CertificateChainValidationEngine = CertificateChainValidationEngine2;
38588
+ exports.Certificate = Certificate6;
38589
+ exports.CertificateChainValidationEngine = CertificateChainValidationEngine3;
38534
38590
  exports.CertificatePolicies = CertificatePolicies;
38535
38591
  exports.CertificateRevocationList = CertificateRevocationList;
38536
38592
  exports.CertificateSet = CertificateSet;
38537
38593
  exports.CertificateTemplate = CertificateTemplate;
38538
38594
  exports.CertificationRequest = CertificationRequest;
38539
38595
  exports.ChainValidationError = ChainValidationError;
38540
- exports.ContentInfo = ContentInfo4;
38541
- exports.CryptoEngine = CryptoEngine4;
38596
+ exports.ContentInfo = ContentInfo6;
38597
+ exports.CryptoEngine = CryptoEngine5;
38542
38598
  exports.DigestInfo = DigestInfo;
38543
38599
  exports.DistributionPoint = DistributionPoint;
38544
38600
  exports.ECCCMSSharedInfo = ECCCMSSharedInfo;
@@ -38560,7 +38616,7 @@ var require_build3 = __commonJS({
38560
38616
  exports.HASH_ALGORITHM = HASH_ALGORITHM;
38561
38617
  exports.Holder = Holder;
38562
38618
  exports.InfoAccess = InfoAccess;
38563
- exports.IssuerAndSerialNumber = IssuerAndSerialNumber3;
38619
+ exports.IssuerAndSerialNumber = IssuerAndSerialNumber4;
38564
38620
  exports.IssuerSerial = IssuerSerial;
38565
38621
  exports.IssuingDistributionPoint = IssuingDistributionPoint;
38566
38622
  exports.KEKIdentifier = KEKIdentifier;
@@ -38572,7 +38628,7 @@ var require_build3 = __commonJS({
38572
38628
  exports.MICROS = MICROS;
38573
38629
  exports.MILLIS = MILLIS;
38574
38630
  exports.MacData = MacData;
38575
- exports.MessageImprint = MessageImprint;
38631
+ exports.MessageImprint = MessageImprint2;
38576
38632
  exports.NameConstraints = NameConstraints;
38577
38633
  exports.OCSPRequest = OCSPRequest;
38578
38634
  exports.OCSPResponse = OCSPResponse;
@@ -38630,17 +38686,17 @@ var require_build3 = __commonJS({
38630
38686
  exports.SignedAndUnsignedAttributes = SignedAndUnsignedAttributes2;
38631
38687
  exports.SignedCertificateTimestamp = SignedCertificateTimestamp;
38632
38688
  exports.SignedCertificateTimestampList = SignedCertificateTimestampList;
38633
- exports.SignedData = SignedData4;
38689
+ exports.SignedData = SignedData6;
38634
38690
  exports.SignedDataVerifyError = SignedDataVerifyError;
38635
38691
  exports.SignerInfo = SignerInfo3;
38636
38692
  exports.SingleResponse = SingleResponse;
38637
38693
  exports.SubjectDirectoryAttributes = SubjectDirectoryAttributes;
38638
38694
  exports.TBSRequest = TBSRequest;
38639
- exports.TSTInfo = TSTInfo;
38695
+ exports.TSTInfo = TSTInfo2;
38640
38696
  exports.TYPE = TYPE$4;
38641
38697
  exports.TYPE_AND_VALUES = TYPE_AND_VALUES;
38642
38698
  exports.Time = Time;
38643
- exports.TimeStampReq = TimeStampReq;
38699
+ exports.TimeStampReq = TimeStampReq2;
38644
38700
  exports.TimeStampResp = TimeStampResp;
38645
38701
  exports.V2Form = V2Form;
38646
38702
  exports.VALUE = VALUE$5;
@@ -38650,7 +38706,7 @@ var require_build3 = __commonJS({
38650
38706
  exports.createECDSASignatureFromCMS = createECDSASignatureFromCMS;
38651
38707
  exports.getAlgorithmByOID = getAlgorithmByOID;
38652
38708
  exports.getAlgorithmParameters = getAlgorithmParameters;
38653
- exports.getCrypto = getCrypto2;
38709
+ exports.getCrypto = getCrypto3;
38654
38710
  exports.getEngine = getEngine;
38655
38711
  exports.getHashAlgorithm = getHashAlgorithm;
38656
38712
  exports.getOIDByAlgorithm = getOIDByAlgorithm;
@@ -38706,7 +38762,7 @@ var require_build3 = __commonJS({
38706
38762
  exports.id_sha384 = id_sha384;
38707
38763
  exports.id_sha512 = id_sha512;
38708
38764
  exports.kdf = kdf;
38709
- exports.setEngine = setEngine4;
38765
+ exports.setEngine = setEngine5;
38710
38766
  exports.stringPrep = stringPrep;
38711
38767
  exports.verifySCTsForCertificate = verifySCTsForCertificate;
38712
38768
  }
@@ -40750,8 +40806,8 @@ var require_convert2 = __commonJS({
40750
40806
  static FromBase64(base643) {
40751
40807
  return index_js_1.convert.fromBase64(base643);
40752
40808
  }
40753
- static FromBase64Url(base64url3) {
40754
- return index_js_1.convert.fromBase64Url(base64url3);
40809
+ static FromBase64Url(base64url4) {
40810
+ return index_js_1.convert.fromBase64Url(base64url4);
40755
40811
  }
40756
40812
  static ToBase64Url(data) {
40757
40813
  return index_js_1.convert.toBase64Url(data);
@@ -40917,9 +40973,9 @@ var require_bit_string = __commonJS({
40917
40973
  Object.defineProperty(exports, "__esModule", { value: true });
40918
40974
  exports.BitString = void 0;
40919
40975
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
40920
- var asn1js3 = tslib_1.__importStar(require_build2());
40976
+ var asn1js4 = tslib_1.__importStar(require_build2());
40921
40977
  var utils_1 = require_cjs2();
40922
- var BitString = class {
40978
+ var BitString2 = class {
40923
40979
  unusedBits = 0;
40924
40980
  value = new ArrayBuffer(0);
40925
40981
  constructor(params, unusedBits = 0) {
@@ -40935,7 +40991,7 @@ var require_bit_string = __commonJS({
40935
40991
  }
40936
40992
  }
40937
40993
  fromASN(asn) {
40938
- if (!(asn instanceof asn1js3.BitString)) {
40994
+ if (!(asn instanceof asn1js4.BitString)) {
40939
40995
  throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
40940
40996
  }
40941
40997
  this.unusedBits = asn.valueBlock.unusedBits;
@@ -40943,13 +40999,13 @@ var require_bit_string = __commonJS({
40943
40999
  return this;
40944
41000
  }
40945
41001
  toASN() {
40946
- return new asn1js3.BitString({
41002
+ return new asn1js4.BitString({
40947
41003
  unusedBits: this.unusedBits,
40948
41004
  valueHex: this.value
40949
41005
  });
40950
41006
  }
40951
41007
  toSchema(name) {
40952
- return new asn1js3.BitString({ name });
41008
+ return new asn1js4.BitString({ name });
40953
41009
  }
40954
41010
  toNumber() {
40955
41011
  let res = "";
@@ -40977,7 +41033,7 @@ var require_bit_string = __commonJS({
40977
41033
  this.value = octets.buffer;
40978
41034
  }
40979
41035
  };
40980
- exports.BitString = BitString;
41036
+ exports.BitString = BitString2;
40981
41037
  }
40982
41038
  });
40983
41039
 
@@ -40988,9 +41044,9 @@ var require_octet_string = __commonJS({
40988
41044
  Object.defineProperty(exports, "__esModule", { value: true });
40989
41045
  exports.OctetString = void 0;
40990
41046
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
40991
- var asn1js3 = tslib_1.__importStar(require_build2());
41047
+ var asn1js4 = tslib_1.__importStar(require_build2());
40992
41048
  var utils_1 = require_cjs2();
40993
- var OctetString2 = class {
41049
+ var OctetString3 = class {
40994
41050
  buffer;
40995
41051
  get byteLength() {
40996
41052
  return this.buffer.byteLength;
@@ -41012,20 +41068,20 @@ var require_octet_string = __commonJS({
41012
41068
  }
41013
41069
  }
41014
41070
  fromASN(asn) {
41015
- if (!(asn instanceof asn1js3.OctetString)) {
41071
+ if (!(asn instanceof asn1js4.OctetString)) {
41016
41072
  throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
41017
41073
  }
41018
41074
  this.buffer = (0, utils_1.toArrayBuffer)(asn.valueBlock.valueHex);
41019
41075
  return this;
41020
41076
  }
41021
41077
  toASN() {
41022
- return new asn1js3.OctetString({ valueHex: this.buffer });
41078
+ return new asn1js4.OctetString({ valueHex: this.buffer });
41023
41079
  }
41024
41080
  toSchema(name) {
41025
- return new asn1js3.OctetString({ name });
41081
+ return new asn1js4.OctetString({ name });
41026
41082
  }
41027
41083
  };
41028
- exports.OctetString = OctetString2;
41084
+ exports.OctetString = OctetString3;
41029
41085
  }
41030
41086
  });
41031
41087
 
@@ -41048,17 +41104,17 @@ var require_converters2 = __commonJS({
41048
41104
  exports.AsnNullConverter = exports.AsnGeneralizedTimeConverter = exports.AsnUTCTimeConverter = exports.AsnCharacterStringConverter = exports.AsnGeneralStringConverter = exports.AsnVisibleStringConverter = exports.AsnGraphicStringConverter = exports.AsnIA5StringConverter = exports.AsnVideotexStringConverter = exports.AsnTeletexStringConverter = exports.AsnPrintableStringConverter = exports.AsnNumericStringConverter = exports.AsnUniversalStringConverter = exports.AsnBmpStringConverter = exports.AsnUtf8StringConverter = exports.AsnConstructedOctetStringConverter = exports.AsnOctetStringConverter = exports.AsnBooleanConverter = exports.AsnRelativeObjectIdentifierConverter = exports.AsnObjectIdentifierConverter = exports.AsnBitStringConverter = exports.AsnIntegerBigIntConverter = exports.AsnIntegerArrayBufferConverter = exports.AsnEnumeratedConverter = exports.AsnIntegerConverter = exports.AsnAnyConverter = void 0;
41049
41105
  exports.defaultConverter = defaultConverter;
41050
41106
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
41051
- var asn1js3 = tslib_1.__importStar(require_build2());
41107
+ var asn1js4 = tslib_1.__importStar(require_build2());
41052
41108
  var utils_1 = require_cjs2();
41053
41109
  var enums_1 = require_enums();
41054
41110
  var index_1 = require_types2();
41055
41111
  exports.AsnAnyConverter = {
41056
- fromASN: (value) => value instanceof asn1js3.Null ? null : (0, utils_1.toArrayBuffer)(value.valueBeforeDecodeView),
41112
+ fromASN: (value) => value instanceof asn1js4.Null ? null : (0, utils_1.toArrayBuffer)(value.valueBeforeDecodeView),
41057
41113
  toASN: (value) => {
41058
41114
  if (value === null) {
41059
- return new asn1js3.Null();
41115
+ return new asn1js4.Null();
41060
41116
  }
41061
- const schema = asn1js3.fromBER(value, { maxDepth: Infinity, maxNodes: Infinity, maxContentLength: Infinity });
41117
+ const schema = asn1js4.fromBER(value, { maxDepth: Infinity, maxNodes: Infinity, maxContentLength: Infinity });
41062
41118
  if (schema.result.error) {
41063
41119
  throw new Error(schema.result.error);
41064
41120
  }
@@ -41067,39 +41123,39 @@ var require_converters2 = __commonJS({
41067
41123
  };
41068
41124
  exports.AsnIntegerConverter = {
41069
41125
  fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4 ? value.valueBlock.toString() : value.valueBlock.valueDec,
41070
- toASN: (value) => new asn1js3.Integer({ value: +value })
41126
+ toASN: (value) => new asn1js4.Integer({ value: +value })
41071
41127
  };
41072
41128
  exports.AsnEnumeratedConverter = {
41073
41129
  fromASN: (value) => value.valueBlock.valueDec,
41074
- toASN: (value) => new asn1js3.Enumerated({ value })
41130
+ toASN: (value) => new asn1js4.Enumerated({ value })
41075
41131
  };
41076
41132
  exports.AsnIntegerArrayBufferConverter = {
41077
41133
  fromASN: (value) => (0, utils_1.toArrayBuffer)(value.valueBlock.valueHexView),
41078
- toASN: (value) => new asn1js3.Integer({ valueHex: value })
41134
+ toASN: (value) => new asn1js4.Integer({ valueHex: value })
41079
41135
  };
41080
41136
  exports.AsnIntegerBigIntConverter = {
41081
41137
  fromASN: (value) => value.toBigInt(),
41082
- toASN: (value) => asn1js3.Integer.fromBigInt(value)
41138
+ toASN: (value) => asn1js4.Integer.fromBigInt(value)
41083
41139
  };
41084
41140
  exports.AsnBitStringConverter = {
41085
41141
  fromASN: (value) => (0, utils_1.toArrayBuffer)(value.valueBlock.valueHexView),
41086
- toASN: (value) => new asn1js3.BitString({ valueHex: value })
41142
+ toASN: (value) => new asn1js4.BitString({ valueHex: value })
41087
41143
  };
41088
41144
  exports.AsnObjectIdentifierConverter = {
41089
41145
  fromASN: (value) => value.valueBlock.toString(),
41090
- toASN: (value) => new asn1js3.ObjectIdentifier({ value })
41146
+ toASN: (value) => new asn1js4.ObjectIdentifier({ value })
41091
41147
  };
41092
41148
  exports.AsnRelativeObjectIdentifierConverter = {
41093
41149
  fromASN: (value) => value.valueBlock.toString(),
41094
- toASN: (value) => new asn1js3.RelativeObjectIdentifier({ value })
41150
+ toASN: (value) => new asn1js4.RelativeObjectIdentifier({ value })
41095
41151
  };
41096
41152
  exports.AsnBooleanConverter = {
41097
41153
  fromASN: (value) => value.valueBlock.value,
41098
- toASN: (value) => new asn1js3.Boolean({ value })
41154
+ toASN: (value) => new asn1js4.Boolean({ value })
41099
41155
  };
41100
41156
  exports.AsnOctetStringConverter = {
41101
41157
  fromASN: (value) => (0, utils_1.toArrayBuffer)(value.valueBlock.valueHexView),
41102
- toASN: (value) => new asn1js3.OctetString({ valueHex: value })
41158
+ toASN: (value) => new asn1js4.OctetString({ valueHex: value })
41103
41159
  };
41104
41160
  exports.AsnConstructedOctetStringConverter = {
41105
41161
  fromASN: (value) => new index_1.OctetString(value.getValue()),
@@ -41111,30 +41167,30 @@ var require_converters2 = __commonJS({
41111
41167
  toASN: (value) => new Asn1Type({ value })
41112
41168
  };
41113
41169
  }
41114
- exports.AsnUtf8StringConverter = createStringConverter(asn1js3.Utf8String);
41115
- exports.AsnBmpStringConverter = createStringConverter(asn1js3.BmpString);
41116
- exports.AsnUniversalStringConverter = createStringConverter(asn1js3.UniversalString);
41117
- exports.AsnNumericStringConverter = createStringConverter(asn1js3.NumericString);
41118
- exports.AsnPrintableStringConverter = createStringConverter(asn1js3.PrintableString);
41119
- exports.AsnTeletexStringConverter = createStringConverter(asn1js3.TeletexString);
41120
- exports.AsnVideotexStringConverter = createStringConverter(asn1js3.VideotexString);
41121
- exports.AsnIA5StringConverter = createStringConverter(asn1js3.IA5String);
41122
- exports.AsnGraphicStringConverter = createStringConverter(asn1js3.GraphicString);
41123
- exports.AsnVisibleStringConverter = createStringConverter(asn1js3.VisibleString);
41124
- exports.AsnGeneralStringConverter = createStringConverter(asn1js3.GeneralString);
41125
- exports.AsnCharacterStringConverter = createStringConverter(asn1js3.CharacterString);
41170
+ exports.AsnUtf8StringConverter = createStringConverter(asn1js4.Utf8String);
41171
+ exports.AsnBmpStringConverter = createStringConverter(asn1js4.BmpString);
41172
+ exports.AsnUniversalStringConverter = createStringConverter(asn1js4.UniversalString);
41173
+ exports.AsnNumericStringConverter = createStringConverter(asn1js4.NumericString);
41174
+ exports.AsnPrintableStringConverter = createStringConverter(asn1js4.PrintableString);
41175
+ exports.AsnTeletexStringConverter = createStringConverter(asn1js4.TeletexString);
41176
+ exports.AsnVideotexStringConverter = createStringConverter(asn1js4.VideotexString);
41177
+ exports.AsnIA5StringConverter = createStringConverter(asn1js4.IA5String);
41178
+ exports.AsnGraphicStringConverter = createStringConverter(asn1js4.GraphicString);
41179
+ exports.AsnVisibleStringConverter = createStringConverter(asn1js4.VisibleString);
41180
+ exports.AsnGeneralStringConverter = createStringConverter(asn1js4.GeneralString);
41181
+ exports.AsnCharacterStringConverter = createStringConverter(asn1js4.CharacterString);
41126
41182
  exports.AsnUTCTimeConverter = {
41127
41183
  fromASN: (value) => value.toDate(),
41128
- toASN: (value) => new asn1js3.UTCTime({ valueDate: value })
41184
+ toASN: (value) => new asn1js4.UTCTime({ valueDate: value })
41129
41185
  };
41130
41186
  exports.AsnGeneralizedTimeConverter = {
41131
41187
  fromASN: (value) => value.toDate(),
41132
- toASN: (value) => new asn1js3.GeneralizedTime({ valueDate: value })
41188
+ toASN: (value) => new asn1js4.GeneralizedTime({ valueDate: value })
41133
41189
  };
41134
41190
  exports.AsnNullConverter = {
41135
41191
  fromASN: () => null,
41136
41192
  toASN: () => {
41137
- return new asn1js3.Null();
41193
+ return new asn1js4.Null();
41138
41194
  }
41139
41195
  };
41140
41196
  function defaultConverter(type) {
@@ -41247,7 +41303,7 @@ var require_schema = __commonJS({
41247
41303
  Object.defineProperty(exports, "__esModule", { value: true });
41248
41304
  exports.AsnSchemaStorage = void 0;
41249
41305
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
41250
- var asn1js3 = tslib_1.__importStar(require_build2());
41306
+ var asn1js4 = tslib_1.__importStar(require_build2());
41251
41307
  var enums_1 = require_enums();
41252
41308
  var helper_1 = require_helper();
41253
41309
  var AsnSchemaStorage = class {
@@ -41292,7 +41348,7 @@ var require_schema = __commonJS({
41292
41348
  let asn1Item;
41293
41349
  if (typeof item.type === "number") {
41294
41350
  const Asn1TypeName = enums_1.AsnPropTypes[item.type];
41295
- const Asn1Type = asn1js3[Asn1TypeName];
41351
+ const Asn1Type = asn1js4[Asn1TypeName];
41296
41352
  if (!Asn1Type) {
41297
41353
  throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`);
41298
41354
  }
@@ -41303,22 +41359,22 @@ var require_schema = __commonJS({
41303
41359
  } else if (item.optional) {
41304
41360
  const itemSchema = this.get(item.type);
41305
41361
  if (itemSchema.type === enums_1.AsnTypeTypes.Choice) {
41306
- asn1Item = new asn1js3.Any({ name });
41362
+ asn1Item = new asn1js4.Any({ name });
41307
41363
  } else {
41308
41364
  asn1Item = this.create(item.type, false);
41309
41365
  asn1Item.name = name;
41310
41366
  }
41311
41367
  } else {
41312
- asn1Item = new asn1js3.Any({ name });
41368
+ asn1Item = new asn1js4.Any({ name });
41313
41369
  }
41314
41370
  const optional2 = !!item.optional || item.defaultValue !== void 0;
41315
41371
  if (item.repeated) {
41316
41372
  asn1Item.name = "";
41317
- const Container = item.repeated === "set" ? asn1js3.Set : asn1js3.Sequence;
41373
+ const Container = item.repeated === "set" ? asn1js4.Set : asn1js4.Sequence;
41318
41374
  asn1Item = new Container({
41319
41375
  name: "",
41320
41376
  value: [
41321
- new asn1js3.Repeated({
41377
+ new asn1js4.Repeated({
41322
41378
  name,
41323
41379
  value: asn1Item
41324
41380
  })
@@ -41328,7 +41384,7 @@ var require_schema = __commonJS({
41328
41384
  if (item.context !== null && item.context !== void 0) {
41329
41385
  if (item.implicit) {
41330
41386
  if (typeof item.type === "number" || (0, helper_1.isConvertible)(item.type)) {
41331
- const Container = item.repeated ? asn1js3.Constructed : asn1js3.Primitive;
41387
+ const Container = item.repeated ? asn1js4.Constructed : asn1js4.Primitive;
41332
41388
  asn1Value.push(new Container({
41333
41389
  name,
41334
41390
  optional: optional2,
@@ -41342,7 +41398,7 @@ var require_schema = __commonJS({
41342
41398
  const isRepeated = !!item.repeated;
41343
41399
  let value = !isRepeated ? this.get(item.type, true).schema : asn1Item;
41344
41400
  value = "valueBlock" in value ? value.valueBlock.value : value.value;
41345
- asn1Value.push(new asn1js3.Constructed({
41401
+ asn1Value.push(new asn1js4.Constructed({
41346
41402
  name: !isRepeated ? name : "",
41347
41403
  optional: optional2,
41348
41404
  idBlock: {
@@ -41353,7 +41409,7 @@ var require_schema = __commonJS({
41353
41409
  }));
41354
41410
  }
41355
41411
  } else {
41356
- asn1Value.push(new asn1js3.Constructed({
41412
+ asn1Value.push(new asn1js4.Constructed({
41357
41413
  optional: optional2,
41358
41414
  idBlock: {
41359
41415
  tagClass: 3,
@@ -41369,17 +41425,17 @@ var require_schema = __commonJS({
41369
41425
  }
41370
41426
  switch (schema.type) {
41371
41427
  case enums_1.AsnTypeTypes.Sequence:
41372
- return new asn1js3.Sequence({
41428
+ return new asn1js4.Sequence({
41373
41429
  value: asn1Value,
41374
41430
  name: ""
41375
41431
  });
41376
41432
  case enums_1.AsnTypeTypes.Set:
41377
- return new asn1js3.Set({
41433
+ return new asn1js4.Set({
41378
41434
  value: asn1Value,
41379
41435
  name: ""
41380
41436
  });
41381
41437
  case enums_1.AsnTypeTypes.Choice:
41382
- return new asn1js3.Choice({
41438
+ return new asn1js4.Choice({
41383
41439
  value: asn1Value,
41384
41440
  name: ""
41385
41441
  });
@@ -41501,7 +41557,7 @@ var require_parser = __commonJS({
41501
41557
  Object.defineProperty(exports, "__esModule", { value: true });
41502
41558
  exports.AsnParser = void 0;
41503
41559
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
41504
- var asn1js3 = tslib_1.__importStar(require_build2());
41560
+ var asn1js4 = tslib_1.__importStar(require_build2());
41505
41561
  var utils_1 = require_cjs2();
41506
41562
  var enums_1 = require_enums();
41507
41563
  var converters = tslib_1.__importStar(require_converters2());
@@ -41510,7 +41566,7 @@ var require_parser = __commonJS({
41510
41566
  var storage_1 = require_storage();
41511
41567
  var AsnParser = class {
41512
41568
  static parse(data, target, options) {
41513
- const asn1Parsed = asn1js3.fromBER((0, utils_1.toArrayBuffer)(data), options?.berOptions);
41569
+ const asn1Parsed = asn1js4.fromBER((0, utils_1.toArrayBuffer)(data), options?.berOptions);
41514
41570
  if (asn1Parsed.result.error) {
41515
41571
  throw new Error(asn1Parsed.result.error);
41516
41572
  }
@@ -41548,14 +41604,14 @@ var require_parser = __commonJS({
41548
41604
  }
41549
41605
  }
41550
41606
  static handleChoiceTypes(asn1Schema, schema, target, targetSchema, options) {
41551
- if (asn1Schema.constructor === asn1js3.Constructed && schema.type === enums_1.AsnTypeTypes.Choice && asn1Schema.idBlock.tagClass === 3) {
41607
+ if (asn1Schema.constructor === asn1js4.Constructed && schema.type === enums_1.AsnTypeTypes.Choice && asn1Schema.idBlock.tagClass === 3) {
41552
41608
  for (const key2 in schema.items) {
41553
41609
  const schemaItem = schema.items[key2];
41554
41610
  if (schemaItem.context === asn1Schema.idBlock.tagNumber && schemaItem.implicit) {
41555
41611
  if (typeof schemaItem.type === "function" && storage_1.schemaStorage.has(schemaItem.type)) {
41556
41612
  const fieldSchema = storage_1.schemaStorage.get(schemaItem.type);
41557
41613
  if (fieldSchema && fieldSchema.type === enums_1.AsnTypeTypes.Sequence) {
41558
- const newSeq = new asn1js3.Sequence();
41614
+ const newSeq = new asn1js4.Sequence();
41559
41615
  if ("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value) && "value" in newSeq.valueBlock) {
41560
41616
  newSeq.valueBlock.value = asn1Schema.valueBlock.value;
41561
41617
  const fieldValue = this.fromASN(newSeq, schemaItem.type, options);
@@ -41567,8 +41623,8 @@ var require_parser = __commonJS({
41567
41623
  }
41568
41624
  }
41569
41625
  }
41570
- } else if (asn1Schema.constructor === asn1js3.Constructed && schema.type !== enums_1.AsnTypeTypes.Choice) {
41571
- const newTargetSchema = new asn1js3.Constructed({
41626
+ } else if (asn1Schema.constructor === asn1js4.Constructed && schema.type !== enums_1.AsnTypeTypes.Choice) {
41627
+ const newTargetSchema = new asn1js4.Constructed({
41572
41628
  idBlock: {
41573
41629
  tagClass: 3,
41574
41630
  tagNumber: asn1Schema.idBlock.tagNumber
@@ -41584,13 +41640,13 @@ var require_parser = __commonJS({
41584
41640
  }
41585
41641
  static handleSequenceTypes(asn1Schema, schema, target, targetSchema) {
41586
41642
  if (schema.type === enums_1.AsnTypeTypes.Sequence) {
41587
- const asn1ComparedSchema = asn1js3.compareSchema({}, asn1Schema, targetSchema);
41643
+ const asn1ComparedSchema = asn1js4.compareSchema({}, asn1Schema, targetSchema);
41588
41644
  if (!asn1ComparedSchema.verified) {
41589
41645
  throw new errors_1.AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : ""}`);
41590
41646
  }
41591
41647
  return asn1ComparedSchema;
41592
41648
  } else {
41593
- const asn1ComparedSchema = asn1js3.compareSchema({}, asn1Schema, targetSchema);
41649
+ const asn1ComparedSchema = asn1js4.compareSchema({}, asn1Schema, targetSchema);
41594
41650
  if (!asn1ComparedSchema.verified) {
41595
41651
  throw new errors_1.AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : ""}`);
41596
41652
  }
@@ -41699,10 +41755,10 @@ var require_parser = __commonJS({
41699
41755
  }
41700
41756
  static processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options) {
41701
41757
  if (schemaItem.implicit) {
41702
- const Container = schemaItem.repeated === "sequence" ? asn1js3.Sequence : asn1js3.Set;
41758
+ const Container = schemaItem.repeated === "sequence" ? asn1js4.Sequence : asn1js4.Set;
41703
41759
  const newItem = new Container();
41704
41760
  newItem.valueBlock = asn1SchemaValue.valueBlock;
41705
- const newItemAsn = asn1js3.fromBER(newItem.toBER(false), options?.berOptions);
41761
+ const newItemAsn = asn1js4.fromBER(newItem.toBER(false), options?.berOptions);
41706
41762
  if (newItemAsn.offset === -1) {
41707
41763
  throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
41708
41764
  }
@@ -41723,14 +41779,14 @@ var require_parser = __commonJS({
41723
41779
  newItem = new schemaItemType().toSchema("");
41724
41780
  } else {
41725
41781
  const Asn1TypeName = enums_1.AsnPropTypes[schemaItemType];
41726
- const Asn1Type = asn1js3[Asn1TypeName];
41782
+ const Asn1Type = asn1js4[Asn1TypeName];
41727
41783
  if (!Asn1Type) {
41728
41784
  throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`);
41729
41785
  }
41730
41786
  newItem = new Asn1Type();
41731
41787
  }
41732
41788
  newItem.valueBlock = value.valueBlock;
41733
- value = asn1js3.fromBER(newItem.toBER(false), options?.berOptions).result;
41789
+ value = asn1js4.fromBER(newItem.toBER(false), options?.berOptions).result;
41734
41790
  }
41735
41791
  return converter.fromASN(value);
41736
41792
  }
@@ -41767,13 +41823,13 @@ var require_parser = __commonJS({
41767
41823
  if (schemaItem.implicit && typeof schemaItem.context === "number") {
41768
41824
  const schema = storage_1.schemaStorage.get(schemaItemType);
41769
41825
  if (schema.type === enums_1.AsnTypeTypes.Sequence) {
41770
- const newSeq = new asn1js3.Sequence();
41826
+ const newSeq = new asn1js4.Sequence();
41771
41827
  if ("value" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && "value" in newSeq.valueBlock) {
41772
41828
  newSeq.valueBlock.value = asn1SchemaValue.valueBlock.value;
41773
41829
  return newSeq;
41774
41830
  }
41775
41831
  } else if (schema.type === enums_1.AsnTypeTypes.Set) {
41776
- const newSet = new asn1js3.Set();
41832
+ const newSet = new asn1js4.Set();
41777
41833
  if ("value" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && "value" in newSet.valueBlock) {
41778
41834
  newSet.valueBlock.value = asn1SchemaValue.valueBlock.value;
41779
41835
  return newSet;
@@ -41794,7 +41850,7 @@ var require_serializer = __commonJS({
41794
41850
  Object.defineProperty(exports, "__esModule", { value: true });
41795
41851
  exports.AsnSerializer = void 0;
41796
41852
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
41797
- var asn1js3 = tslib_1.__importStar(require_build2());
41853
+ var asn1js4 = tslib_1.__importStar(require_build2());
41798
41854
  var utils_1 = require_cjs2();
41799
41855
  var converters = tslib_1.__importStar(require_converters2());
41800
41856
  var enums_1 = require_enums();
@@ -41802,7 +41858,7 @@ var require_serializer = __commonJS({
41802
41858
  var storage_1 = require_storage();
41803
41859
  var AsnSerializer = class _AsnSerializer {
41804
41860
  static serialize(obj) {
41805
- if (obj instanceof asn1js3.BaseBlock) {
41861
+ if (obj instanceof asn1js4.BaseBlock) {
41806
41862
  return obj.toBER(false);
41807
41863
  }
41808
41864
  return this.toASN(obj).toBER(false);
@@ -41843,8 +41899,8 @@ var require_serializer = __commonJS({
41843
41899
  if (schemaItem.implicit) {
41844
41900
  if (!schemaItem.repeated && (typeof schemaItem.type === "number" || (0, helper_1.isConvertible)(schemaItem.type))) {
41845
41901
  const value = {};
41846
- value.valueHex = asn1Item instanceof asn1js3.Null ? (0, utils_1.toArrayBuffer)(asn1Item.valueBeforeDecodeView) : asn1Item.valueBlock.toBER();
41847
- asn1Value.push(new asn1js3.Primitive({
41902
+ value.valueHex = asn1Item instanceof asn1js4.Null ? (0, utils_1.toArrayBuffer)(asn1Item.valueBeforeDecodeView) : asn1Item.valueBlock.toBER();
41903
+ asn1Value.push(new asn1js4.Primitive({
41848
41904
  optional: schemaItem.optional,
41849
41905
  idBlock: {
41850
41906
  tagClass: 3,
@@ -41853,7 +41909,7 @@ var require_serializer = __commonJS({
41853
41909
  ...value
41854
41910
  }));
41855
41911
  } else {
41856
- asn1Value.push(new asn1js3.Constructed({
41912
+ asn1Value.push(new asn1js4.Constructed({
41857
41913
  optional: schemaItem.optional,
41858
41914
  idBlock: {
41859
41915
  tagClass: 3,
@@ -41863,7 +41919,7 @@ var require_serializer = __commonJS({
41863
41919
  }));
41864
41920
  }
41865
41921
  } else {
41866
- asn1Value.push(new asn1js3.Constructed({
41922
+ asn1Value.push(new asn1js4.Constructed({
41867
41923
  optional: schemaItem.optional,
41868
41924
  idBlock: {
41869
41925
  tagClass: 3,
@@ -41882,10 +41938,10 @@ var require_serializer = __commonJS({
41882
41938
  let asnSchema;
41883
41939
  switch (schema.type) {
41884
41940
  case enums_1.AsnTypeTypes.Sequence:
41885
- asnSchema = new asn1js3.Sequence({ value: asn1Value });
41941
+ asnSchema = new asn1js4.Sequence({ value: asn1Value });
41886
41942
  break;
41887
41943
  case enums_1.AsnTypeTypes.Set:
41888
- asnSchema = new asn1js3.Set({ value: asn1Value });
41944
+ asnSchema = new asn1js4.Set({ value: asn1Value });
41889
41945
  break;
41890
41946
  case enums_1.AsnTypeTypes.Choice:
41891
41947
  if (!asn1Value[0]) {
@@ -41908,7 +41964,7 @@ var require_serializer = __commonJS({
41908
41964
  throw new TypeError("Parameter 'objProp' should be type of Array.");
41909
41965
  }
41910
41966
  const items = Array.from(objProp, (element) => converter.toASN(element));
41911
- const Container = schemaItem.repeated === "sequence" ? asn1js3.Sequence : asn1js3.Set;
41967
+ const Container = schemaItem.repeated === "sequence" ? asn1js4.Sequence : asn1js4.Set;
41912
41968
  asn1Item = new Container({ value: items });
41913
41969
  } else {
41914
41970
  asn1Item = converter.toASN(objProp);
@@ -41919,7 +41975,7 @@ var require_serializer = __commonJS({
41919
41975
  throw new TypeError("Parameter 'objProp' should be type of Array.");
41920
41976
  }
41921
41977
  const items = Array.from(objProp, (element) => this.toASN(element));
41922
- const Container = schemaItem.repeated === "sequence" ? asn1js3.Sequence : asn1js3.Set;
41978
+ const Container = schemaItem.repeated === "sequence" ? asn1js4.Sequence : asn1js4.Set;
41923
41979
  asn1Item = new Container({ value: items });
41924
41980
  } else {
41925
41981
  asn1Item = this.toASN(objProp);
@@ -41961,7 +42017,7 @@ var require_convert3 = __commonJS({
41961
42017
  Object.defineProperty(exports, "__esModule", { value: true });
41962
42018
  exports.AsnConvert = void 0;
41963
42019
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
41964
- var asn1js3 = tslib_1.__importStar(require_build2());
42020
+ var asn1js4 = tslib_1.__importStar(require_build2());
41965
42021
  var utils_1 = require_cjs2();
41966
42022
  var parser_1 = require_parser();
41967
42023
  var serializer_1 = require_serializer();
@@ -41974,7 +42030,7 @@ var require_convert3 = __commonJS({
41974
42030
  }
41975
42031
  static toString(data, options) {
41976
42032
  const buf = (0, utils_1.isBufferSource)(data) ? (0, utils_1.toArrayBuffer)(data) : _AsnConvert.serialize(data);
41977
- const asn = asn1js3.fromBER(buf, options?.berOptions);
42033
+ const asn = asn1js4.fromBER(buf, options?.berOptions);
41978
42034
  if (asn.offset === -1) {
41979
42035
  throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
41980
42036
  }
@@ -42312,16 +42368,16 @@ var require_name = __commonJS({
42312
42368
  itemType: RelativeDistinguishedName
42313
42369
  })
42314
42370
  ], RDNSequence);
42315
- var Name = Name_1 = class Name extends RDNSequence {
42371
+ var Name2 = Name_1 = class Name extends RDNSequence {
42316
42372
  constructor(items) {
42317
42373
  super(items);
42318
42374
  Object.setPrototypeOf(this, Name_1.prototype);
42319
42375
  }
42320
42376
  };
42321
- exports.Name = Name;
42322
- exports.Name = Name = Name_1 = tslib_1.__decorate([
42377
+ exports.Name = Name2;
42378
+ exports.Name = Name2 = Name_1 = tslib_1.__decorate([
42323
42379
  (0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
42324
- ], Name);
42380
+ ], Name2);
42325
42381
  }
42326
42382
  });
42327
42383
 
@@ -43732,7 +43788,7 @@ var require_algorithm_identifier = __commonJS({
43732
43788
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
43733
43789
  var asn1_schema_1 = require_cjs3();
43734
43790
  var bytes_1 = require_bytes();
43735
- var AlgorithmIdentifier2 = class _AlgorithmIdentifier {
43791
+ var AlgorithmIdentifier3 = class _AlgorithmIdentifier {
43736
43792
  algorithm = "";
43737
43793
  parameters;
43738
43794
  constructor(params = {}) {
@@ -43742,16 +43798,16 @@ var require_algorithm_identifier = __commonJS({
43742
43798
  return data instanceof _AlgorithmIdentifier && data.algorithm == this.algorithm && (data.parameters && this.parameters && (0, bytes_1.equal)(data.parameters, this.parameters) || data.parameters === this.parameters);
43743
43799
  }
43744
43800
  };
43745
- exports.AlgorithmIdentifier = AlgorithmIdentifier2;
43801
+ exports.AlgorithmIdentifier = AlgorithmIdentifier3;
43746
43802
  tslib_1.__decorate([
43747
43803
  (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
43748
- ], AlgorithmIdentifier2.prototype, "algorithm", void 0);
43804
+ ], AlgorithmIdentifier3.prototype, "algorithm", void 0);
43749
43805
  tslib_1.__decorate([
43750
43806
  (0, asn1_schema_1.AsnProp)({
43751
43807
  type: asn1_schema_1.AsnPropTypes.Any,
43752
43808
  optional: true
43753
43809
  })
43754
- ], AlgorithmIdentifier2.prototype, "parameters", void 0);
43810
+ ], AlgorithmIdentifier3.prototype, "parameters", void 0);
43755
43811
  }
43756
43812
  });
43757
43813
 
@@ -44013,7 +44069,7 @@ var require_certificate = __commonJS({
44013
44069
  var asn1_schema_1 = require_cjs3();
44014
44070
  var algorithm_identifier_1 = require_algorithm_identifier();
44015
44071
  var tbs_certificate_1 = require_tbs_certificate();
44016
- var Certificate4 = class {
44072
+ var Certificate6 = class {
44017
44073
  tbsCertificate = new tbs_certificate_1.TBSCertificate();
44018
44074
  tbsCertificateRaw;
44019
44075
  signatureAlgorithm = new algorithm_identifier_1.AlgorithmIdentifier();
@@ -44022,19 +44078,19 @@ var require_certificate = __commonJS({
44022
44078
  Object.assign(this, params);
44023
44079
  }
44024
44080
  };
44025
- exports.Certificate = Certificate4;
44081
+ exports.Certificate = Certificate6;
44026
44082
  tslib_1.__decorate([
44027
44083
  (0, asn1_schema_1.AsnProp)({
44028
44084
  type: tbs_certificate_1.TBSCertificate,
44029
44085
  raw: true
44030
44086
  })
44031
- ], Certificate4.prototype, "tbsCertificate", void 0);
44087
+ ], Certificate6.prototype, "tbsCertificate", void 0);
44032
44088
  tslib_1.__decorate([
44033
44089
  (0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })
44034
- ], Certificate4.prototype, "signatureAlgorithm", void 0);
44090
+ ], Certificate6.prototype, "signatureAlgorithm", void 0);
44035
44091
  tslib_1.__decorate([
44036
44092
  (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })
44037
- ], Certificate4.prototype, "signatureValue", void 0);
44093
+ ], Certificate6.prototype, "signatureValue", void 0);
44038
44094
  }
44039
44095
  });
44040
44096
 
@@ -44196,23 +44252,23 @@ var require_issuer_and_serial_number = __commonJS({
44196
44252
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
44197
44253
  var asn1_schema_1 = require_cjs3();
44198
44254
  var asn1_x509_1 = require_cjs4();
44199
- var IssuerAndSerialNumber3 = class {
44255
+ var IssuerAndSerialNumber4 = class {
44200
44256
  issuer = new asn1_x509_1.Name();
44201
44257
  serialNumber = new ArrayBuffer(0);
44202
44258
  constructor(params = {}) {
44203
44259
  Object.assign(this, params);
44204
44260
  }
44205
44261
  };
44206
- exports.IssuerAndSerialNumber = IssuerAndSerialNumber3;
44262
+ exports.IssuerAndSerialNumber = IssuerAndSerialNumber4;
44207
44263
  tslib_1.__decorate([
44208
44264
  (0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.Name })
44209
- ], IssuerAndSerialNumber3.prototype, "issuer", void 0);
44265
+ ], IssuerAndSerialNumber4.prototype, "issuer", void 0);
44210
44266
  tslib_1.__decorate([
44211
44267
  (0, asn1_schema_1.AsnProp)({
44212
44268
  type: asn1_schema_1.AsnPropTypes.Integer,
44213
44269
  converter: asn1_schema_1.AsnIntegerArrayBufferConverter
44214
44270
  })
44215
- ], IssuerAndSerialNumber3.prototype, "serialNumber", void 0);
44271
+ ], IssuerAndSerialNumber4.prototype, "serialNumber", void 0);
44216
44272
  }
44217
44273
  });
44218
44274
 
@@ -45375,23 +45431,23 @@ var require_content_info = __commonJS({
45375
45431
  exports.ContentInfo = void 0;
45376
45432
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
45377
45433
  var asn1_schema_1 = require_cjs3();
45378
- var ContentInfo4 = class {
45434
+ var ContentInfo6 = class {
45379
45435
  contentType = "";
45380
45436
  content = new ArrayBuffer(0);
45381
45437
  constructor(params = {}) {
45382
45438
  Object.assign(this, params);
45383
45439
  }
45384
45440
  };
45385
- exports.ContentInfo = ContentInfo4;
45441
+ exports.ContentInfo = ContentInfo6;
45386
45442
  tslib_1.__decorate([
45387
45443
  (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
45388
- ], ContentInfo4.prototype, "contentType", void 0);
45444
+ ], ContentInfo6.prototype, "contentType", void 0);
45389
45445
  tslib_1.__decorate([
45390
45446
  (0, asn1_schema_1.AsnProp)({
45391
45447
  type: asn1_schema_1.AsnPropTypes.Any,
45392
45448
  context: 0
45393
45449
  })
45394
- ], ContentInfo4.prototype, "content", void 0);
45450
+ ], ContentInfo6.prototype, "content", void 0);
45395
45451
  }
45396
45452
  });
45397
45453
 
@@ -46171,7 +46227,7 @@ var require_signed_data = __commonJS({
46171
46227
  itemType: types_1.DigestAlgorithmIdentifier
46172
46228
  })
46173
46229
  ], DigestAlgorithmIdentifiers);
46174
- var SignedData4 = class {
46230
+ var SignedData6 = class {
46175
46231
  version = types_1.CMSVersion.v0;
46176
46232
  digestAlgorithms = new DigestAlgorithmIdentifiers();
46177
46233
  encapContentInfo = new encapsulated_content_info_1.EncapsulatedContentInfo();
@@ -46182,16 +46238,16 @@ var require_signed_data = __commonJS({
46182
46238
  Object.assign(this, params);
46183
46239
  }
46184
46240
  };
46185
- exports.SignedData = SignedData4;
46241
+ exports.SignedData = SignedData6;
46186
46242
  tslib_1.__decorate([
46187
46243
  (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
46188
- ], SignedData4.prototype, "version", void 0);
46244
+ ], SignedData6.prototype, "version", void 0);
46189
46245
  tslib_1.__decorate([
46190
46246
  (0, asn1_schema_1.AsnProp)({ type: DigestAlgorithmIdentifiers })
46191
- ], SignedData4.prototype, "digestAlgorithms", void 0);
46247
+ ], SignedData6.prototype, "digestAlgorithms", void 0);
46192
46248
  tslib_1.__decorate([
46193
46249
  (0, asn1_schema_1.AsnProp)({ type: encapsulated_content_info_1.EncapsulatedContentInfo })
46194
- ], SignedData4.prototype, "encapContentInfo", void 0);
46250
+ ], SignedData6.prototype, "encapContentInfo", void 0);
46195
46251
  tslib_1.__decorate([
46196
46252
  (0, asn1_schema_1.AsnProp)({
46197
46253
  type: certificate_choices_1.CertificateSet,
@@ -46199,7 +46255,7 @@ var require_signed_data = __commonJS({
46199
46255
  implicit: true,
46200
46256
  optional: true
46201
46257
  })
46202
- ], SignedData4.prototype, "certificates", void 0);
46258
+ ], SignedData6.prototype, "certificates", void 0);
46203
46259
  tslib_1.__decorate([
46204
46260
  (0, asn1_schema_1.AsnProp)({
46205
46261
  type: revocation_info_choice_1.RevocationInfoChoices,
@@ -46207,10 +46263,10 @@ var require_signed_data = __commonJS({
46207
46263
  implicit: true,
46208
46264
  optional: true
46209
46265
  })
46210
- ], SignedData4.prototype, "crls", void 0);
46266
+ ], SignedData6.prototype, "crls", void 0);
46211
46267
  tslib_1.__decorate([
46212
46268
  (0, asn1_schema_1.AsnProp)({ type: signer_info_1.SignerInfos })
46213
- ], SignedData4.prototype, "signerInfos", void 0);
46269
+ ], SignedData6.prototype, "signerInfos", void 0);
46214
46270
  }
46215
46271
  });
46216
46272
 
@@ -50106,7 +50162,7 @@ var require_x509_cjs = __commonJS({
50106
50162
  function escape2(data) {
50107
50163
  return data.replace(/([,+"\\<>;])/g, "\\$1").replace(/^([ #])/, "\\$1").replace(/([ ]$)/, "\\$1").replace(/([\r\n\t])/, replaceUnknownCharacter);
50108
50164
  }
50109
- var Name = class _Name {
50165
+ var Name2 = class _Name {
50110
50166
  static isASCII(text) {
50111
50167
  for (let i = 0; i < text.length; i++) {
50112
50168
  const code = text.charCodeAt(i);
@@ -50306,7 +50362,7 @@ var require_x509_cjs = __commonJS({
50306
50362
  if (args.length === 2) {
50307
50363
  switch (args[0]) {
50308
50364
  case DN: {
50309
- const derName = new Name(args[1]).toArrayBuffer();
50365
+ const derName = new Name2(args[1]).toArrayBuffer();
50310
50366
  const asnName = asn1Schema.AsnConvert.parse(derName, asn1X509__namespace.Name);
50311
50367
  name = new asn1X509__namespace.GeneralName({ directoryName: asnName });
50312
50368
  break;
@@ -50382,7 +50438,7 @@ var require_x509_cjs = __commonJS({
50382
50438
  this.value = asn.registeredID;
50383
50439
  } else if (asn.directoryName != void 0) {
50384
50440
  this.type = DN;
50385
- this.value = new Name(asn.directoryName).toString();
50441
+ this.value = new Name2(asn.directoryName).toString();
50386
50442
  } else if (asn.otherName != void 0) {
50387
50443
  if (asn.otherName.typeId === id_GUID) {
50388
50444
  this.type = GUID;
@@ -50874,7 +50930,7 @@ var require_x509_cjs = __commonJS({
50874
50930
  ExtendedKeyUsage["timeStamping"] = "1.3.6.1.5.5.7.3.8";
50875
50931
  ExtendedKeyUsage["ocspSigning"] = "1.3.6.1.5.5.7.3.9";
50876
50932
  })(exports.ExtendedKeyUsage || (exports.ExtendedKeyUsage = {}));
50877
- var ExtendedKeyUsageExtension = class extends Extension {
50933
+ var ExtendedKeyUsageExtension2 = class extends Extension {
50878
50934
  constructor(...args) {
50879
50935
  if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) {
50880
50936
  super(args[0], args[1]);
@@ -50892,7 +50948,7 @@ var require_x509_cjs = __commonJS({
50892
50948
  return obj;
50893
50949
  }
50894
50950
  };
50895
- ExtendedKeyUsageExtension.NAME = "Extended Key Usages";
50951
+ ExtendedKeyUsageExtension2.NAME = "Extended Key Usages";
50896
50952
  exports.KeyUsageFlags = void 0;
50897
50953
  (function(KeyUsageFlags) {
50898
50954
  KeyUsageFlags[KeyUsageFlags["digitalSignature"] = 1] = "digitalSignature";
@@ -51697,7 +51753,7 @@ var require_x509_cjs = __commonJS({
51697
51753
  var Pkcs10CertificateRequest = class extends PemData {
51698
51754
  get subjectName() {
51699
51755
  if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subjectName, "f")) {
51700
- tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_subjectName, new Name(this.asn.certificationRequestInfo.subject), "f");
51756
+ tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_subjectName, new Name2(this.asn.certificationRequestInfo.subject), "f");
51701
51757
  }
51702
51758
  return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subjectName, "f");
51703
51759
  }
@@ -51847,7 +51903,7 @@ var require_x509_cjs = __commonJS({
51847
51903
  })
51848
51904
  });
51849
51905
  if (params.name) {
51850
- const name = params.name instanceof Name ? params.name : new Name(params.name);
51906
+ const name = params.name instanceof Name2 ? params.name : new Name2(params.name);
51851
51907
  asnReq.certificationRequestInfo.subject = asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509.Name);
51852
51908
  }
51853
51909
  if (params.attributes) {
@@ -51931,7 +51987,7 @@ var require_x509_cjs = __commonJS({
51931
51987
  var _X509Certificate_signature;
51932
51988
  var _X509Certificate_extensions;
51933
51989
  var _X509Certificate_publicKey;
51934
- var X509Certificate3 = class extends PemData {
51990
+ var X509Certificate4 = class extends PemData {
51935
51991
  get publicKey() {
51936
51992
  if (!tslib.__classPrivateFieldGet(this, _X509Certificate_publicKey, "f")) {
51937
51993
  tslib.__classPrivateFieldSet(this, _X509Certificate_publicKey, new PublicKey(this.asn.tbsCertificate.subjectPublicKeyInfo, this.parseOptions), "f");
@@ -51946,7 +52002,7 @@ var require_x509_cjs = __commonJS({
51946
52002
  }
51947
52003
  get subjectName() {
51948
52004
  if (!tslib.__classPrivateFieldGet(this, _X509Certificate_subjectName, "f")) {
51949
- tslib.__classPrivateFieldSet(this, _X509Certificate_subjectName, new Name(this.asn.tbsCertificate.subject), "f");
52005
+ tslib.__classPrivateFieldSet(this, _X509Certificate_subjectName, new Name2(this.asn.tbsCertificate.subject), "f");
51950
52006
  }
51951
52007
  return tslib.__classPrivateFieldGet(this, _X509Certificate_subjectName, "f");
51952
52008
  }
@@ -51958,7 +52014,7 @@ var require_x509_cjs = __commonJS({
51958
52014
  }
51959
52015
  get issuerName() {
51960
52016
  if (!tslib.__classPrivateFieldGet(this, _X509Certificate_issuerName, "f")) {
51961
- tslib.__classPrivateFieldSet(this, _X509Certificate_issuerName, new Name(this.asn.tbsCertificate.issuer), "f");
52017
+ tslib.__classPrivateFieldSet(this, _X509Certificate_issuerName, new Name2(this.asn.tbsCertificate.issuer), "f");
51962
52018
  }
51963
52019
  return tslib.__classPrivateFieldGet(this, _X509Certificate_issuerName, "f");
51964
52020
  }
@@ -52174,7 +52230,7 @@ var require_x509_cjs = __commonJS({
52174
52230
  }
52175
52231
  };
52176
52232
  _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();
52177
- X509Certificate3.NAME = "Certificate";
52233
+ X509Certificate4.NAME = "Certificate";
52178
52234
  var _X509Certificates_options;
52179
52235
  var X509Certificates = class extends Array {
52180
52236
  constructor(param, options) {
@@ -52182,7 +52238,7 @@ var require_x509_cjs = __commonJS({
52182
52238
  _X509Certificates_options.set(this, void 0);
52183
52239
  if (PemData.isAsnEncoded(param)) {
52184
52240
  this.import(param, options);
52185
- } else if (param instanceof X509Certificate3) {
52241
+ } else if (param instanceof X509Certificate4) {
52186
52242
  this.push(param);
52187
52243
  } else if (Array.isArray(param)) {
52188
52244
  for (const item of param) {
@@ -52220,7 +52276,7 @@ var require_x509_cjs = __commonJS({
52220
52276
  const certificates = [];
52221
52277
  for (const item of signedData.certificates || []) {
52222
52278
  if (item.certificate) {
52223
- certificates.push(new X509Certificate3(item.certificate, options));
52279
+ certificates.push(new X509Certificate4(item.certificate, options));
52224
52280
  }
52225
52281
  }
52226
52282
  this.clear();
@@ -52380,11 +52436,11 @@ var require_x509_cjs = __commonJS({
52380
52436
  })
52381
52437
  });
52382
52438
  if (params.subject) {
52383
- const name = params.subject instanceof Name ? params.subject : new Name(params.subject);
52439
+ const name = params.subject instanceof Name2 ? params.subject : new Name2(params.subject);
52384
52440
  asnX509.tbsCertificate.subject = asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509__namespace.Name);
52385
52441
  }
52386
52442
  if (params.issuer) {
52387
- const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer);
52443
+ const name = params.issuer instanceof Name2 ? params.issuer : new Name2(params.issuer);
52388
52444
  asnX509.tbsCertificate.issuer = asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509__namespace.Name);
52389
52445
  }
52390
52446
  const defaultSigningAlgorithm = { hash: "SHA-256" };
@@ -52412,7 +52468,7 @@ var require_x509_cjs = __commonJS({
52412
52468
  throw Error("Cannot convert ASN.1 signature value to WebCrypto format");
52413
52469
  }
52414
52470
  asnX509.signatureValue = asnSignature;
52415
- return new X509Certificate3(asn1Schema.AsnConvert.serialize(asnX509));
52471
+ return new X509Certificate4(asn1Schema.AsnConvert.serialize(asnX509));
52416
52472
  }
52417
52473
  };
52418
52474
  var _X509CrlEntry_serialNumber;
@@ -52520,7 +52576,7 @@ var require_x509_cjs = __commonJS({
52520
52576
  var _X509Crl_nextUpdate;
52521
52577
  var _X509Crl_entries;
52522
52578
  var _X509Crl_extensions;
52523
- var X509Crl2 = class extends PemData {
52579
+ var X509Crl = class extends PemData {
52524
52580
  get version() {
52525
52581
  return this.asn.tbsCertList.version;
52526
52582
  }
@@ -52539,7 +52595,7 @@ var require_x509_cjs = __commonJS({
52539
52595
  }
52540
52596
  get issuerName() {
52541
52597
  if (!tslib.__classPrivateFieldGet(this, _X509Crl_issuerName, "f")) {
52542
- tslib.__classPrivateFieldSet(this, _X509Crl_issuerName, new Name(this.asn.tbsCertList.issuer), "f");
52598
+ tslib.__classPrivateFieldSet(this, _X509Crl_issuerName, new Name2(this.asn.tbsCertList.issuer), "f");
52543
52599
  }
52544
52600
  return tslib.__classPrivateFieldGet(this, _X509Crl_issuerName, "f");
52545
52601
  }
@@ -52633,7 +52689,7 @@ var require_x509_cjs = __commonJS({
52633
52689
  let publicKey;
52634
52690
  const paramsKey = params.publicKey;
52635
52691
  try {
52636
- if (paramsKey instanceof X509Certificate3) {
52692
+ if (paramsKey instanceof X509Certificate4) {
52637
52693
  keyAlgorithm = {
52638
52694
  ...paramsKey.publicKey.algorithm,
52639
52695
  ...paramsKey.signatureAlgorithm
@@ -52697,7 +52753,7 @@ var require_x509_cjs = __commonJS({
52697
52753
  var X509CrlGenerator = class {
52698
52754
  static async create(params, crypto3 = cryptoProvider.get()) {
52699
52755
  var _a4;
52700
- const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer);
52756
+ const name = params.issuer instanceof Name2 ? params.issuer : new Name2(params.issuer);
52701
52757
  const asnX509Crl = new asn1X509__namespace.CertificateList({
52702
52758
  tbsCertList: new asn1X509__namespace.TBSCertList({
52703
52759
  version: asn1X509__namespace.Version.v2,
@@ -52744,7 +52800,7 @@ var require_x509_cjs = __commonJS({
52744
52800
  }));
52745
52801
  }
52746
52802
  if (entry.issuer) {
52747
- const name2 = params.issuer instanceof Name ? params.issuer : new Name(params.issuer);
52803
+ const name2 = params.issuer instanceof Name2 ? params.issuer : new Name2(params.issuer);
52748
52804
  revokedCert.crlEntryExtensions.push(new asn1X509__namespace.Extension({
52749
52805
  extnID: asn1X509__namespace.id_ce_certificateIssuer,
52750
52806
  critical: false,
@@ -52775,11 +52831,11 @@ var require_x509_cjs = __commonJS({
52775
52831
  throw Error("Cannot convert ASN.1 signature value to WebCrypto format");
52776
52832
  }
52777
52833
  asnX509Crl.signature = asnSignature;
52778
- return new X509Crl2(asn1Schema.AsnConvert.serialize(asnX509Crl));
52834
+ return new X509Crl(asn1Schema.AsnConvert.serialize(asnX509Crl));
52779
52835
  }
52780
52836
  };
52781
52837
  ExtensionFactory.register(asn1X509__namespace.id_ce_basicConstraints, BasicConstraintsExtension);
52782
- ExtensionFactory.register(asn1X509__namespace.id_ce_extKeyUsage, ExtendedKeyUsageExtension);
52838
+ ExtensionFactory.register(asn1X509__namespace.id_ce_extKeyUsage, ExtendedKeyUsageExtension2);
52783
52839
  ExtensionFactory.register(asn1X509__namespace.id_ce_keyUsage, KeyUsagesExtension);
52784
52840
  ExtensionFactory.register(asn1X509__namespace.id_ce_subjectKeyIdentifier, SubjectKeyIdentifierExtension);
52785
52841
  ExtensionFactory.register(asn1X509__namespace.id_ce_authorityKeyIdentifier, AuthorityKeyIdentifierExtension);
@@ -52812,7 +52868,7 @@ var require_x509_cjs = __commonJS({
52812
52868
  exports.DNS = DNS;
52813
52869
  exports.DefaultAlgorithmSerializer = DefaultAlgorithmSerializer;
52814
52870
  exports.EMAIL = EMAIL;
52815
- exports.ExtendedKeyUsageExtension = ExtendedKeyUsageExtension;
52871
+ exports.ExtendedKeyUsageExtension = ExtendedKeyUsageExtension2;
52816
52872
  exports.Extension = Extension;
52817
52873
  exports.ExtensionFactory = ExtensionFactory;
52818
52874
  exports.ExtensionsAttribute = ExtensionsAttribute;
@@ -52822,7 +52878,7 @@ var require_x509_cjs = __commonJS({
52822
52878
  exports.IP = IP;
52823
52879
  exports.IssuerAlternativeNameExtension = IssuerAlternativeNameExtension;
52824
52880
  exports.KeyUsagesExtension = KeyUsagesExtension;
52825
- exports.Name = Name;
52881
+ exports.Name = Name2;
52826
52882
  exports.NameIdentifier = NameIdentifier;
52827
52883
  exports.OidSerializer = OidSerializer;
52828
52884
  exports.PemConverter = PemConverter;
@@ -52837,11 +52893,11 @@ var require_x509_cjs = __commonJS({
52837
52893
  exports.TextObject = TextObject;
52838
52894
  exports.UPN = UPN;
52839
52895
  exports.URL = URL2;
52840
- exports.X509Certificate = X509Certificate3;
52896
+ exports.X509Certificate = X509Certificate4;
52841
52897
  exports.X509CertificateGenerator = X509CertificateGenerator;
52842
52898
  exports.X509Certificates = X509Certificates;
52843
52899
  exports.X509ChainBuilder = X509ChainBuilder;
52844
- exports.X509Crl = X509Crl2;
52900
+ exports.X509Crl = X509Crl;
52845
52901
  exports.X509CrlEntry = X509CrlEntry;
52846
52902
  exports.X509CrlGenerator = X509CrlGenerator;
52847
52903
  exports.cryptoProvider = cryptoProvider;
@@ -52855,9 +52911,9 @@ var require_x509_cjs = __commonJS({
52855
52911
  }
52856
52912
  });
52857
52913
 
52858
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/forge.js
52914
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/forge.js
52859
52915
  var require_forge = __commonJS({
52860
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/forge.js"(exports, module) {
52916
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/forge.js"(exports, module) {
52861
52917
  "use strict";
52862
52918
  module.exports = {
52863
52919
  // default options
@@ -52868,9 +52924,9 @@ var require_forge = __commonJS({
52868
52924
  }
52869
52925
  });
52870
52926
 
52871
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/baseN.js
52927
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/baseN.js
52872
52928
  var require_baseN = __commonJS({
52873
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/baseN.js"(exports, module) {
52929
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/baseN.js"(exports, module) {
52874
52930
  "use strict";
52875
52931
  var api = {};
52876
52932
  module.exports = api;
@@ -52983,9 +53039,9 @@ var require_baseN = __commonJS({
52983
53039
  }
52984
53040
  });
52985
53041
 
52986
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/util.js
53042
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/util.js
52987
53043
  var require_util2 = __commonJS({
52988
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/util.js"(exports, module) {
53044
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/util.js"(exports, module) {
52989
53045
  "use strict";
52990
53046
  var forge2 = require_forge();
52991
53047
  var baseN = require_baseN();
@@ -54365,9 +54421,9 @@ var require_util2 = __commonJS({
54365
54421
  }
54366
54422
  });
54367
54423
 
54368
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipher.js
54424
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/cipher.js
54369
54425
  var require_cipher = __commonJS({
54370
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipher.js"(exports, module) {
54426
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/cipher.js"(exports, module) {
54371
54427
  "use strict";
54372
54428
  var forge2 = require_forge();
54373
54429
  require_util2();
@@ -54483,9 +54539,9 @@ var require_cipher = __commonJS({
54483
54539
  }
54484
54540
  });
54485
54541
 
54486
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipherModes.js
54542
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/cipherModes.js
54487
54543
  var require_cipherModes = __commonJS({
54488
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipherModes.js"(exports, module) {
54544
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/cipherModes.js"(exports, module) {
54489
54545
  "use strict";
54490
54546
  var forge2 = require_forge();
54491
54547
  require_util2();
@@ -54536,10 +54592,18 @@ var require_cipherModes = __commonJS({
54536
54592
  return false;
54537
54593
  }
54538
54594
  var len = output2.length();
54595
+ if (len === 0) {
54596
+ return true;
54597
+ }
54539
54598
  var count = output2.at(len - 1);
54540
- if (count > this.blockSize << 2) {
54599
+ if (count === 0 || count > this.blockSize || count > len) {
54541
54600
  return false;
54542
54601
  }
54602
+ for (var i = 2; i <= count; ++i) {
54603
+ if (output2.at(len - i) !== count) {
54604
+ return false;
54605
+ }
54606
+ }
54543
54607
  output2.truncate(count);
54544
54608
  return true;
54545
54609
  };
@@ -54601,10 +54665,18 @@ var require_cipherModes = __commonJS({
54601
54665
  return false;
54602
54666
  }
54603
54667
  var len = output2.length();
54668
+ if (len === 0) {
54669
+ return true;
54670
+ }
54604
54671
  var count = output2.at(len - 1);
54605
- if (count > this.blockSize << 2) {
54672
+ if (count === 0 || count > this.blockSize || count > len) {
54606
54673
  return false;
54607
54674
  }
54675
+ for (var i = 2; i <= count; ++i) {
54676
+ if (output2.at(len - i) !== count) {
54677
+ return false;
54678
+ }
54679
+ }
54608
54680
  output2.truncate(count);
54609
54681
  return true;
54610
54682
  };
@@ -54862,11 +54934,14 @@ var require_cipherModes = __commonJS({
54862
54934
  } else {
54863
54935
  additionalData = forge2.util.createBuffer();
54864
54936
  }
54865
- if ("tagLength" in options) {
54866
- this._tagLength = options.tagLength;
54937
+ if (options.tagLength !== void 0 && options.tagLength !== null) {
54938
+ this._tagLength = Number(options.tagLength);
54867
54939
  } else {
54868
54940
  this._tagLength = 128;
54869
54941
  }
54942
+ if ([128, 120, 112, 104, 96, 64, 32].indexOf(this._tagLength) === -1) {
54943
+ throw new Error("Invalid tag length.");
54944
+ }
54870
54945
  this._tag = null;
54871
54946
  if (options.decrypt) {
54872
54947
  this._tag = forge2.util.createBuffer(options.tag).getBytes();
@@ -55134,9 +55209,9 @@ var require_cipherModes = __commonJS({
55134
55209
  }
55135
55210
  });
55136
55211
 
55137
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aes.js
55212
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/aes.js
55138
55213
  var require_aes = __commonJS({
55139
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aes.js"(exports, module) {
55214
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/aes.js"(exports, module) {
55140
55215
  "use strict";
55141
55216
  var forge2 = require_forge();
55142
55217
  require_cipher();
@@ -55410,9 +55485,9 @@ var require_aes = __commonJS({
55410
55485
  }
55411
55486
  });
55412
55487
 
55413
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/oids.js
55488
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/oids.js
55414
55489
  var require_oids = __commonJS({
55415
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/oids.js"(exports, module) {
55490
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/oids.js"(exports, module) {
55416
55491
  "use strict";
55417
55492
  var forge2 = require_forge();
55418
55493
  forge2.pki = forge2.pki || {};
@@ -55556,9 +55631,9 @@ var require_oids = __commonJS({
55556
55631
  }
55557
55632
  });
55558
55633
 
55559
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1.js
55634
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/asn1.js
55560
55635
  var require_asn1 = __commonJS({
55561
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1.js"(exports, module) {
55636
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/asn1.js"(exports, module) {
55562
55637
  "use strict";
55563
55638
  var forge2 = require_forge();
55564
55639
  require_util2();
@@ -55820,7 +55895,10 @@ var require_asn1 = __commonJS({
55820
55895
  var subOptions = {
55821
55896
  // enforce strict mode to avoid parsing ASN.1 from plain data
55822
55897
  strict: true,
55823
- decodeBitStrings: true
55898
+ // only decode one level of BIT STRINGs, nested decoding has
55899
+ // quadratic cost due to copies for change detection
55900
+ decodeBitStrings: false,
55901
+ maxDepth: options.maxDepth
55824
55902
  };
55825
55903
  var composed = _fromDer(bytes, remaining, depth + 1, subOptions);
55826
55904
  var used = start - bytes.length();
@@ -55924,12 +56002,16 @@ var require_asn1 = __commonJS({
55924
56002
  asn1.oidToDer = function(oid) {
55925
56003
  var values = oid.split(".");
55926
56004
  var bytes = forge2.util.createBuffer();
55927
- bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10));
56005
+ var first = parseInt(values[0], 10);
56006
+ var second = parseInt(values[1], 10);
56007
+ if (!(first >= 0 && first <= 2 && second >= 0) || first < 2 && second > 39) {
56008
+ throw new Error("Invalid OID; the first two arcs are out of range.");
56009
+ }
55928
56010
  var last, valueBytes, value, b;
55929
- for (var i = 2; i < values.length; ++i) {
56011
+ for (var i = 1; i < values.length; ++i) {
55930
56012
  last = true;
55931
56013
  valueBytes = [];
55932
- value = parseInt(values[i], 10);
56014
+ value = i === 1 ? 40 * first + second : parseInt(values[i], 10);
55933
56015
  if (value > 4294967295) {
55934
56016
  throw new Error("OID value too large; max is 32-bits.");
55935
56017
  }
@@ -55953,9 +56035,9 @@ var require_asn1 = __commonJS({
55953
56035
  if (typeof bytes === "string") {
55954
56036
  bytes = forge2.util.createBuffer(bytes);
55955
56037
  }
55956
- var b = bytes.getByte();
55957
- oid = Math.floor(b / 40) + "." + b % 40;
56038
+ var b;
55958
56039
  var value = 0;
56040
+ var first = true;
55959
56041
  while (bytes.length() > 0) {
55960
56042
  if (value > 70368744177663) {
55961
56043
  throw new Error("OID value too large; max is 53-bits.");
@@ -55965,7 +56047,13 @@ var require_asn1 = __commonJS({
55965
56047
  if (b & 128) {
55966
56048
  value += b & 127;
55967
56049
  } else {
55968
- oid += "." + (value + b);
56050
+ value += b;
56051
+ if (first) {
56052
+ oid = value < 80 ? Math.floor(value / 40) + "." + value % 40 : "2." + (value - 80);
56053
+ first = false;
56054
+ } else {
56055
+ oid += "." + value;
56056
+ }
55969
56057
  value = 0;
55970
56058
  }
55971
56059
  }
@@ -56376,9 +56464,9 @@ var require_asn1 = __commonJS({
56376
56464
  }
56377
56465
  });
56378
56466
 
56379
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.js
56467
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/md.js
56380
56468
  var require_md2 = __commonJS({
56381
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.js"(exports, module) {
56469
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/md.js"(exports, module) {
56382
56470
  "use strict";
56383
56471
  var forge2 = require_forge();
56384
56472
  module.exports = forge2.md = forge2.md || {};
@@ -56386,9 +56474,9 @@ var require_md2 = __commonJS({
56386
56474
  }
56387
56475
  });
56388
56476
 
56389
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/hmac.js
56477
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/hmac.js
56390
56478
  var require_hmac = __commonJS({
56391
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/hmac.js"(exports, module) {
56479
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/hmac.js"(exports, module) {
56392
56480
  "use strict";
56393
56481
  var forge2 = require_forge();
56394
56482
  require_md2();
@@ -56469,9 +56557,9 @@ var require_hmac = __commonJS({
56469
56557
  }
56470
56558
  });
56471
56559
 
56472
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md5.js
56560
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/md5.js
56473
56561
  var require_md5 = __commonJS({
56474
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md5.js"(exports, module) {
56562
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/md5.js"(exports, module) {
56475
56563
  "use strict";
56476
56564
  var forge2 = require_forge();
56477
56565
  require_md2();
@@ -56762,9 +56850,9 @@ var require_md5 = __commonJS({
56762
56850
  }
56763
56851
  });
56764
56852
 
56765
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pem.js
56853
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pem.js
56766
56854
  var require_pem3 = __commonJS({
56767
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pem.js"(exports, module) {
56855
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pem.js"(exports, module) {
56768
56856
  "use strict";
56769
56857
  var forge2 = require_forge();
56770
56858
  require_util2();
@@ -56805,12 +56893,12 @@ var require_pem3 = __commonJS({
56805
56893
  };
56806
56894
  pem.decode = function(str) {
56807
56895
  var rval = [];
56808
- var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g;
56809
- var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/;
56896
+ var messages = _pemMessageScanner(str);
56897
+ var rHeader = /(?:^|[^\x21-\x7e])([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/;
56810
56898
  var rCRLF = /\r?\n/;
56811
56899
  var match;
56812
56900
  while (true) {
56813
- match = rMessage.exec(str);
56901
+ match = messages.next();
56814
56902
  if (!match) {
56815
56903
  break;
56816
56904
  }
@@ -56833,7 +56921,7 @@ var require_pem3 = __commonJS({
56833
56921
  var lines = match[2].split(rCRLF);
56834
56922
  var li = 0;
56835
56923
  while (match && li < lines.length) {
56836
- var line = lines[li].replace(/\s+$/, "");
56924
+ var line = rtrim(lines[li]);
56837
56925
  for (var nl = li + 1; nl < lines.length; ++nl) {
56838
56926
  var next = lines[nl];
56839
56927
  if (!/\s/.test(next[0])) {
@@ -56911,12 +56999,146 @@ var require_pem3 = __commonJS({
56911
56999
  function ltrim(str) {
56912
57000
  return str.replace(/^\s+/, "");
56913
57001
  }
57002
+ function rtrim(str) {
57003
+ var end = str.length;
57004
+ while (end > 0 && /\s/.test(str.charAt(end - 1))) {
57005
+ --end;
57006
+ }
57007
+ return str.substring(0, end);
57008
+ }
57009
+ function _pemMessageScanner(str) {
57010
+ var rBody = /[:A-Za-z0-9+\/=\s]/;
57011
+ var rNotBody = /[^:A-Za-z0-9+\/=\s]/g;
57012
+ var rNotHeader = /[^\x21-\x7e\s]/g;
57013
+ var rLabel = /[A-Z0-9- ]/;
57014
+ function indexOfRegex(regex, i) {
57015
+ regex.lastIndex = i;
57016
+ var match = regex.exec(str);
57017
+ return match ? match.index : str.length;
57018
+ }
57019
+ function labelAt(i) {
57020
+ for (var j = i; j < str.length && rLabel.test(str.charAt(j)); ++j) {
57021
+ if (j > i && str.substr(j, 5) === "-----") {
57022
+ return str.substring(i, j);
57023
+ }
57024
+ }
57025
+ return null;
57026
+ }
57027
+ function blankLineEnd(i) {
57028
+ if (str.charAt(i) === "\r") {
57029
+ ++i;
57030
+ }
57031
+ if (str.charAt(i) !== "\n") {
57032
+ return -1;
57033
+ }
57034
+ if (str.charAt(++i) === "\r") {
57035
+ ++i;
57036
+ }
57037
+ return str.charAt(i) === "\n" ? i + 1 : -1;
57038
+ }
57039
+ function firstBlankLine(start2, end2) {
57040
+ for (var i = start2; i < end2; ++i) {
57041
+ var v = blankLineEnd(i);
57042
+ if (v !== -1 && v < end2) {
57043
+ return i;
57044
+ }
57045
+ }
57046
+ return -1;
57047
+ }
57048
+ var ends = {};
57049
+ for (var end = str.indexOf("-----END "); end !== -1; end = str.indexOf("-----END ", end + 1)) {
57050
+ var endLabel = labelAt(end + 9);
57051
+ var start = end;
57052
+ while (start > 0 && rBody.test(str.charAt(start - 1))) {
57053
+ --start;
57054
+ }
57055
+ var blank = firstBlankLine(start, end);
57056
+ if (endLabel !== null && blank !== -1) {
57057
+ var key2 = "$" + endLabel;
57058
+ (ends[key2] = ends[key2] || []).push({ end, blank });
57059
+ }
57060
+ }
57061
+ var pos = 0;
57062
+ var headerEnd = -1;
57063
+ return {
57064
+ next: function() {
57065
+ var begin;
57066
+ while ((begin = str.indexOf("-----BEGIN ", pos)) !== -1) {
57067
+ pos = begin + 1;
57068
+ var label = labelAt(begin + 11);
57069
+ if (label === null) {
57070
+ continue;
57071
+ }
57072
+ var q = begin + 16 + label.length;
57073
+ var bodyEnd = indexOfRegex(rNotBody, q);
57074
+ var bodyEndOk = str.substr(bodyEnd, 9) === "-----END " && labelAt(bodyEnd + 9) === label;
57075
+ if (q > headerEnd) {
57076
+ headerEnd = indexOfRegex(rNotHeader, q);
57077
+ }
57078
+ var later = null;
57079
+ var list = ends["$" + label];
57080
+ if (list) {
57081
+ var lo = 0;
57082
+ var hi = list.length;
57083
+ while (lo < hi) {
57084
+ var mid = lo + hi >> 1;
57085
+ if (list[mid].end > bodyEnd) {
57086
+ hi = mid;
57087
+ } else {
57088
+ lo = mid + 1;
57089
+ }
57090
+ }
57091
+ later = list[lo] || null;
57092
+ }
57093
+ var starts = [];
57094
+ if (str.charAt(q) === "\r") {
57095
+ if (str.charAt(q + 1) === "\n") {
57096
+ starts.push(q + 2);
57097
+ }
57098
+ starts.push(q + 1);
57099
+ } else if (str.charAt(q) === "\n") {
57100
+ starts.push(q + 1);
57101
+ }
57102
+ starts.push(q);
57103
+ for (var i = 0; i < starts.length; ++i) {
57104
+ var t = starts[i];
57105
+ var blank2 = bodyEndOk ? firstBlankLine(t + 1, bodyEnd) : -1;
57106
+ var end2 = bodyEnd;
57107
+ if (blank2 === -1 && later) {
57108
+ blank2 = later.blank;
57109
+ end2 = later.end;
57110
+ }
57111
+ if (blank2 !== -1 && blank2 <= headerEnd) {
57112
+ var v = blankLineEnd(blank2);
57113
+ pos = end2 + 14 + label.length;
57114
+ return [
57115
+ str.substring(begin, pos),
57116
+ label,
57117
+ str.substring(t, v),
57118
+ str.substring(v, end2)
57119
+ ];
57120
+ }
57121
+ if (bodyEndOk && t < bodyEnd) {
57122
+ pos = bodyEnd + 14 + label.length;
57123
+ return [
57124
+ str.substring(begin, pos),
57125
+ label,
57126
+ void 0,
57127
+ str.substring(t, bodyEnd)
57128
+ ];
57129
+ }
57130
+ }
57131
+ }
57132
+ return null;
57133
+ }
57134
+ };
57135
+ }
56914
57136
  }
56915
57137
  });
56916
57138
 
56917
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/des.js
57139
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/des.js
56918
57140
  var require_des = __commonJS({
56919
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/des.js"(exports, module) {
57141
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/des.js"(exports, module) {
56920
57142
  "use strict";
56921
57143
  var forge2 = require_forge();
56922
57144
  require_cipher();
@@ -57153,9 +57375,9 @@ var require_des = __commonJS({
57153
57375
  }
57154
57376
  });
57155
57377
 
57156
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbkdf2.js
57378
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pbkdf2.js
57157
57379
  var require_pbkdf2 = __commonJS({
57158
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbkdf2.js"(exports, module) {
57380
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pbkdf2.js"(exports, module) {
57159
57381
  "use strict";
57160
57382
  var forge2 = require_forge();
57161
57383
  require_hmac();
@@ -57269,9 +57491,9 @@ var require_pbkdf2 = __commonJS({
57269
57491
  }
57270
57492
  });
57271
57493
 
57272
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha256.js
57494
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/sha256.js
57273
57495
  var require_sha256 = __commonJS({
57274
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha256.js"(exports, module) {
57496
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/sha256.js"(exports, module) {
57275
57497
  "use strict";
57276
57498
  var forge2 = require_forge();
57277
57499
  require_md2();
@@ -57503,9 +57725,9 @@ var require_sha256 = __commonJS({
57503
57725
  }
57504
57726
  });
57505
57727
 
57506
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prng.js
57728
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/prng.js
57507
57729
  var require_prng = __commonJS({
57508
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prng.js"(exports, module) {
57730
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/prng.js"(exports, module) {
57509
57731
  "use strict";
57510
57732
  var forge2 = require_forge();
57511
57733
  require_util2();
@@ -57744,9 +57966,9 @@ var require_prng = __commonJS({
57744
57966
  }
57745
57967
  });
57746
57968
 
57747
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/random.js
57969
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/random.js
57748
57970
  var require_random = __commonJS({
57749
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/random.js"(exports, module) {
57971
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/random.js"(exports, module) {
57750
57972
  "use strict";
57751
57973
  var forge2 = require_forge();
57752
57974
  require_aes();
@@ -57853,9 +58075,9 @@ var require_random = __commonJS({
57853
58075
  }
57854
58076
  });
57855
58077
 
57856
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rc2.js
58078
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/rc2.js
57857
58079
  var require_rc2 = __commonJS({
57858
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rc2.js"(exports, module) {
58080
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/rc2.js"(exports, module) {
57859
58081
  "use strict";
57860
58082
  var forge2 = require_forge();
57861
58083
  require_util2();
@@ -58315,9 +58537,9 @@ var require_rc2 = __commonJS({
58315
58537
  }
58316
58538
  });
58317
58539
 
58318
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/jsbn.js
58540
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/jsbn.js
58319
58541
  var require_jsbn = __commonJS({
58320
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/jsbn.js"(exports, module) {
58542
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/jsbn.js"(exports, module) {
58321
58543
  "use strict";
58322
58544
  var forge2 = require_forge();
58323
58545
  module.exports = forge2.jsbn = forge2.jsbn || {};
@@ -59355,7 +59577,7 @@ var require_jsbn = __commonJS({
59355
59577
  return r;
59356
59578
  }
59357
59579
  function bnModInverse(m) {
59358
- if (this.signum() == 0) {
59580
+ if (this.signum() <= 0 || m.signum() <= 0) {
59359
59581
  return BigInteger.ZERO;
59360
59582
  }
59361
59583
  var ac = m.isEven();
@@ -59504,9 +59726,9 @@ var require_jsbn = __commonJS({
59504
59726
  }
59505
59727
  });
59506
59728
 
59507
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha1.js
59729
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/sha1.js
59508
59730
  var require_sha12 = __commonJS({
59509
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha1.js"(exports, module) {
59731
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/sha1.js"(exports, module) {
59510
59732
  "use strict";
59511
59733
  var forge2 = require_forge();
59512
59734
  require_md2();
@@ -59701,9 +59923,9 @@ var require_sha12 = __commonJS({
59701
59923
  }
59702
59924
  });
59703
59925
 
59704
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs1.js
59926
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs1.js
59705
59927
  var require_pkcs1 = __commonJS({
59706
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs1.js"(exports, module) {
59928
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs1.js"(exports, module) {
59707
59929
  "use strict";
59708
59930
  var forge2 = require_forge();
59709
59931
  require_util2();
@@ -59854,9 +60076,9 @@ var require_pkcs1 = __commonJS({
59854
60076
  }
59855
60077
  });
59856
60078
 
59857
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prime.js
60079
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/prime.js
59858
60080
  var require_prime = __commonJS({
59859
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prime.js"(exports, module) {
60081
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/prime.js"(exports, module) {
59860
60082
  "use strict";
59861
60083
  var forge2 = require_forge();
59862
60084
  require_util2();
@@ -60017,9 +60239,9 @@ var require_prime = __commonJS({
60017
60239
  }
60018
60240
  });
60019
60241
 
60020
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rsa.js
60242
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/rsa.js
60021
60243
  var require_rsa = __commonJS({
60022
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rsa.js"(exports, module) {
60244
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/rsa.js"(exports, module) {
60023
60245
  "use strict";
60024
60246
  var forge2 = require_forge();
60025
60247
  require_asn1();
@@ -60238,6 +60460,41 @@ var require_rsa = __commonJS({
60238
60460
  capture: "digest"
60239
60461
  }]
60240
60462
  };
60463
+ var _encodeDigestInfo = function(oid, digest, withParameters) {
60464
+ var digestAlgorithm = [asn1.create(
60465
+ asn1.Class.UNIVERSAL,
60466
+ asn1.Type.OID,
60467
+ false,
60468
+ asn1.oidToDer(oid).getBytes()
60469
+ )];
60470
+ if (withParameters) {
60471
+ digestAlgorithm.push(asn1.create(
60472
+ asn1.Class.UNIVERSAL,
60473
+ asn1.Type.NULL,
60474
+ false,
60475
+ ""
60476
+ ));
60477
+ }
60478
+ return asn1.toDer(asn1.create(
60479
+ asn1.Class.UNIVERSAL,
60480
+ asn1.Type.SEQUENCE,
60481
+ true,
60482
+ [
60483
+ asn1.create(
60484
+ asn1.Class.UNIVERSAL,
60485
+ asn1.Type.SEQUENCE,
60486
+ true,
60487
+ digestAlgorithm
60488
+ ),
60489
+ asn1.create(
60490
+ asn1.Class.UNIVERSAL,
60491
+ asn1.Type.OCTETSTRING,
60492
+ false,
60493
+ digest
60494
+ )
60495
+ ]
60496
+ )).getBytes();
60497
+ };
60241
60498
  var emsaPkcs1v15encode = function(md) {
60242
60499
  var oid;
60243
60500
  if (md.algorithm in pki.oids) {
@@ -60741,6 +60998,13 @@ var require_rsa = __commonJS({
60741
60998
  );
60742
60999
  }
60743
61000
  }
61001
+ var withParameters = _encodeDigestInfo(oid, capture.digest, true);
61002
+ var withoutParameters = _encodeDigestInfo(oid, capture.digest, false);
61003
+ if (d2.substring(0, withParameters.length) !== withParameters && d2.substring(0, withoutParameters.length) !== withoutParameters) {
61004
+ throw new Error(
61005
+ "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value."
61006
+ );
61007
+ }
60744
61008
  return digest2 === capture.digest;
60745
61009
  }
60746
61010
  };
@@ -61219,9 +61483,9 @@ var require_rsa = __commonJS({
61219
61483
  }
61220
61484
  });
61221
61485
 
61222
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbe.js
61486
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pbe.js
61223
61487
  var require_pbe = __commonJS({
61224
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbe.js"(exports, module) {
61488
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pbe.js"(exports, module) {
61225
61489
  "use strict";
61226
61490
  var forge2 = require_forge();
61227
61491
  require_aes();
@@ -61702,6 +61966,9 @@ var require_pbe = __commonJS({
61702
61966
  };
61703
61967
  pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) {
61704
61968
  var j, l;
61969
+ if (!(iter >= 1)) {
61970
+ throw new Error("PKCS#12 key derivation iteration count must be >= 1.");
61971
+ }
61705
61972
  if (typeof md === "undefined" || md === null) {
61706
61973
  if (!("sha1" in forge2.md)) {
61707
61974
  throw new Error('"sha1" hash algorithm unavailable.');
@@ -61997,9 +62264,9 @@ var require_pbe = __commonJS({
61997
62264
  }
61998
62265
  });
61999
62266
 
62000
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7asn1.js
62267
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs7asn1.js
62001
62268
  var require_pkcs7asn1 = __commonJS({
62002
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7asn1.js"(exports, module) {
62269
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs7asn1.js"(exports, module) {
62003
62270
  "use strict";
62004
62271
  var forge2 = require_forge();
62005
62272
  require_asn1();
@@ -62299,9 +62566,9 @@ var require_pkcs7asn1 = __commonJS({
62299
62566
  }
62300
62567
  });
62301
62568
 
62302
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf1.js
62569
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/mgf1.js
62303
62570
  var require_mgf1 = __commonJS({
62304
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf1.js"(exports, module) {
62571
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/mgf1.js"(exports, module) {
62305
62572
  "use strict";
62306
62573
  var forge2 = require_forge();
62307
62574
  require_util2();
@@ -62335,9 +62602,9 @@ var require_mgf1 = __commonJS({
62335
62602
  }
62336
62603
  });
62337
62604
 
62338
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf.js
62605
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/mgf.js
62339
62606
  var require_mgf = __commonJS({
62340
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf.js"(exports, module) {
62607
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/mgf.js"(exports, module) {
62341
62608
  "use strict";
62342
62609
  var forge2 = require_forge();
62343
62610
  require_mgf1();
@@ -62346,9 +62613,9 @@ var require_mgf = __commonJS({
62346
62613
  }
62347
62614
  });
62348
62615
 
62349
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pss.js
62616
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pss.js
62350
62617
  var require_pss = __commonJS({
62351
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pss.js"(exports, module) {
62618
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pss.js"(exports, module) {
62352
62619
  "use strict";
62353
62620
  var forge2 = require_forge();
62354
62621
  require_random();
@@ -62466,9 +62733,9 @@ var require_pss = __commonJS({
62466
62733
  }
62467
62734
  });
62468
62735
 
62469
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/x509.js
62736
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/x509.js
62470
62737
  var require_x509 = __commonJS({
62471
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/x509.js"(exports, module) {
62738
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/x509.js"(exports, module) {
62472
62739
  "use strict";
62473
62740
  var forge2 = require_forge();
62474
62741
  require_aes();
@@ -62992,6 +63259,7 @@ var require_x509 = __commonJS({
62992
63259
  };
62993
63260
  var _verifySignature = function(options) {
62994
63261
  var cert = options.certificate;
63262
+ var publicKey = options.publicKey || cert.publicKey;
62995
63263
  var scheme;
62996
63264
  switch (cert.signatureOid) {
62997
63265
  case oids.sha1WithRSAEncryption:
@@ -63029,7 +63297,7 @@ var require_x509 = __commonJS({
63029
63297
  );
63030
63298
  break;
63031
63299
  }
63032
- return cert.publicKey.verify(
63300
+ return publicKey.verify(
63033
63301
  options.md.digest().getBytes(),
63034
63302
  options.signature,
63035
63303
  scheme
@@ -63249,7 +63517,8 @@ var require_x509 = __commonJS({
63249
63517
  }
63250
63518
  if (md !== null) {
63251
63519
  rval = _verifySignature({
63252
- certificate: cert,
63520
+ certificate: child,
63521
+ publicKey: cert.publicKey,
63253
63522
  md,
63254
63523
  signature: child.signature
63255
63524
  });
@@ -64484,10 +64753,7 @@ var require_x509 = __commonJS({
64484
64753
  }
64485
64754
  }
64486
64755
  if (parent) {
64487
- var parents = parent;
64488
- if (!forge2.util.isArray(parents)) {
64489
- parents = [parents];
64490
- }
64756
+ var parents = forge2.util.isArray(parent) ? parent.slice() : [parent];
64491
64757
  var verified = false;
64492
64758
  while (!verified && parents.length > 0) {
64493
64759
  parent = parents.shift();
@@ -64532,7 +64798,7 @@ var require_x509 = __commonJS({
64532
64798
  }
64533
64799
  }
64534
64800
  if (error62 === null && (!first || chain.length === 0 && (!parent || selfSigned))) {
64535
- var bcExt = cert.getExtension("basicConstraints");
64801
+ var bcExt = cert.getExtension({ id: "2.5.29.19" });
64536
64802
  var keyUsageExt = cert.getExtension("keyUsage");
64537
64803
  if (keyUsageExt !== null) {
64538
64804
  if (!keyUsageExt.keyCertSign || bcExt === null) {
@@ -64554,7 +64820,7 @@ var require_x509 = __commonJS({
64554
64820
  error: pki.certificateError.bad_certificate
64555
64821
  };
64556
64822
  }
64557
- if (error62 === null && keyUsageExt !== null && "pathLenConstraint" in bcExt) {
64823
+ if (error62 === null && bcExt !== null && "pathLenConstraint" in bcExt) {
64558
64824
  var pathLen = depth - 1;
64559
64825
  if (pathLen > bcExt.pathLenConstraint) {
64560
64826
  error62 = {
@@ -64597,9 +64863,9 @@ var require_x509 = __commonJS({
64597
64863
  }
64598
64864
  });
64599
64865
 
64600
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs12.js
64866
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs12.js
64601
64867
  var require_pkcs12 = __commonJS({
64602
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs12.js"(exports, module) {
64868
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs12.js"(exports, module) {
64603
64869
  "use strict";
64604
64870
  var forge2 = require_forge();
64605
64871
  require_asn1();
@@ -64939,6 +65205,9 @@ var require_pkcs12 = __commonJS({
64939
65205
  }
64940
65206
  var macSalt = new forge2.util.ByteBuffer(capture.macSalt);
64941
65207
  var macIterations = "macIterations" in capture ? parseInt(forge2.util.bytesToHex(capture.macIterations), 16) : 1;
65208
+ if (!(macIterations >= 1)) {
65209
+ throw new Error("PKCS#12 MAC iteration count must be >= 1.");
65210
+ }
64942
65211
  var macKey = p12.generateKey(
64943
65212
  password,
64944
65213
  macSalt,
@@ -65461,9 +65730,9 @@ var require_pkcs12 = __commonJS({
65461
65730
  }
65462
65731
  });
65463
65732
 
65464
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pki.js
65733
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pki.js
65465
65734
  var require_pki = __commonJS({
65466
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pki.js"(exports, module) {
65735
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pki.js"(exports, module) {
65467
65736
  "use strict";
65468
65737
  var forge2 = require_forge();
65469
65738
  require_asn1();
@@ -65515,9 +65784,9 @@ var require_pki = __commonJS({
65515
65784
  }
65516
65785
  });
65517
65786
 
65518
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/tls.js
65787
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/tls.js
65519
65788
  var require_tls = __commonJS({
65520
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/tls.js"(exports, module) {
65789
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/tls.js"(exports, module) {
65521
65790
  "use strict";
65522
65791
  var forge2 = require_forge();
65523
65792
  require_asn1();
@@ -66202,7 +66471,7 @@ var require_tls = __commonJS({
66202
66471
  }
66203
66472
  });
66204
66473
  }
66205
- if (c.serverCertificate === null) {
66474
+ if (c.session.serverCertificate === null) {
66206
66475
  var error62 = {
66207
66476
  message: "No server certificate provided. Not enough security.",
66208
66477
  send: true,
@@ -66226,8 +66495,8 @@ var require_tls = __commonJS({
66226
66495
  error62.alert.description = ret;
66227
66496
  }
66228
66497
  }
66229
- return c.error(c, error62);
66230
66498
  }
66499
+ return c.error(c, error62);
66231
66500
  }
66232
66501
  if (c.session.certificateRequest !== null) {
66233
66502
  record2 = tls.createRecord(c, {
@@ -66483,7 +66752,7 @@ var require_tls = __commonJS({
66483
66752
  var length = b.getInt16();
66484
66753
  var payload = b.getBytes(length);
66485
66754
  if (type === tls.HeartbeatMessageType.heartbeat_request) {
66486
- if (c.handshaking || length > payload.length) {
66755
+ if (c.handshakes === 0 || c.handshaking || length > payload.length) {
66487
66756
  return c.process();
66488
66757
  }
66489
66758
  tls.queue(c, tls.createRecord(c, {
@@ -67398,6 +67667,7 @@ var require_tls = __commonJS({
67398
67667
  description: tls.Alert.Description.unexpected_message
67399
67668
  }
67400
67669
  });
67670
+ return rval;
67401
67671
  }
67402
67672
  }
67403
67673
  c2.record.ready = true;
@@ -67462,24 +67732,48 @@ var require_tls = __commonJS({
67462
67732
  tls.flush(c);
67463
67733
  }
67464
67734
  };
67735
+ var _processing = false;
67736
+ var _processNext = false;
67737
+ var _processRecord = function(c2) {
67738
+ var rval = 0;
67739
+ if (!c2.fail) {
67740
+ if (c2.record !== null && c2.record.ready && c2.record.fragment.isEmpty()) {
67741
+ c2.record = null;
67742
+ }
67743
+ if (c2.record === null) {
67744
+ rval = _readRecordHeader(c2);
67745
+ }
67746
+ if (!c2.fail && c2.record !== null && !c2.record.ready) {
67747
+ rval = _readRecord(c2);
67748
+ }
67749
+ if (!c2.fail && c2.record !== null && c2.record.ready) {
67750
+ _update(c2, c2.record);
67751
+ }
67752
+ }
67753
+ return rval;
67754
+ };
67465
67755
  c.process = function(data) {
67466
67756
  var rval = 0;
67467
67757
  if (data) {
67468
67758
  c.input.putBytes(data);
67469
67759
  }
67470
- if (!c.fail) {
67471
- if (c.record !== null && c.record.ready && c.record.fragment.isEmpty()) {
67472
- c.record = null;
67473
- }
67474
- if (c.record === null) {
67475
- rval = _readRecordHeader(c);
67476
- }
67477
- if (!c.fail && c.record !== null && !c.record.ready) {
67478
- rval = _readRecord(c);
67479
- }
67480
- if (!c.fail && c.record !== null && c.record.ready) {
67481
- _update(c, c.record);
67760
+ if (_processing && typeof data === "undefined") {
67761
+ _processNext = true;
67762
+ return rval;
67763
+ }
67764
+ var processing = _processing;
67765
+ var processNext = _processNext;
67766
+ _processing = true;
67767
+ _processNext = false;
67768
+ try {
67769
+ rval = _processRecord(c);
67770
+ while (_processNext) {
67771
+ _processNext = false;
67772
+ _processRecord(c);
67482
67773
  }
67774
+ } finally {
67775
+ _processing = processing;
67776
+ _processNext = processNext;
67483
67777
  }
67484
67778
  return rval;
67485
67779
  };
@@ -67549,9 +67843,9 @@ var require_tls = __commonJS({
67549
67843
  }
67550
67844
  });
67551
67845
 
67552
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aesCipherSuites.js
67846
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/aesCipherSuites.js
67553
67847
  var require_aesCipherSuites = __commonJS({
67554
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aesCipherSuites.js"(exports, module) {
67848
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/aesCipherSuites.js"(exports, module) {
67555
67849
  "use strict";
67556
67850
  var forge2 = require_forge();
67557
67851
  require_aes();
@@ -67694,9 +67988,9 @@ var require_aesCipherSuites = __commonJS({
67694
67988
  }
67695
67989
  });
67696
67990
 
67697
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha512.js
67991
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/sha512.js
67698
67992
  var require_sha512 = __commonJS({
67699
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha512.js"(exports, module) {
67993
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/sha512.js"(exports, module) {
67700
67994
  "use strict";
67701
67995
  var forge2 = require_forge();
67702
67996
  require_md2();
@@ -68103,9 +68397,9 @@ var require_sha512 = __commonJS({
68103
68397
  }
68104
68398
  });
68105
68399
 
68106
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1-validator.js
68400
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/asn1-validator.js
68107
68401
  var require_asn1_validator = __commonJS({
68108
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1-validator.js"(exports) {
68402
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/asn1-validator.js"(exports) {
68109
68403
  "use strict";
68110
68404
  var forge2 = require_forge();
68111
68405
  require_asn1();
@@ -68196,9 +68490,9 @@ var require_asn1_validator = __commonJS({
68196
68490
  }
68197
68491
  });
68198
68492
 
68199
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ed25519.js
68493
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/ed25519.js
68200
68494
  var require_ed25519 = __commonJS({
68201
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ed25519.js"(exports, module) {
68495
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/ed25519.js"(exports, module) {
68202
68496
  "use strict";
68203
68497
  var forge2 = require_forge();
68204
68498
  require_jsbn();
@@ -69310,9 +69604,9 @@ var require_ed25519 = __commonJS({
69310
69604
  }
69311
69605
  });
69312
69606
 
69313
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/kem.js
69607
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/kem.js
69314
69608
  var require_kem = __commonJS({
69315
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/kem.js"(exports, module) {
69609
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/kem.js"(exports, module) {
69316
69610
  "use strict";
69317
69611
  var forge2 = require_forge();
69318
69612
  require_util2();
@@ -69374,9 +69668,9 @@ var require_kem = __commonJS({
69374
69668
  }
69375
69669
  });
69376
69670
 
69377
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/log.js
69671
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/log.js
69378
69672
  var require_log = __commonJS({
69379
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/log.js"(exports, module) {
69673
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/log.js"(exports, module) {
69380
69674
  "use strict";
69381
69675
  var forge2 = require_forge();
69382
69676
  require_util2();
@@ -69550,9 +69844,9 @@ var require_log = __commonJS({
69550
69844
  }
69551
69845
  });
69552
69846
 
69553
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.all.js
69847
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/md.all.js
69554
69848
  var require_md_all = __commonJS({
69555
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.all.js"(exports, module) {
69849
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/md.all.js"(exports, module) {
69556
69850
  "use strict";
69557
69851
  module.exports = require_md2();
69558
69852
  require_md5();
@@ -69562,9 +69856,9 @@ var require_md_all = __commonJS({
69562
69856
  }
69563
69857
  });
69564
69858
 
69565
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7.js
69859
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs7.js
69566
69860
  var require_pkcs7 = __commonJS({
69567
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7.js"(exports, module) {
69861
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/pkcs7.js"(exports, module) {
69568
69862
  "use strict";
69569
69863
  var forge2 = require_forge();
69570
69864
  require_aes();
@@ -70552,9 +70846,9 @@ var require_pkcs7 = __commonJS({
70552
70846
  }
70553
70847
  });
70554
70848
 
70555
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ssh.js
70849
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/ssh.js
70556
70850
  var require_ssh = __commonJS({
70557
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ssh.js"(exports, module) {
70851
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/ssh.js"(exports, module) {
70558
70852
  "use strict";
70559
70853
  var forge2 = require_forge();
70560
70854
  require_aes();
@@ -70689,9 +70983,9 @@ var require_ssh = __commonJS({
70689
70983
  }
70690
70984
  });
70691
70985
 
70692
- // ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/index.js
70986
+ // ../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/index.js
70693
70987
  var require_lib = __commonJS({
70694
- "../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/index.js"(exports, module) {
70988
+ "../../node_modules/.pnpm/node-forge@1.4.1/node_modules/node-forge/lib/index.js"(exports, module) {
70695
70989
  "use strict";
70696
70990
  module.exports = require_forge();
70697
70991
  require_aes();
@@ -78933,8 +79227,8 @@ function uint8ArrayToBase64(bytes) {
78933
79227
  }
78934
79228
  return btoa(binaryString);
78935
79229
  }
78936
- function base64urlToUint8Array(base64url3) {
78937
- const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
79230
+ function base64urlToUint8Array(base64url4) {
79231
+ const base643 = base64url4.replace(/-/g, "+").replace(/_/g, "/");
78938
79232
  const padding = "=".repeat((4 - base643.length % 4) % 4);
78939
79233
  return base64ToUint8Array(base643 + padding);
78940
79234
  }
@@ -107040,13 +107334,45 @@ function byCodeUnit(a, b) {
107040
107334
  if (a > b) return 1;
107041
107335
  return 0;
107042
107336
  }
107337
+ var notCanonical = (what) => new KyaError("INVALID_INPUT", `canonical JSON (RFC 8785): ${what}`);
107338
+ function assertUnicode(s) {
107339
+ for (let i = 0; i < s.length; i++) {
107340
+ const c = s.charCodeAt(i);
107341
+ if (c >= 55296 && c <= 56319) {
107342
+ const next = s.charCodeAt(i + 1);
107343
+ if (!(next >= 56320 && next <= 57343)) throw notCanonical("a string has a lone surrogate");
107344
+ i++;
107345
+ } else if (c >= 56320 && c <= 57343) {
107346
+ throw notCanonical("a string has a lone surrogate");
107347
+ }
107348
+ }
107349
+ }
107043
107350
  function canonicalize(v) {
107044
- if (v === null || typeof v !== "object") return JSON.stringify(v);
107045
- if (Array.isArray(v)) return `[${v.map(canonicalize).join(",")}]`;
107351
+ if (v === null || typeof v === "boolean") return JSON.stringify(v);
107352
+ if (typeof v === "number") {
107353
+ if (!Number.isFinite(v)) throw notCanonical("a number is not finite");
107354
+ return JSON.stringify(v);
107355
+ }
107356
+ if (typeof v === "string") {
107357
+ assertUnicode(v);
107358
+ return JSON.stringify(v);
107359
+ }
107360
+ if (typeof v !== "object") throw notCanonical(`a value of type ${typeof v} is not JSON`);
107361
+ if (Array.isArray(v)) return `[${Array.from(v, canonicalize).join(",")}]`;
107046
107362
  const o = v;
107047
- const members2 = Object.keys(o).filter((k) => o[k] !== void 0).sort(byCodeUnit).map((k) => JSON.stringify(k) + ":" + canonicalize(o[k]));
107363
+ const members2 = Object.keys(o).filter((k) => o[k] !== void 0).sort(byCodeUnit).map((k) => {
107364
+ assertUnicode(k);
107365
+ return JSON.stringify(k) + ":" + canonicalize(o[k]);
107366
+ });
107048
107367
  return "{" + members2.join(",") + "}";
107049
107368
  }
107369
+ function canonicalEquals(a, b) {
107370
+ try {
107371
+ return canonicalize(a) === canonicalize(b);
107372
+ } catch {
107373
+ return false;
107374
+ }
107375
+ }
107050
107376
 
107051
107377
  // ../core/src/mandate.ts
107052
107378
  var DELEGATION_MAX_DEPTH = 3;
@@ -108205,6 +108531,9 @@ var import_x5092 = __toESM(require_x509_cjs(), 1);
108205
108531
  var import_reflect_metadata = __toESM(require_Reflect(), 1);
108206
108532
  var import_x509 = __toESM(require_x509_cjs(), 1);
108207
108533
 
108534
+ // ../core/src/crl-der.ts
108535
+ var MAX_CRL_BYTES = 64 * 1024 * 1024;
108536
+
108208
108537
  // ../core/src/ecnpj-sign.ts
108209
108538
  var asn1js2 = __toESM(require_build2(), 1);
108210
108539
  var pkijs2 = __toESM(require_build3(), 1);
@@ -108299,7 +108628,7 @@ async function verifyDelegationChain(p) {
108299
108628
  } catch (e) {
108300
108629
  return fail2("KYA_DELEGATION_MALFORMED", `${at}: ${e.message}`);
108301
108630
  }
108302
- if (delegate.id !== raw.delegate?.id || canonicalize(mandate) !== canonicalize(raw.mandate)) return fail2("KYA_DELEGATION_MALFORMED", `${at}: delegate or mandate not in normalized form`);
108631
+ if (delegate.id !== raw.delegate?.id || !canonicalEquals(mandate, raw.mandate)) return fail2("KYA_DELEGATION_MALFORMED", `${at}: delegate or mandate not in normalized form`);
108303
108632
  const policy = parentMandate.delegation;
108304
108633
  if (!policy) return fail2("KYA_DELEGATION_NOT_ALLOWED", i === 0 ? "the credential's mandate does not allow delegation" : `${at}: the delegator's mandate does not allow further delegation`);
108305
108634
  const issued = Date.parse(raw.issued_at);
@@ -108335,8 +108664,16 @@ function decodeDelegationHeader(value) {
108335
108664
  }
108336
108665
  }
108337
108666
 
108338
- // ../core/src/freshness.ts
108339
- var FRESHNESS_LIMIT_MAX_AGE_SECONDS = 90 * 86400;
108667
+ // ../core/src/timestamp.ts
108668
+ var import_reflect_metadata3 = __toESM(require_Reflect(), 1);
108669
+ var asn1js3 = __toESM(require_build2(), 1);
108670
+ var pkijs3 = __toESM(require_build3(), 1);
108671
+ var import_x5093 = __toESM(require_x509_cjs(), 1);
108672
+ var OID_SHA256 = "2.16.840.1.101.3.4.2.1";
108673
+ var IMPRINT_HASHES = { [OID_SHA256]: "SHA-256", "2.16.840.1.101.3.4.2.2": "SHA-384", "2.16.840.1.101.3.4.2.3": "SHA-512" };
108674
+
108675
+ // ../core/src/issuance.ts
108676
+ var pkijs4 = __toESM(require_build3(), 1);
108340
108677
 
108341
108678
  // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
108342
108679
  var external_exports2 = {};
@@ -121694,7 +122031,7 @@ function getEvmChainId(network) {
121694
122031
  }
121695
122032
  return chainId;
121696
122033
  }
121697
- function getCrypto() {
122034
+ function getCrypto2() {
121698
122035
  const cryptoObj = globalThis.crypto;
121699
122036
  if (!cryptoObj) {
121700
122037
  throw new Error("Crypto API not available");
@@ -121702,10 +122039,10 @@ function getCrypto() {
121702
122039
  return cryptoObj;
121703
122040
  }
121704
122041
  function createNonce() {
121705
- return toHex2(getCrypto().getRandomValues(new Uint8Array(32)));
122042
+ return toHex2(getCrypto2().getRandomValues(new Uint8Array(32)));
121706
122043
  }
121707
122044
  function createPermit2Nonce() {
121708
- const randomBytes2 = getCrypto().getRandomValues(new Uint8Array(32));
122045
+ const randomBytes2 = getCrypto2().getRandomValues(new Uint8Array(32));
121709
122046
  return BigInt(toHex2(randomBytes2)).toString();
121710
122047
  }
121711
122048
 
@@ -122941,7 +123278,7 @@ function privateKeyToAccount(privateKey, options = {}) {
122941
123278
  }
122942
123279
 
122943
123280
  // ../agent-tools/src/index.ts
122944
- var pkijs3 = __toESM(require_build3(), 1);
123281
+ var pkijs5 = __toESM(require_build3(), 1);
122945
123282
 
122946
123283
  // ../agent-tools/src/auth.ts
122947
123284
  var enc = new TextEncoder();
@@ -123040,18 +123377,6 @@ function createKyaClient(opts = {}) {
123040
123377
  ];
123041
123378
  return client;
123042
123379
  }
123043
- function byCodeUnit2(a, b) {
123044
- if (a < b) return -1;
123045
- if (a > b) return 1;
123046
- return 0;
123047
- }
123048
- function canonicalize2(v) {
123049
- if (v === null || typeof v !== "object") return JSON.stringify(v);
123050
- if (Array.isArray(v)) return `[${v.map(canonicalize2).join(",")}]`;
123051
- const o = v;
123052
- const members2 = Object.keys(o).filter((k) => o[k] !== void 0).sort(byCodeUnit2).map((k) => JSON.stringify(k) + ":" + canonicalize2(o[k]));
123053
- return "{" + members2.join(",") + "}";
123054
- }
123055
123380
  async function verifyAttestation2(doc, opts = {}) {
123056
123381
  const att = doc.attestation;
123057
123382
  if (!att || att.algorithm !== "ed25519" || !att.sha256 || !att.signed_at || !att.signature || !att.key_id) return { valid: false, reason: "no ed25519 attestation in the document" };
@@ -123063,7 +123388,13 @@ async function verifyAttestation2(doc, opts = {}) {
123063
123388
  if (!jwk) return { valid: false, reason: `key ${att.key_id} not published by ${base}`, key_id: att.key_id, signed_at: att.signed_at };
123064
123389
  }
123065
123390
  const { attestation: _a3, receipt: _r, ...payload } = doc;
123066
- const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(canonicalize2(payload)));
123391
+ let canonical;
123392
+ try {
123393
+ canonical = canonicalize(payload);
123394
+ } catch (e) {
123395
+ return { valid: false, reason: e.message, key_id: att.key_id, signed_at: att.signed_at };
123396
+ }
123397
+ const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(canonical));
123067
123398
  const hex4 = [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0")).join("");
123068
123399
  if (hex4 !== att.sha256) return { valid: false, reason: "content hash mismatch: the document was modified", key_id: att.key_id, signed_at: att.signed_at };
123069
123400
  const key2 = await crypto.subtle.importKey("jwk", jwk, { name: "Ed25519" }, true, ["verify"]);
@@ -123080,7 +123411,7 @@ async function verifyCredentialOffline(credential, opts = {}) {
123080
123411
 
123081
123412
  // src/server.ts
123082
123413
  var SERVER_NAME = "KYA Brasil";
123083
- var SERVER_VERSION = "0.1.0";
123414
+ var SERVER_VERSION = "0.1.1";
123084
123415
  var DEFAULT_ISSUER = "https://kya-br-agents.marcelfons.workers.dev";
123085
123416
  var ID = external_exports.string().uuid().describe("The agent's credential_id (the agent sends it with its request, e.g. in the KYA-Credential header).");
123086
123417
  var AGENT = external_exports.object({