micro509 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +78 -30
  2. package/dist/crypto/crypto.d.ts +73 -0
  3. package/dist/crypto/crypto.js +74 -0
  4. package/dist/crypto/crypto.js.map +1 -0
  5. package/dist/crypto.d.ts +4 -0
  6. package/dist/crypto.js +2 -0
  7. package/dist/der/der.d.ts +127 -0
  8. package/dist/der/der.js +171 -0
  9. package/dist/der/der.js.map +1 -0
  10. package/dist/der.d.ts +4 -0
  11. package/dist/der.js +4 -0
  12. package/dist/index.d.ts +13 -9
  13. package/dist/index.js +17 -15
  14. package/dist/internal/asn1/asn1.d.ts +20 -0
  15. package/dist/internal/asn1/asn1.js +80 -37
  16. package/dist/internal/asn1/asn1.js.map +1 -1
  17. package/dist/internal/asn1/der.d.ts +173 -0
  18. package/dist/internal/asn1/der.js +116 -38
  19. package/dist/internal/asn1/der.js.map +1 -1
  20. package/dist/internal/asn1/oids.js +7 -1
  21. package/dist/internal/asn1/oids2.js +9 -2
  22. package/dist/internal/asn1/oids2.js.map +1 -1
  23. package/dist/internal/crypto/algorithm-names.js +4 -0
  24. package/dist/internal/crypto/algorithm-names.js.map +1 -1
  25. package/dist/internal/crypto/pbes2.d.ts +38 -0
  26. package/dist/internal/crypto/pbes2.js +9 -10
  27. package/dist/internal/crypto/pbes2.js.map +1 -1
  28. package/dist/internal/crypto/rsa-pss.js +2 -0
  29. package/dist/internal/crypto/rsa-pss.js.map +1 -1
  30. package/dist/internal/crypto/sig-verify.d.ts +31 -0
  31. package/dist/internal/crypto/sig-verify.js +10 -8
  32. package/dist/internal/crypto/sig-verify.js.map +1 -1
  33. package/dist/internal/shared/base64.js +7 -1
  34. package/dist/internal/shared/base64.js.map +1 -1
  35. package/dist/internal/shared/dn.d.ts +16 -0
  36. package/dist/internal/shared/dn.js +149 -12
  37. package/dist/internal/shared/dn.js.map +1 -1
  38. package/dist/internal/shared/ip.d.ts +69 -0
  39. package/dist/internal/shared/ip.js +18 -1
  40. package/dist/internal/shared/ip.js.map +1 -1
  41. package/dist/internal/shared/rfc3454-tables.js +1782 -0
  42. package/dist/internal/shared/rfc3454-tables.js.map +1 -0
  43. package/dist/internal/verify/name-constraints-engine.js +47 -15
  44. package/dist/internal/verify/name-constraints-engine.js.map +1 -1
  45. package/dist/internal/verify/policy-engine.js +85 -94
  46. package/dist/internal/verify/policy-engine.js.map +1 -1
  47. package/dist/internal/verify/verify-path.d.ts +7 -0
  48. package/dist/internal/verify/verify-path.js +49 -45
  49. package/dist/internal/verify/verify-path.js.map +1 -1
  50. package/dist/internal/x509/directory-name.js +24 -0
  51. package/dist/internal/x509/directory-name.js.map +1 -0
  52. package/dist/internal/x509/extension-bits.js +14 -11
  53. package/dist/internal/x509/extension-bits.js.map +1 -1
  54. package/dist/internal/x509/extension-errors.d.ts +6 -0
  55. package/dist/internal/x509/extension-errors.js +20 -0
  56. package/dist/internal/x509/extension-errors.js.map +1 -0
  57. package/dist/internal/x509/extension-registry.js +113 -55
  58. package/dist/internal/x509/extension-registry.js.map +1 -1
  59. package/dist/internal/x509/general-name-tags.js +28 -0
  60. package/dist/internal/x509/general-name-tags.js.map +1 -0
  61. package/dist/internal/x509/general-name.js +97 -0
  62. package/dist/internal/x509/general-name.js.map +1 -0
  63. package/dist/internal/x509/name-fields.js +20 -10
  64. package/dist/internal/x509/name-fields.js.map +1 -1
  65. package/dist/keys/keys.d.ts +16 -2
  66. package/dist/keys/keys.js +311 -170
  67. package/dist/keys/keys.js.map +1 -1
  68. package/dist/keys.d.ts +3 -2
  69. package/dist/keys.js +3 -2
  70. package/dist/pem/pem.d.ts +3 -2
  71. package/dist/pem/pem.js +112 -30
  72. package/dist/pem/pem.js.map +1 -1
  73. package/dist/pkcs/pkcs12-mac.js +3 -3
  74. package/dist/pkcs/pkcs12-mac.js.map +1 -1
  75. package/dist/pkcs/pkcs7.d.ts +85 -21
  76. package/dist/pkcs/pkcs7.js +261 -186
  77. package/dist/pkcs/pkcs7.js.map +1 -1
  78. package/dist/pkcs.d.ts +2 -2
  79. package/dist/result/result.d.ts +18 -10
  80. package/dist/result/result.js +20 -12
  81. package/dist/result/result.js.map +1 -1
  82. package/dist/result.d.ts +2 -2
  83. package/dist/result.js +2 -2
  84. package/dist/revocation/chain.js +154 -103
  85. package/dist/revocation/chain.js.map +1 -1
  86. package/dist/revocation/crl.d.ts +13 -2
  87. package/dist/revocation/crl.js +415 -236
  88. package/dist/revocation/crl.js.map +1 -1
  89. package/dist/revocation/ocsp.d.ts +58 -17
  90. package/dist/revocation/ocsp.js +186 -174
  91. package/dist/revocation/ocsp.js.map +1 -1
  92. package/dist/revocation/revocation.d.ts +4 -4
  93. package/dist/revocation/revocation.js +48 -30
  94. package/dist/revocation/revocation.js.map +1 -1
  95. package/dist/revocation.d.ts +4 -4
  96. package/dist/revocation.js +5 -5
  97. package/dist/verify/identity.d.ts +2 -1
  98. package/dist/verify/identity.js +2 -1
  99. package/dist/verify/identity.js.map +1 -1
  100. package/dist/verify/policy.d.ts +6 -1
  101. package/dist/verify/verify.d.ts +18 -3
  102. package/dist/verify/verify.js +66 -41
  103. package/dist/verify/verify.js.map +1 -1
  104. package/dist/verify.d.ts +2 -1
  105. package/dist/verify.js +4 -3
  106. package/dist/x509/certificate.d.ts +36 -13
  107. package/dist/x509/certificate.js +36 -19
  108. package/dist/x509/certificate.js.map +1 -1
  109. package/dist/x509/csr.d.ts +6 -3
  110. package/dist/x509/extensions.d.ts +59 -22
  111. package/dist/x509/extensions.js +384 -117
  112. package/dist/x509/extensions.js.map +1 -1
  113. package/dist/x509/name-text.js +2 -0
  114. package/dist/x509/name-text.js.map +1 -1
  115. package/dist/x509/name.d.ts +8 -5
  116. package/dist/x509/name.js +17 -12
  117. package/dist/x509/name.js.map +1 -1
  118. package/dist/x509/parse.d.ts +104 -18
  119. package/dist/x509/parse.js +127 -163
  120. package/dist/x509/parse.js.map +1 -1
  121. package/dist/x509.d.ts +8 -5
  122. package/dist/x509.js +10 -8
  123. package/package.json +52 -34
@@ -1,13 +1,14 @@
1
1
  import { OIDS as e } from "../internal/asn1/oids2.js";
2
2
  import { errorResult as t, indexedErrorResult as n, indexedMicro509Error as r, micro509Error as i } from "../result/result.js";
3
3
  import { parseIpAddressToBytes as a } from "../internal/shared/ip.js";
4
- import { parseCertificateDerOrThrow as o, parseCertificateSigningRequestDerOrThrow as s, parseCertificateSigningRequestPemOrThrow as c } from "../x509/parse.js";
5
- import { verifySignedDataDetailed as l } from "../internal/crypto/sig-verify.js";
6
- import { createNameConstraintValidationState as u, evaluateNameConstraints as d } from "../internal/verify/name-constraints-engine.js";
7
- import { createPolicyValidationState as f, evaluatePolicyChain as p } from "../internal/verify/policy-engine.js";
8
- import { authorityKeyIdentifierMismatch as m, buildChainInternal as h, countCaCertificatesBelowParsed as g, isSelfIssued as _, isWithinValidity as v, loadCertificates as y, loadSingleCertificate as b, verifyCertificateSignature as x } from "../internal/verify/verify-path.js";
9
- import { matchServiceIdentity as S } from "./identity.js";
10
- import { checkChainRevocation as C } from "../revocation/chain.js";
4
+ import { compareDistinguishedNames as o } from "../internal/shared/dn.js";
5
+ import { parseCertificateDerOrThrow as s, parseCertificateSigningRequestDerOrThrow as c, parseCertificateSigningRequestPemOrThrow as l } from "../x509/parse.js";
6
+ import { verifySignedDataDetailed as u } from "../internal/crypto/sig-verify.js";
7
+ import { createNameConstraintValidationState as d, evaluateNameConstraints as f } from "../internal/verify/name-constraints-engine.js";
8
+ import { createPolicyValidationState as p, evaluatePolicyChain as m } from "../internal/verify/policy-engine.js";
9
+ import { authorityKeyIdentifierMismatch as h, buildChainInternal as g, countCaCertificatesBelowParsed as _, isSelfIssued as v, isWithinValidity as y, loadCertificates as b, loadSingleCertificate as x, verifyCertificateSignature as S } from "../internal/verify/verify-path.js";
10
+ import { matchServiceIdentity as C } from "./identity.js";
11
+ import { checkChainRevocation as w } from "../revocation/chain.js";
11
12
  //#region src/verify/verify.ts
12
13
  /**
13
14
  * Public certificate and CSR verification APIs.
@@ -30,7 +31,7 @@ import { checkChainRevocation as C } from "../revocation/chain.js";
30
31
  * Discriminant for every failure a verify operation can produce.
31
32
  *
32
33
  * - `no_trusted_root` — chain could not be anchored to any root or {@linkcode TrustAnchor}.
33
- * - `issuer_not_found` — an intermediate's issuer was not in the candidate set.
34
+ * - `issuer_not_found` — an intermediate's issuer was not in the candidate set, or its issuer DN does not match the candidate issuer's subject DN.
34
35
  * - `signature_invalid` — a certificate's signature failed cryptographic verification.
35
36
  * - `certificate_expired` — a certificate's notBefore/notAfter window excludes the validation time.
36
37
  * - `ca_required` — an issuer lacks `basicConstraints.ca = true`.
@@ -49,10 +50,11 @@ import { checkChainRevocation as C } from "../revocation/chain.js";
49
50
  * - `unsupported_name_constraints` — a certificate's nameConstraints use an unsupported form.
50
51
  * - `name_constraints_violated` — a subject name violates a permitted/excluded subtree.
51
52
  * - `unsupported_signature_algorithm_parameters` — the signature algorithm uses unrecognized parameters.
53
+ * - `ec_domain_parameters_missing` — an elliptic curve public key carries no namedCurve domain parameters.
52
54
  * - `certificate_revoked` — revocation evidence confirms a chain certificate is revoked.
53
55
  * - `revocation_indeterminate` — revocation status could not be determined under a hard-fail policy.
54
56
  */
55
- const w = [
57
+ const T = [
56
58
  "no_trusted_root",
57
59
  "issuer_not_found",
58
60
  "signature_invalid",
@@ -73,13 +75,15 @@ const w = [
73
75
  "unsupported_name_constraints",
74
76
  "name_constraints_violated",
75
77
  "unsupported_signature_algorithm_parameters",
78
+ "ec_domain_parameters_missing",
76
79
  "certificate_revoked",
77
80
  "revocation_indeterminate"
78
- ], T = /* @__PURE__ */ new Set([
81
+ ], E = /* @__PURE__ */ new Set([
79
82
  e.basicConstraints,
80
83
  e.keyUsage,
81
84
  e.extendedKeyUsage,
82
85
  e.subjectAltName,
86
+ e.issuerAltName,
83
87
  e.nameConstraints,
84
88
  e.authorityKeyIdentifier,
85
89
  e.subjectKeyIdentifier,
@@ -99,11 +103,11 @@ const w = [
99
103
  async function buildCandidatePathRaw(e) {
100
104
  let t, n, r;
101
105
  try {
102
- t = b(e.leaf), n = y(e.intermediates ?? []), r = y(e.roots);
106
+ t = x(e.leaf), n = b(e.intermediates ?? []), r = b(e.roots);
103
107
  } catch (e) {
104
108
  return failure("issuer_not_found", "certificate source is malformed or leaf source does not contain exactly one certificate", 0, detail({ actual: e instanceof Error ? e.message : "certificate source is malformed" }));
105
109
  }
106
- let i = e.trustAnchors ?? [], a = e.at ?? /* @__PURE__ */ new Date(), o = await h(t, n, r, i, a, {
110
+ let i = e.trustAnchors ?? [], a = e.at ?? /* @__PURE__ */ new Date(), o = await g(t, n, r, i, a, {
107
111
  failure,
108
112
  detail
109
113
  }), s = o.chain;
@@ -114,7 +118,8 @@ async function buildCandidatePathRaw(e) {
114
118
  value: {
115
119
  leaf: t,
116
120
  chain: s,
117
- root: c
121
+ root: c,
122
+ anchorCertificateInChain: o.anchorCertificateInChain ?? !0
118
123
  }
119
124
  };
120
125
  }
@@ -157,17 +162,20 @@ async function validateCandidatePathRaw(e) {
157
162
  if (!r.ok) return r;
158
163
  let i = t[0];
159
164
  if (i === void 0) return failure("issuer_not_found", "chain is empty", 0);
160
- let a = validateSelfSignedLeafAllowed(i, t.length, e);
165
+ let a = await validateSelfSignedLeafAllowed(i, t.length, e);
161
166
  if (a !== void 0) return a;
162
167
  let o = await validatePathCertificates(t, n);
163
168
  if (o !== void 0) return o;
164
169
  let s = validatePathLengthConstraints(t);
165
170
  if (s !== void 0) return s;
166
- let c = validatePolicyAndNameConstraints(t, r.value);
171
+ let c = validatePolicyAndNameConstraints(t, r.value, e.anchorCertificateInChain ?? !0);
167
172
  return c.ok ? validateLeaf(i, e, c.policyValidation) : c;
168
173
  }
169
- function validateSelfSignedLeafAllowed(e, t, n) {
170
- if (!(t !== 1 || !_(e) || n.allowSelfSignedLeaf === !0)) return failure("self_signed_leaf_not_allowed", "self-signed leaf not allowed", 0, detail({ subjectCommonName: e.subject.values.commonName }));
174
+ /** RFC 5280 §3.2 makes a self-issued certificate self-signed only when the public key it binds verifies its signature. */
175
+ async function validateSelfSignedLeafAllowed(e, t, n) {
176
+ if (t !== 1 || !v(e) || n.allowSelfSignedLeaf === !0) return;
177
+ let r = await S(e, e);
178
+ if (!(!r.ok || !r.valid)) return failure("self_signed_leaf_not_allowed", "self-signed leaf not allowed", 0, detail({ subjectCommonName: e.subject.values.commonName }));
171
179
  }
172
180
  /** Validates every certificate and issuer relationship in a candidate path. */
173
181
  async function validatePathCertificates(e, t) {
@@ -189,7 +197,7 @@ function validatePathLengthConstraints(e) {
189
197
  for (let t = 1; t < e.length; t += 1) {
190
198
  let n = e[t];
191
199
  if (n === void 0) return failure("issuer_not_found", "chain element missing", t);
192
- let r = g(e, t), i = n.basicConstraints?.pathLength;
200
+ let r = _(e, t), i = n.basicConstraints?.pathLength;
193
201
  if (isNonNegativeInteger(i) && r > i) return pathLengthExceededFailure(n, t, i, r);
194
202
  }
195
203
  }
@@ -200,32 +208,48 @@ function pathLengthExceededFailure(e, t, n, r) {
200
208
  actual: String(r)
201
209
  }));
202
210
  }
203
- function validatePolicyAndNameConstraints(e, t) {
204
- let n = p(e, t.policy);
205
- if (!n.ok) return failure(n.error.code, n.error.message, 0, detail({
206
- expected: n.error.details?.expected,
207
- actual: n.error.details?.actual
211
+ function validatePolicyAndNameConstraints(e, t, n) {
212
+ let r = m(e, t.policy, n);
213
+ if (!r.ok) return failure(r.error.code, r.error.message, 0, detail({
214
+ expected: r.error.details?.expected,
215
+ actual: r.error.details?.actual
208
216
  }));
209
- let r = d(e, t.nameConstraints);
210
- return r.ok ? {
217
+ let i = f(e, t.nameConstraints);
218
+ return i.ok ? {
211
219
  ok: !0,
212
- policyValidation: n.value
213
- } : r;
220
+ policyValidation: r.value
221
+ } : i;
214
222
  }
215
223
  function validateCertificateAtPathIndex(e, t, n) {
216
- if (!v(e, n)) return failure("certificate_expired", "certificate not valid at requested time", t, detail({
224
+ if (!y(e, n)) return failure("certificate_expired", "certificate not valid at requested time", t, detail({
217
225
  subjectCommonName: e.subject.values.commonName,
218
226
  expected: describeDateTime(n),
219
227
  actual: `${describeDateTime(e.notBefore)}..${describeDateTime(e.notAfter)}`
220
228
  }));
221
229
  let r = findUnprocessedCriticalExtension(e);
222
- if (r !== void 0) return failure("unrecognized_critical_extension", `certificate contains unrecognized critical extension ${r}`, t, detail({
230
+ return r === void 0 ? validateEcDomainParametersAtPathIndex(e, t) : failure("unrecognized_critical_extension", `certificate contains unrecognized critical extension ${r}`, t, detail({
223
231
  subjectCommonName: e.subject.values.commonName,
224
232
  actual: r
225
233
  }));
226
234
  }
235
+ /**
236
+ * RFC 5480 §2.1.1 admits only the namedCurve alternative of ECParameters, and
237
+ * requires clients to reject a certificate whose elliptic curve domain
238
+ * parameters are not present.
239
+ */
240
+ function validateEcDomainParametersAtPathIndex(t, n) {
241
+ if (t.publicKeyAlgorithmOid === e.ecPublicKey && t.publicKeyParametersOid === void 0) return failure("ec_domain_parameters_missing", "elliptic curve public key carries no namedCurve domain parameters", n, detail({
242
+ subjectCommonName: t.subject.values.commonName,
243
+ expected: "namedCurve OBJECT IDENTIFIER",
244
+ actual: t.publicKeyAlgorithmParametersDer === void 0 ? "absent" : `tag 0x${(t.publicKeyAlgorithmParametersDer[0] ?? 0).toString(16).padStart(2, "0")}`
245
+ }));
246
+ }
227
247
  async function validateIssuerAtPathIndex(e, t, n) {
228
- let r = await x(e, t);
248
+ if (!o(e.issuer, t.subject)) return failure("issuer_not_found", "issuer distinguished name does not match the candidate issuer subject", n, detail({
249
+ subjectCommonName: e.subject.values.commonName,
250
+ issuerCommonName: t.subject.values.commonName
251
+ }));
252
+ let r = await S(e, t);
229
253
  return r.ok ? r.valid ? validateIssuerConstraintsAtPathIndex(e, t, n) : failure("signature_invalid", "certificate signature does not verify", n, detail({
230
254
  subjectCommonName: e.subject.values.commonName,
231
255
  issuerCommonName: t.subject.values.commonName
@@ -238,7 +262,7 @@ async function validateIssuerAtPathIndex(e, t, n) {
238
262
  function validateIssuerConstraintsAtPathIndex(e, t, n) {
239
263
  if (t.basicConstraints?.ca !== !0) return failure("ca_required", "issuer must be a CA certificate", n + 1, detail({ subjectCommonName: t.subject.values.commonName }));
240
264
  if (t.keyUsage !== void 0 && !t.keyUsage.flags.includes("keyCertSign")) return failure("key_cert_sign_required", "issuer missing keyCertSign", n + 1, detail({ subjectCommonName: t.subject.values.commonName }));
241
- if (m(e, t)) return failure("authority_key_identifier_mismatch", "authorityKeyIdentifier does not match issuer subjectKeyIdentifier", n, detail({
265
+ if (h(e, t)) return failure("authority_key_identifier_mismatch", "authorityKeyIdentifier does not match issuer subjectKeyIdentifier", n, detail({
242
266
  subjectCommonName: e.subject.values.commonName,
243
267
  issuerCommonName: t.subject.values.commonName,
244
268
  expected: t.subjectKeyIdentifier,
@@ -296,6 +320,7 @@ async function verifyCertificateChain(e) {
296
320
  if (!t.ok) return t;
297
321
  let n = await validateCandidatePath({
298
322
  chain: t.value.chain,
323
+ anchorCertificateInChain: t.value.anchorCertificateInChain,
299
324
  ...e.at !== void 0 && { at: e.at },
300
325
  ...e.purpose !== void 0 && { purpose: e.purpose },
301
326
  ...copyValidationInputs(e),
@@ -321,7 +346,7 @@ async function verifyCertificateChain(e) {
321
346
  /** Applies optional revocation evidence to an otherwise verified certificate chain. */
322
347
  async function validateVerifiedChainRevocation(e, t) {
323
348
  if (e.revocation === void 0) return;
324
- let n = await C({
349
+ let n = await w({
325
350
  chain: t,
326
351
  ...e.revocation.crls === void 0 ? {} : { crls: e.revocation.crls },
327
352
  ...e.revocation.ocspResponses === void 0 ? {} : { ocspResponses: e.revocation.ocspResponses },
@@ -360,13 +385,13 @@ function revocationFailureResult(e) {
360
385
  async function verifyCertificateSigningRequest(e) {
361
386
  let t;
362
387
  try {
363
- t = typeof e == "string" ? c(e) : s(new Uint8Array(e));
388
+ t = typeof e == "string" ? l(e) : c(new Uint8Array(e));
364
389
  } catch (e) {
365
390
  return verifyRequestFailureResult("signature_invalid", "certificate request input is malformed", detail({ actual: e instanceof Error ? e.message : "certificate request input is malformed" }));
366
391
  }
367
392
  let n;
368
393
  try {
369
- n = await l(t.signatureAlgorithmOid, t.signatureAlgorithmParametersDer, t.publicKeyAlgorithmOid, t.publicKeyParametersOid, t.subjectPublicKeyInfoDer, t.signatureValue, t.certificationRequestInfoDer);
394
+ n = await u(t.signatureAlgorithmOid, t.signatureAlgorithmParametersDer, t.publicKeyAlgorithmOid, t.publicKeyParametersOid, t.subjectPublicKeyInfoDer, t.signatureValue, t.certificationRequestInfoDer);
370
395
  } catch (e) {
371
396
  return verifyRequestFailureResult("signature_invalid", "certificate request input is malformed", detail({
372
397
  subjectCommonName: t.subject.values.commonName,
@@ -545,7 +570,7 @@ function validateLeaf(e, t, n) {
545
570
  function validateServiceIdentity(e, t) {
546
571
  let n = validateServiceIdentityInput(t);
547
572
  if (!n.ok) return n;
548
- let r = S({
573
+ let r = C({
549
574
  certificate: reparseCertificateForTrust(e),
550
575
  serviceIdentity: t
551
576
  });
@@ -593,8 +618,8 @@ async function verifyChainForExtendedKeyUsageProfile(e, t) {
593
618
  return n.ok ? applyEkuCheck(n, t) : n;
594
619
  }
595
620
  /** Returns the OID of the first critical extension not in {@linkcode PROCESSED_EXTENSION_OIDS}, or `undefined`. */
596
- function findUnprocessedCriticalExtension(e) {
597
- for (let t of e.extensions) if (t.critical && !T.has(t.oid)) return t.oid;
621
+ function findUnprocessedCriticalExtension(t) {
622
+ for (let n of t.extensions) if (n.critical && (!E.has(n.oid) || n.oid === e.subjectAltName && t.subjectAltNames?.some((e) => e.type === "unknown") === !0)) return n.oid;
598
623
  }
599
624
  /** Constructs a {@linkcode VerifyChainFailure} with the given code, message, optional chain index, and details. */
600
625
  function failure(e, t, n, i) {
@@ -622,7 +647,7 @@ function normalizeValidationChain(e) {
622
647
  return e.map(reparseCertificateForTrust);
623
648
  }
624
649
  function reparseCertificateForTrust(e) {
625
- return o(new Uint8Array(e.der));
650
+ return s(new Uint8Array(e.der));
626
651
  }
627
652
  /** Returns `true` if the value is a non-negative integer (including zero). */
628
653
  function isNonNegativeInteger(e) {
@@ -709,12 +734,12 @@ function detail(e) {
709
734
  }
710
735
  /** Initializes policy and name-constraint validation state for a chain walk. */
711
736
  function buildValidationState(e, t) {
712
- let n = f(resolvePolicyValidationInput(e), t), r = validateInitialNameConstraintsInput(resolveInitialNameConstraintsInput(e));
737
+ let n = p(resolvePolicyValidationInput(e), t), r = validateInitialNameConstraintsInput(resolveInitialNameConstraintsInput(e));
713
738
  return r.ok ? {
714
739
  ok: !0,
715
740
  value: {
716
741
  policy: n,
717
- nameConstraints: u(r.value)
742
+ nameConstraints: d(r.value)
718
743
  }
719
744
  } : r;
720
745
  }
@@ -763,6 +788,6 @@ function isRecord(e) {
763
788
  return typeof e == "object" && !!e;
764
789
  }
765
790
  //#endregion
766
- export { w as VERIFY_ERROR_CODES, buildCandidatePath, checkExtendedKeyUsage, trustAnchorFromCertificate, validateCandidatePath, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, verifyCertificateChain, verifyCertificateSigningRequest };
791
+ export { T as VERIFY_ERROR_CODES, buildCandidatePath, checkExtendedKeyUsage, v as isSelfIssuedCertificate, trustAnchorFromCertificate, validateCandidatePath, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, verifyCertificateChain, verifyCertificateSigningRequest };
767
792
 
768
793
  //# sourceMappingURL=verify.js.map