micro509 0.13.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 (109) 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 +1 -1
  8. package/dist/index.d.ts +13 -9
  9. package/dist/index.js +17 -15
  10. package/dist/internal/asn1/asn1.js +21 -10
  11. package/dist/internal/asn1/asn1.js.map +1 -1
  12. package/dist/internal/asn1/der.d.ts +4 -2
  13. package/dist/internal/asn1/der.js +18 -5
  14. package/dist/internal/asn1/der.js.map +1 -1
  15. package/dist/internal/asn1/oids.js +7 -1
  16. package/dist/internal/crypto/algorithm-names.js +4 -0
  17. package/dist/internal/crypto/algorithm-names.js.map +1 -1
  18. package/dist/internal/crypto/pbes2.d.ts +38 -0
  19. package/dist/internal/crypto/pbes2.js +9 -10
  20. package/dist/internal/crypto/pbes2.js.map +1 -1
  21. package/dist/internal/crypto/rsa-pss.js +2 -0
  22. package/dist/internal/crypto/rsa-pss.js.map +1 -1
  23. package/dist/internal/crypto/sig-verify.d.ts +31 -0
  24. package/dist/internal/crypto/sig-verify.js +10 -8
  25. package/dist/internal/crypto/sig-verify.js.map +1 -1
  26. package/dist/internal/shared/base64.js +7 -1
  27. package/dist/internal/shared/base64.js.map +1 -1
  28. package/dist/internal/shared/dn.d.ts +16 -0
  29. package/dist/internal/shared/dn.js +13 -6
  30. package/dist/internal/shared/dn.js.map +1 -1
  31. package/dist/internal/shared/ip.d.ts +69 -0
  32. package/dist/internal/shared/ip.js +18 -1
  33. package/dist/internal/shared/ip.js.map +1 -1
  34. package/dist/internal/verify/verify-path.d.ts +7 -0
  35. package/dist/internal/verify/verify-path.js +36 -36
  36. package/dist/internal/x509/directory-name.js +24 -0
  37. package/dist/internal/x509/directory-name.js.map +1 -0
  38. package/dist/internal/x509/extension-bits.js +13 -10
  39. package/dist/internal/x509/extension-bits.js.map +1 -1
  40. package/dist/internal/x509/extension-errors.d.ts +6 -0
  41. package/dist/internal/x509/extension-errors.js +20 -0
  42. package/dist/internal/x509/extension-errors.js.map +1 -0
  43. package/dist/internal/x509/extension-registry.js +113 -55
  44. package/dist/internal/x509/extension-registry.js.map +1 -1
  45. package/dist/internal/x509/general-name-tags.js +28 -0
  46. package/dist/internal/x509/general-name-tags.js.map +1 -0
  47. package/dist/internal/x509/general-name.js +97 -0
  48. package/dist/internal/x509/general-name.js.map +1 -0
  49. package/dist/internal/x509/name-fields.js +20 -10
  50. package/dist/internal/x509/name-fields.js.map +1 -1
  51. package/dist/keys/keys.d.ts +16 -2
  52. package/dist/keys/keys.js +311 -170
  53. package/dist/keys/keys.js.map +1 -1
  54. package/dist/keys.d.ts +3 -2
  55. package/dist/keys.js +3 -2
  56. package/dist/pem/pem.d.ts +3 -2
  57. package/dist/pem/pem.js +112 -30
  58. package/dist/pem/pem.js.map +1 -1
  59. package/dist/pkcs/pkcs12-mac.js +3 -3
  60. package/dist/pkcs/pkcs12-mac.js.map +1 -1
  61. package/dist/pkcs/pkcs7.d.ts +85 -21
  62. package/dist/pkcs/pkcs7.js +261 -186
  63. package/dist/pkcs/pkcs7.js.map +1 -1
  64. package/dist/pkcs.d.ts +2 -2
  65. package/dist/result/result.d.ts +18 -10
  66. package/dist/result/result.js +20 -12
  67. package/dist/result/result.js.map +1 -1
  68. package/dist/result.d.ts +2 -2
  69. package/dist/result.js +2 -2
  70. package/dist/revocation/chain.js +77 -81
  71. package/dist/revocation/chain.js.map +1 -1
  72. package/dist/revocation/crl.d.ts +13 -2
  73. package/dist/revocation/crl.js +415 -236
  74. package/dist/revocation/crl.js.map +1 -1
  75. package/dist/revocation/ocsp.d.ts +58 -17
  76. package/dist/revocation/ocsp.js +185 -173
  77. package/dist/revocation/ocsp.js.map +1 -1
  78. package/dist/revocation/revocation.d.ts +4 -4
  79. package/dist/revocation/revocation.js +48 -30
  80. package/dist/revocation/revocation.js.map +1 -1
  81. package/dist/revocation.d.ts +4 -4
  82. package/dist/revocation.js +5 -5
  83. package/dist/verify/identity.d.ts +2 -1
  84. package/dist/verify/identity.js +2 -1
  85. package/dist/verify/identity.js.map +1 -1
  86. package/dist/verify/policy.d.ts +6 -1
  87. package/dist/verify/verify.d.ts +4 -2
  88. package/dist/verify/verify.js +32 -14
  89. package/dist/verify/verify.js.map +1 -1
  90. package/dist/verify.d.ts +2 -1
  91. package/dist/verify.js +4 -3
  92. package/dist/x509/certificate.d.ts +36 -13
  93. package/dist/x509/certificate.js +36 -19
  94. package/dist/x509/certificate.js.map +1 -1
  95. package/dist/x509/csr.d.ts +6 -3
  96. package/dist/x509/extensions.d.ts +58 -21
  97. package/dist/x509/extensions.js +384 -117
  98. package/dist/x509/extensions.js.map +1 -1
  99. package/dist/x509/name-text.js +2 -0
  100. package/dist/x509/name-text.js.map +1 -1
  101. package/dist/x509/name.d.ts +8 -5
  102. package/dist/x509/name.js +17 -12
  103. package/dist/x509/name.js.map +1 -1
  104. package/dist/x509/parse.d.ts +104 -18
  105. package/dist/x509/parse.js +127 -163
  106. package/dist/x509/parse.js.map +1 -1
  107. package/dist/x509.d.ts +8 -5
  108. package/dist/x509.js +10 -8
  109. package/package.json +28 -20
package/README.md CHANGED
@@ -10,10 +10,6 @@
10
10
  [![JSR](https://img.shields.io/jsr/v/@kjanat/micro509?logoColor=083344&logo=jsr&logoSize=auto&label=&labelColor=f7df1e&color=black)][jsr]
11
11
  [![Socket](https://badge.socket.dev/npm/package/micro509)][socket]
12
12
 
13
- [npm]: https://npm.im/micro509
14
- [jsr]: https://jsr.io/@kjanat/micro509
15
- [socket]: https://socket.dev/npm/package/micro509
16
-
17
13
  A zero-dependency TypeScript PKI toolkit for certificates, verification, revocation, and PKCS workflows.
18
14
 
19
15
  Zero dependencies. Tree-shakeable subpath entrypoints. Pure WebCrypto. Runs everywhere: Node, Bun, Deno, browsers, Cloudflare Workers.
@@ -34,11 +30,13 @@ In a browser, no build step — it is WebCrypto and nothing else:
34
30
  </script>
35
31
  ```
36
32
 
37
- Two runnable examples: [`examples/browser`] is one HTML file you can open, and
38
- [`examples/vite`] is the same demo with types and a dev server. Both open in StackBlitz.
33
+ Two runnable examples:
39
34
 
40
- [`examples/browser`]: ./examples/browser/README.md
41
- [`examples/vite`]: ./examples/vite/README.md
35
+ - [`examples/browser`][browser-example] is that, in full: one HTML file that
36
+ issues a certificate and parses it back, with nothing installed and nothing
37
+ built. [open in stackblitz][browser-example:stackblitz]
38
+ - [`examples/vite`][vite-example]: the same demo with types and a dev server.
39
+ [open in stackblitz][vite-example:stackblitz]
42
40
 
43
41
  ## Why micro509
44
42
 
@@ -59,13 +57,36 @@ And when verification fails, you get typed results your code
59
57
  can act on: [a typed error code for every failure mode], the failing
60
58
  certificate index, and structured failure details instead of `false`.
61
59
 
62
- [a typed error code for every failure mode]: https://micro509.kjanat.dev/guide/verification#error-codes
63
-
64
60
  ```ts
61
+ import { createSelfSignedCertificate, unwrap, verifyCertificateChain } from 'micro509';
62
+
63
+ const { certificate } = await createSelfSignedCertificate({
64
+ subject: { commonName: 'app.example.com' },
65
+ extensions: {
66
+ subjectAltNames: [{ type: 'dns', value: 'app.example.com' }],
67
+ },
68
+ });
69
+
70
+ const result = await verifyCertificateChain({
71
+ leaf: certificate.pem,
72
+ roots: [certificate.pem],
73
+ allowSelfSignedLeaf: true,
74
+ serviceIdentity: { type: 'dns', value: 'evil.example.com' },
75
+ });
76
+
65
77
  if (!result.ok) {
66
- // result.error.code: 'signature_invalid' | 'certificate_expired' | 'name_constraints_violated' | ...
67
- // result.error.index: which certificate in the chain failed
68
- // result.error.details: { expected, actual } for identity mismatches
78
+ switch (result.error.code) {
79
+ case 'certificate_expired':
80
+ console.log('renew the certificate at index', result.error.index);
81
+ break;
82
+ case 'subject_alt_name_mismatch': {
83
+ const { expected, actual } = result.error.details ?? {};
84
+ console.log(`identity mismatch: wanted ${expected}, presented ${actual}`);
85
+ break;
86
+ }
87
+ default:
88
+ unwrap(result); // rethrows the typed error
89
+ }
69
90
  }
70
91
  ```
71
92
 
@@ -74,10 +95,11 @@ in a single zero-dependency JS package:
74
95
 
75
96
  - **OCSP** — build requests, parse and validate responses, verify responder authorization
76
97
  - **PFX / PKCS#12** — create and parse password-protected key+cert bundles
77
- - **PKCS#7 / CMS** — sign content, parse and verify SignedData, extract cert bags
98
+ - **PKCS#7 / CMS** — sign content, parse and verify SignedData with each signer's certificate resolved, extract cert bags
78
99
  - **CRLs** — create, parse, verify, and check revocation status
79
- - **Encrypted keys** — PBES2 PKCS#8, legacy OpenSSL encrypted PEM, PKCS#1, SEC1
100
+ - **Encrypted keys** — PBES2 PKCS#8, legacy OpenSSL encrypted PEM, PKCS#1, SEC1, parameter inspection without the password
80
101
  - **Key import/export** — PKCS#8, SPKI, JWK, PKCS#1, SEC1 with generation for RSA, ECDSA, Ed25519
102
+ - **Detached signatures** — sign and verify raw bytes, ECDSA DER/raw signature conversion
81
103
  - **Service identity** — wildcard DNS, IPv6 normalization, URI-ID, SRV-ID, explicit CN opt-in
82
104
 
83
105
  Narrow defaults, explicit escape hatches — dangerous operations like CN
@@ -133,13 +155,17 @@ console.log(csr.pem);
133
155
  Parse a certificate:
134
156
 
135
157
  ```ts
136
- import { parseCertificatePem, unwrap } from 'micro509';
158
+ import { createSelfSignedCertificate, parseCertificatePem, unwrap } from 'micro509';
159
+
160
+ const { certificate } = await createSelfSignedCertificate({
161
+ subject: { commonName: 'example.com' },
162
+ extensions: { extendedKeyUsage: ['serverAuth'] },
163
+ });
137
164
 
138
- // Using certificate from previous example
139
165
  const parsed = unwrap(parseCertificatePem(certificate.pem));
140
166
  console.log(parsed.subject.values.commonName);
167
+ console.log(parsed.serialNumberHex);
141
168
  console.log(parsed.extendedKeyUsage);
142
- console.log(parsed.authorityInfoAccess);
143
169
  ```
144
170
 
145
171
  `parseCertificatePem` returns a typed `Result` — check `result.ok`, or
@@ -148,19 +174,27 @@ console.log(parsed.authorityInfoAccess);
148
174
  Verify a chain:
149
175
 
150
176
  ```ts
151
- import { verifyCertificateChain } from 'micro509';
177
+ import { createSelfSignedCertificate, verifyCertificateChain } from 'micro509';
152
178
 
153
- // Assuming you have a self-signed certificate used as both leaf and root; no intermediates
179
+ const { certificate } = await createSelfSignedCertificate({
180
+ subject: { commonName: 'example.com' },
181
+ extensions: {
182
+ extendedKeyUsage: ['serverAuth'],
183
+ subjectAltNames: [{ type: 'dns', value: 'example.com' }],
184
+ },
185
+ });
186
+
187
+ // Self-signed leaf as its own root: development shape, explicit opt-in
154
188
  const result = await verifyCertificateChain({
155
189
  leaf: certificate.pem,
156
- intermediates: [],
157
- roots: [certificate.pem], // Using self-signed cert as root for demo
190
+ roots: [certificate.pem],
158
191
  purpose: 'serverAuth',
159
192
  serviceIdentity: { type: 'dns', value: 'example.com' },
193
+ allowSelfSignedLeaf: true,
160
194
  });
161
195
 
162
196
  if (result.ok) {
163
- console.log(result.value.chain.length);
197
+ console.log(result.value.chain.length, result.value.leaf.serialNumberHex);
164
198
  } else {
165
199
  console.log(result.error.code);
166
200
  }
@@ -183,7 +217,7 @@ The core stays ESM-only and side-effect-free.
183
217
  | Area | Shipped support |
184
218
  | ------------------------------ | -------------------------------------------------------------------- |
185
219
  | Certificate and CSR signatures | RSA PKCS#1 v1.5, RSA-PSS, ECDSA `P-256` / `P-384` / `P-521`, Ed25519 |
186
- | RSA key APIs | `scheme: 'pkcs1-v1_5'` |
220
+ | RSA key APIs | `scheme: 'pkcs1-v1_5'`, `'pss'`, `'oaep'` (encryption) |
187
221
  | ECDSA key APIs | `P-256`, `P-384`, `P-521` |
188
222
  | Encrypted PKCS#8 and PFX | PBES2 with AES-CBC plus PBKDF2 HMAC-SHA1/HMAC-SHA256 |
189
223
  | Encrypted traditional PEM | AES-128-CBC, AES-192-CBC, AES-256-CBC for RSA and EC private keys |
@@ -193,12 +227,15 @@ It intentionally excludes niche, blockchain-specific, or key-agreement-only prim
193
227
 
194
228
  ## Standards status
195
229
 
196
- | Area | Status |
197
- | -------------------------- | -------- |
198
- | RFC 5280 path validation | complete |
199
- | RFC 6960 OCSP | complete |
200
- | RFC 6125 service identity | complete |
201
- | RFC 9618 policy validation | complete |
230
+ | Area | Status |
231
+ | ------------------------------------- | -------- |
232
+ | RFC 5280 path validation | complete |
233
+ | RFC 6960 + 9919 OCSP | complete |
234
+ | RFC 9525 service identity | complete |
235
+ | RFC 9618 policy validation | complete |
236
+ | RFC 7468 PEM textual encodings | complete |
237
+ | RFC 8410 + 9295 safe-curve profiles | complete |
238
+ | PKCS containers: RFC 5652, 7292, 8018 | partial |
202
239
 
203
240
  See [`docs/PKIX-SCOPE.md`](./docs/PKIX-SCOPE.md) for the detailed scope boundary
204
241
  and the [API reference](https://micro509.kjanat.dev/api/) for the public module surface.
@@ -219,8 +256,10 @@ import { parseCertificatePem } from 'micro509/x509';
219
256
  import { verifyCertificateChain, matchServiceIdentity } from 'micro509/verify';
220
257
  import { createOcspRequest, checkCertificateRevocation } from 'micro509/revocation';
221
258
  import { createPfx } from 'micro509/pkcs';
259
+ import { signData, verifySignature } from 'micro509/crypto';
222
260
  import { generateKeyPair } from 'micro509/keys';
223
261
  import { pemDecode, pemEncode } from 'micro509/pem';
262
+ import { readDerRoot, decodeDerOid } from 'micro509/der';
224
263
  import type { Micro509Error } from 'micro509/result';
225
264
  ```
226
265
 
@@ -237,3 +276,12 @@ The full stable subpath list lives in the [API reference](https://micro509.kjana
237
276
  ## License
238
277
 
239
278
  [MIT](./LICENSE)
279
+
280
+ [npm]: https://npm.im/micro509
281
+ [jsr]: https://jsr.io/@kjanat/micro509
282
+ [socket]: https://socket.dev/npm/package/micro509
283
+ [browser-example]: ./examples/browser/README.md 'GitHub'
284
+ [browser-example:stackblitz]: https://stackblitz.com/github/kjanat/micro509/tree/master/examples/browser?title=micro509%20in%20the%20browser 'Stackblitz'
285
+ [vite-example]: ./examples/vite/README.md 'GitHub'
286
+ [vite-example:stackblitz]: https://stackblitz.com/github/kjanat/micro509/tree/master/examples/vite?title=micro509%20with%20Vite 'Stackblitz'
287
+ [a typed error code for every failure mode]: https://micro509.kjanat.dev/guide/verification#error-codes
@@ -0,0 +1,73 @@
1
+ import { EcNamedCurve } from "../keys/keys.js";
2
+ import { VerifySignatureConfigFailure, VerifySignedDataFailure, VerifySignedDataResult, VerifySignedDataSuccess } from "../internal/crypto/sig-verify.js";
3
+ import { SignatureProfileInput } from "../internal/crypto/signing.js";
4
+ //#region src/crypto/crypto.d.ts
5
+ /** Input for {@linkcode verifySignature}. */
6
+ interface VerifySignatureInput {
7
+ /** DER `SubjectPublicKeyInfo` of the signer (`subjectPublicKeyInfoDer` on a parsed certificate). */
8
+ readonly signerSpkiDer: Uint8Array;
9
+ /** The signature algorithm as carried beside the signature. */
10
+ readonly signatureAlgorithm: {
11
+ /** Dotted-decimal signature algorithm OID. */
12
+ readonly oid: string;
13
+ /** DER algorithm parameters when the algorithm carries them (RSA-PSS). */
14
+ readonly parametersDer?: Uint8Array;
15
+ };
16
+ /** The signer's public key algorithm as carried in its SPKI. */
17
+ readonly publicKeyAlgorithm: {
18
+ /** Dotted-decimal public key algorithm OID. */
19
+ readonly oid: string;
20
+ /** Named-curve or scheme parameters OID, when present. */
21
+ readonly parametersOid?: string;
22
+ };
23
+ /** The signature bytes. ECDSA accepts DER or raw encoding. */
24
+ readonly signature: Uint8Array;
25
+ /** The exact bytes the signature covers. */
26
+ readonly data: Uint8Array;
27
+ }
28
+ /** Result of {@linkcode signData}: the signature plus its on-wire algorithm identity. */
29
+ interface SignDataResult {
30
+ /** The signature bytes. ECDSA is DER `ECDSA-Sig-Value`, everything else raw. */
31
+ readonly signature: Uint8Array;
32
+ /** Dotted-decimal signature algorithm OID. */
33
+ readonly algorithmOid: string;
34
+ /** DER algorithm parameters when the algorithm carries them (NULL for PKCS#1 v1.5, RSA-PSS params). */
35
+ readonly parametersDer?: Uint8Array;
36
+ }
37
+ /**
38
+ * Verifies a detached signature against the signer's DER `SubjectPublicKeyInfo`.
39
+ *
40
+ * Supports RSA PKCS#1 v1.5 (SHA-256/384/512), RSA-PSS with parsed parameters,
41
+ * ECDSA P-256/P-384/P-521, and Ed25519. When an ECDSA signature fails to
42
+ * verify under one encoding, the alternate DER/raw encoding is retried.
43
+ *
44
+ * Returns a typed union: `{ ok: true, valid }` when verification ran,
45
+ * `unsupported_signature_algorithm_parameters` or `verification_error`
46
+ * failures otherwise.
47
+ */
48
+ declare function verifySignature(input: VerifySignatureInput): Promise<VerifySignedDataResult>;
49
+ /**
50
+ * Signs `data` with a WebCrypto private key and returns the signature beside
51
+ * the resolved `AlgorithmIdentifier` material for embedding in a signed
52
+ * structure.
53
+ *
54
+ * The algorithm is inferred from the key (RSASSA-PKCS1-v1_5, ECDSA, Ed25519);
55
+ * RSA-PSS keys require an explicit `{ kind: 'rsa-pss' }` profile. ECDSA
56
+ * signatures are returned DER-encoded. Throws on unsupported key algorithms.
57
+ */
58
+ declare function signData(privateKey: CryptoKey, data: Uint8Array, profile?: SignatureProfileInput): Promise<SignDataResult>;
59
+ /**
60
+ * Converts a DER `ECDSA-Sig-Value` (RFC 5480: SEQUENCE of INTEGERs r and s)
61
+ * to the fixed-width raw `r || s` encoding WebCrypto and JOSE use.
62
+ * Throws on malformed DER or integers too large for the curve.
63
+ */
64
+ declare function ecdsaSignatureDerToRaw(signature: Uint8Array, curve: EcNamedCurve): Uint8Array;
65
+ /**
66
+ * Converts a fixed-width raw `r || s` ECDSA signature to the DER
67
+ * `ECDSA-Sig-Value` encoding X.509 and CMS structures embed.
68
+ * Throws when the input length does not match the curve.
69
+ */
70
+ declare function ecdsaSignatureRawToDer(signature: Uint8Array, curve: EcNamedCurve): Uint8Array;
71
+ //#endregion
72
+ export { SignDataResult, type SignatureProfileInput, type VerifySignatureConfigFailure, VerifySignatureInput, type VerifySignedDataFailure, type VerifySignedDataResult, type VerifySignedDataSuccess, ecdsaSignatureDerToRaw, ecdsaSignatureRawToDer, signData, verifySignature };
73
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1,74 @@
1
+ import { derEcdsaSignatureToRaw as e, rawEcdsaSignatureToDer as t } from "../internal/crypto/ecdsa.js";
2
+ import { verifySignedDataDetailed as n } from "../internal/crypto/sig-verify.js";
3
+ import { getSignatureAlgorithm as r, signBytes as i } from "../internal/crypto/signing.js";
4
+ //#region src/crypto/crypto.ts
5
+ /**
6
+ * Detached-signature primitives: verify a signature against a signer's SPKI,
7
+ * sign arbitrary bytes with a WebCrypto private key, and convert ECDSA
8
+ * signatures between DER `ECDSA-Sig-Value` and fixed-width raw encodings.
9
+ *
10
+ * @module
11
+ */
12
+ /**
13
+ * Verifies a detached signature against the signer's DER `SubjectPublicKeyInfo`.
14
+ *
15
+ * Supports RSA PKCS#1 v1.5 (SHA-256/384/512), RSA-PSS with parsed parameters,
16
+ * ECDSA P-256/P-384/P-521, and Ed25519. When an ECDSA signature fails to
17
+ * verify under one encoding, the alternate DER/raw encoding is retried.
18
+ *
19
+ * Returns a typed union: `{ ok: true, valid }` when verification ran,
20
+ * `unsupported_signature_algorithm_parameters` or `verification_error`
21
+ * failures otherwise.
22
+ */
23
+ function verifySignature(e) {
24
+ return n(e.signatureAlgorithm.oid, e.signatureAlgorithm.parametersDer, e.publicKeyAlgorithm.oid, e.publicKeyAlgorithm.parametersOid, e.signerSpkiDer, e.signature, e.data);
25
+ }
26
+ /**
27
+ * Signs `data` with a WebCrypto private key and returns the signature beside
28
+ * the resolved `AlgorithmIdentifier` material for embedding in a signed
29
+ * structure.
30
+ *
31
+ * The algorithm is inferred from the key (RSASSA-PKCS1-v1_5, ECDSA, Ed25519);
32
+ * RSA-PSS keys require an explicit `{ kind: 'rsa-pss' }` profile. ECDSA
33
+ * signatures are returned DER-encoded. Throws on unsupported key algorithms.
34
+ */
35
+ async function signData(e, t, n) {
36
+ let a = r(e, n), o = await i(e, a, t);
37
+ return a.parameters === void 0 ? {
38
+ signature: o,
39
+ algorithmOid: a.algorithmOid
40
+ } : {
41
+ signature: o,
42
+ algorithmOid: a.algorithmOid,
43
+ parametersDer: a.parameters
44
+ };
45
+ }
46
+ /**
47
+ * Converts a DER `ECDSA-Sig-Value` (RFC 5480: SEQUENCE of INTEGERs r and s)
48
+ * to the fixed-width raw `r || s` encoding WebCrypto and JOSE use.
49
+ * Throws on malformed DER or integers too large for the curve.
50
+ */
51
+ function ecdsaSignatureDerToRaw(t, n) {
52
+ return e(t, ecdsaPartLength(n));
53
+ }
54
+ /**
55
+ * Converts a fixed-width raw `r || s` ECDSA signature to the DER
56
+ * `ECDSA-Sig-Value` encoding X.509 and CMS structures embed.
57
+ * Throws when the input length does not match the curve.
58
+ */
59
+ function ecdsaSignatureRawToDer(e, n) {
60
+ return t(e, ecdsaPartLength(n));
61
+ }
62
+ /** Byte width of one ECDSA signature integer for the given curve. */
63
+ function ecdsaPartLength(e) {
64
+ switch (e) {
65
+ case "P-256": return 32;
66
+ case "P-384": return 48;
67
+ case "P-521": return 66;
68
+ default: throw Error(`Unhandled EcNamedCurve: ${String(e)}`);
69
+ }
70
+ }
71
+ //#endregion
72
+ export { ecdsaSignatureDerToRaw, ecdsaSignatureRawToDer, signData, verifySignature };
73
+
74
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.js","names":["_exhaustive"],"sources":["../../src/crypto/crypto.ts"],"sourcesContent":["/**\n * Detached-signature primitives: verify a signature against a signer's SPKI,\n * sign arbitrary bytes with a WebCrypto private key, and convert ECDSA\n * signatures between DER `ECDSA-Sig-Value` and fixed-width raw encodings.\n *\n * @module\n */\n\nimport { derEcdsaSignatureToRaw, rawEcdsaSignatureToDer } from '#micro509/internal/crypto/ecdsa';\nimport type { VerifySignedDataResult } from '#micro509/internal/crypto/sig-verify';\nimport { verifySignedDataDetailed } from '#micro509/internal/crypto/sig-verify';\nimport type { SignatureProfileInput } from '#micro509/internal/crypto/signing';\nimport { getSignatureAlgorithm, signBytes } from '#micro509/internal/crypto/signing';\nimport type { EcNamedCurve } from '#micro509/keys/keys';\n\nexport type {\n\tVerifySignatureConfigFailure,\n\tVerifySignedDataFailure,\n\tVerifySignedDataResult,\n\tVerifySignedDataSuccess,\n} from '#micro509/internal/crypto/sig-verify';\nexport type { SignatureProfileInput } from '#micro509/internal/crypto/signing';\n\n/** Input for {@linkcode verifySignature}. */\nexport interface VerifySignatureInput {\n\t/** DER `SubjectPublicKeyInfo` of the signer (`subjectPublicKeyInfoDer` on a parsed certificate). */\n\treadonly signerSpkiDer: Uint8Array;\n\t/** The signature algorithm as carried beside the signature. */\n\treadonly signatureAlgorithm: {\n\t\t/** Dotted-decimal signature algorithm OID. */\n\t\treadonly oid: string;\n\t\t/** DER algorithm parameters when the algorithm carries them (RSA-PSS). */\n\t\treadonly parametersDer?: Uint8Array;\n\t};\n\t/** The signer's public key algorithm as carried in its SPKI. */\n\treadonly publicKeyAlgorithm: {\n\t\t/** Dotted-decimal public key algorithm OID. */\n\t\treadonly oid: string;\n\t\t/** Named-curve or scheme parameters OID, when present. */\n\t\treadonly parametersOid?: string;\n\t};\n\t/** The signature bytes. ECDSA accepts DER or raw encoding. */\n\treadonly signature: Uint8Array;\n\t/** The exact bytes the signature covers. */\n\treadonly data: Uint8Array;\n}\n\n/** Result of {@linkcode signData}: the signature plus its on-wire algorithm identity. */\nexport interface SignDataResult {\n\t/** The signature bytes. ECDSA is DER `ECDSA-Sig-Value`, everything else raw. */\n\treadonly signature: Uint8Array;\n\t/** Dotted-decimal signature algorithm OID. */\n\treadonly algorithmOid: string;\n\t/** DER algorithm parameters when the algorithm carries them (NULL for PKCS#1 v1.5, RSA-PSS params). */\n\treadonly parametersDer?: Uint8Array;\n}\n\n/**\n * Verifies a detached signature against the signer's DER `SubjectPublicKeyInfo`.\n *\n * Supports RSA PKCS#1 v1.5 (SHA-256/384/512), RSA-PSS with parsed parameters,\n * ECDSA P-256/P-384/P-521, and Ed25519. When an ECDSA signature fails to\n * verify under one encoding, the alternate DER/raw encoding is retried.\n *\n * Returns a typed union: `{ ok: true, valid }` when verification ran,\n * `unsupported_signature_algorithm_parameters` or `verification_error`\n * failures otherwise.\n */\nexport function verifySignature(input: VerifySignatureInput): Promise<VerifySignedDataResult> {\n\treturn verifySignedDataDetailed(\n\t\tinput.signatureAlgorithm.oid,\n\t\tinput.signatureAlgorithm.parametersDer,\n\t\tinput.publicKeyAlgorithm.oid,\n\t\tinput.publicKeyAlgorithm.parametersOid,\n\t\tinput.signerSpkiDer,\n\t\tinput.signature,\n\t\tinput.data,\n\t);\n}\n\n/**\n * Signs `data` with a WebCrypto private key and returns the signature beside\n * the resolved `AlgorithmIdentifier` material for embedding in a signed\n * structure.\n *\n * The algorithm is inferred from the key (RSASSA-PKCS1-v1_5, ECDSA, Ed25519);\n * RSA-PSS keys require an explicit `{ kind: 'rsa-pss' }` profile. ECDSA\n * signatures are returned DER-encoded. Throws on unsupported key algorithms.\n */\nexport async function signData(\n\tprivateKey: CryptoKey,\n\tdata: Uint8Array,\n\tprofile?: SignatureProfileInput,\n): Promise<SignDataResult> {\n\tconst algorithm = getSignatureAlgorithm(privateKey, profile);\n\tconst signature = await signBytes(privateKey, algorithm, data);\n\treturn algorithm.parameters === undefined\n\t\t? { signature, algorithmOid: algorithm.algorithmOid }\n\t\t: { signature, algorithmOid: algorithm.algorithmOid, parametersDer: algorithm.parameters };\n}\n\n/**\n * Converts a DER `ECDSA-Sig-Value` (RFC 5480: SEQUENCE of INTEGERs r and s)\n * to the fixed-width raw `r || s` encoding WebCrypto and JOSE use.\n * Throws on malformed DER or integers too large for the curve.\n */\nexport function ecdsaSignatureDerToRaw(signature: Uint8Array, curve: EcNamedCurve): Uint8Array {\n\treturn derEcdsaSignatureToRaw(signature, ecdsaPartLength(curve));\n}\n\n/**\n * Converts a fixed-width raw `r || s` ECDSA signature to the DER\n * `ECDSA-Sig-Value` encoding X.509 and CMS structures embed.\n * Throws when the input length does not match the curve.\n */\nexport function ecdsaSignatureRawToDer(signature: Uint8Array, curve: EcNamedCurve): Uint8Array {\n\treturn rawEcdsaSignatureToDer(signature, ecdsaPartLength(curve));\n}\n\n/** Byte width of one ECDSA signature integer for the given curve. */\nfunction ecdsaPartLength(curve: EcNamedCurve): number {\n\tswitch (curve) {\n\t\tcase 'P-256':\n\t\t\treturn 32;\n\t\tcase 'P-384':\n\t\t\treturn 48;\n\t\tcase 'P-521':\n\t\t\treturn 66;\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = curve;\n\t\t\tthrow new Error(`Unhandled EcNamedCurve: ${String(_exhaustive)}`);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,gBAAgB,GAA8D;CAC7F,OAAO,EACN,EAAM,mBAAmB,KACzB,EAAM,mBAAmB,eACzB,EAAM,mBAAmB,KACzB,EAAM,mBAAmB,eACzB,EAAM,eACN,EAAM,WACN,EAAM,IACP;AACD;;;;;;;;;;AAWA,eAAsB,SACrB,GACA,GACA,GAC0B;CAC1B,IAAM,IAAY,EAAsB,GAAY,CAAO,GACrD,IAAY,MAAM,EAAU,GAAY,GAAW,CAAI;CAC7D,OAAO,EAAU,eAAe,KAAA,IAC7B;EAAE;EAAW,cAAc,EAAU;CAAa,IAClD;EAAE;EAAW,cAAc,EAAU;EAAc,eAAe,EAAU;CAAW;AAC3F;;;;;;AAOA,SAAgB,uBAAuB,GAAuB,GAAiC;CAC9F,OAAO,EAAuB,GAAW,gBAAgB,CAAK,CAAC;AAChE;;;;;;AAOA,SAAgB,uBAAuB,GAAuB,GAAiC;CAC9F,OAAO,EAAuB,GAAW,gBAAgB,CAAK,CAAC;AAChE;;AAGA,SAAS,gBAAgB,GAA6B;CACrD,QAAQ,GAAR;EACC,KAAK,SACJ,OAAO;EACR,KAAK,SACJ,OAAO;EACR,KAAK,SACJ,OAAO;EACR,SAEC,MAAU,MAAM,2BAA2B,OAAOA,CAAW,GAAG;CAElE;AACD"}
@@ -0,0 +1,4 @@
1
+ import { VerifySignatureConfigFailure, VerifySignedDataFailure, VerifySignedDataResult, VerifySignedDataSuccess } from "./internal/crypto/sig-verify.js";
2
+ import { SignatureProfileInput } from "./internal/crypto/signing.js";
3
+ import { SignDataResult, VerifySignatureInput, ecdsaSignatureDerToRaw, ecdsaSignatureRawToDer, signData, verifySignature } from "./crypto/crypto.js";
4
+ export { type SignDataResult, type SignatureProfileInput, type VerifySignatureConfigFailure, type VerifySignatureInput, type VerifySignedDataFailure, type VerifySignedDataResult, type VerifySignedDataSuccess, ecdsaSignatureDerToRaw, ecdsaSignatureRawToDer, signData, verifySignature };
package/dist/crypto.js ADDED
@@ -0,0 +1,2 @@
1
+ import { ecdsaSignatureDerToRaw as e, ecdsaSignatureRawToDer as t, signData as n, verifySignature as r } from "./crypto/crypto.js";
2
+ export { e as ecdsaSignatureDerToRaw, t as ecdsaSignatureRawToDer, n as signData, r as verifySignature };
package/dist/der/der.d.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import { ErrorResult, Micro509Error } from "../result/result.js";
1
2
  import { DerElement, ReadRootElementOptions, ReadSequenceChildrenOptions } from "../internal/asn1/der.js";
2
3
  import { DerBitString } from "../internal/asn1/asn1.js";
3
- import { ErrorResult, Micro509Error } from "../result/result.js";
4
4
  //#region src/der/der.d.ts
5
5
  /** Machine-readable failure reason for the DER readers and decoders. */
6
6
  type DecodeDerErrorCode = "malformed";
package/dist/index.d.ts CHANGED
@@ -1,22 +1,26 @@
1
+ import { Pbes2Parameters } from "./internal/crypto/pbes2.js";
1
2
  import { ErrorResult, IndexedErrorResult, IndexedMicro509Error, Micro509Error, Result, ResultError, isResultError, unwrap, unwrapOr } from "./result/result.js";
2
- import { DecryptRsaOaepErrorCode, DecryptRsaOaepFailure, DecryptRsaOaepResult, EcKeyAlgorithmInput, EcNamedCurve, Ed25519KeyAlgorithmInput, EncryptRsaOaepErrorCode, EncryptRsaOaepFailure, EncryptRsaOaepResult, EncryptedPkcs8Options, ImportEcKeyInput, ImportEd25519KeyInput, ImportEncryptedKeyErrorCode, ImportEncryptedKeyFailure, ImportEncryptedKeyResult, ImportKeyErrorCode, ImportKeyFailure, ImportKeyResult, ImportRsaKeyInput, KeyAlgorithmInput, KeyPairMaterial, LegacyPemEncryptionOptions, PrivateKeyImportInput, PublicKeyImportInput, RsaHash, RsaKeyAlgorithmInput, RsaOaepOptions, RsaScheme, RsaSignatureScheme, decryptRsaOaep, decryptRsaOaepOrThrow, derivePublicKey, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, generateKeyPair, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow } from "./keys/keys.js";
3
+ import { DecryptRsaOaepErrorCode, DecryptRsaOaepFailure, DecryptRsaOaepResult, EcKeyAlgorithmInput, EcNamedCurve, Ed25519KeyAlgorithmInput, EncryptRsaOaepErrorCode, EncryptRsaOaepFailure, EncryptRsaOaepResult, EncryptedPkcs8Options, ImportEcKeyInput, ImportEd25519KeyInput, ImportEncryptedKeyErrorCode, ImportEncryptedKeyFailure, ImportEncryptedKeyResult, ImportKeyErrorCode, ImportKeyFailure, ImportKeyResult, ImportRsaKeyInput, KeyAlgorithmInput, KeyPairMaterial, LegacyPemEncryptionOptions, PrivateKeyImportInput, PublicKeyImportInput, RsaHash, RsaKeyAlgorithmInput, RsaOaepOptions, RsaScheme, RsaSignatureScheme, decryptRsaOaep, decryptRsaOaepOrThrow, derivePublicKey, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, generateKeyPair, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, inspectEncryptedPkcs8Der } from "./keys/keys.js";
3
4
  import { CategorizePemBlocksResult, CategorizedPemBlocks, PemBlock, PemDecodeResult, PemErrorCode, PemFailure, SplitPemBlocksResult, categorizePemBlocks, categorizePemBlocksOrThrow, pemDecode, pemDecodeOrThrow, pemEncode, splitPemBlocks, splitPemBlocksOrThrow } from "./pem/pem.js";
4
5
  import { ParsePkcs12MacDataErrorCode, ParsePkcs12MacDataFailure, ParsePkcs12MacDataResult, ParsedPkcs12MacData, Pkcs12MacOptions } from "./pkcs/pkcs12-mac.js";
5
- import { NameAttribute, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput } from "./x509/name.js";
6
- import { AuthorityInformationAccess, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, DistributionPoint, DistributionPointName, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, NameConstraintForm, NameConstraints, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyQualifierInfo, SubjectAltName } from "./x509/extensions.js";
7
- import { DecodedExtensionMap, DecodedExtensionValue, ExtensionDecoder, ExtensionDecoderMap, MatchCertificatePrivateKeyErrorCode, MatchCertificatePrivateKeyFailure, MatchCertificatePrivateKeyFailureResult, MatchCertificatePrivateKeyResult, MatchCertificatePrivateKeySuccess, ParseCertificateErrorCode, ParseCertificateFailure, ParseCertificateResult, ParseCertificateSigningRequestErrorCode, ParseCertificateSigningRequestFailure, ParseCertificateSigningRequestResult, ParseOptions, ParsedCertificate, ParsedCertificateSigningRequest, ParsedDistributionPoint, ParsedDistributionPointName, ParsedExtension, ParsedIssuingDistributionPoint, ParsedName, ParsedNameAttribute, ParsedRelativeDistinguishedName, certificateMatchesPrivateKey, decodeExtension, decodeExtensionMap, decodeExtensions, defineExtensionDecoder, defineExtensionDecoderMap, findExtension, getSubjectPublicKey, getSubjectPublicKeyOrThrow, matchCertificatePrivateKey, parseCertificateChainPem, parseCertificateDer, parseCertificateDerOrThrow, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow } from "./x509/parse.js";
6
+ import { compareDistinguishedNames } from "./internal/shared/dn.js";
7
+ import { NameAttribute, NameEncoderErrorCode, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput } from "./x509/name.js";
8
+ import { ExtensionEncoderErrorCode } from "./internal/x509/extension-errors.js";
9
+ import { AuthorityInformationAccess, AuthorityInformationAccessInput, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, DistributionPoint, DistributionPointName, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, NameConstraintForm, NameConstraints, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyQualifierInfo, SubjectAltName } from "./x509/extensions.js";
10
+ import { DecodedExtensionMap, DecodedExtensionValue, ExtensionDecoder, ExtensionDecoderMap, MatchCertificatePrivateKeyErrorCode, MatchCertificatePrivateKeyFailure, MatchCertificatePrivateKeyFailureResult, MatchCertificatePrivateKeyResult, MatchCertificatePrivateKeySuccess, ParseCertificateChainResult, ParseCertificateErrorCode, ParseCertificateFailure, ParseCertificateResult, ParseCertificateSigningRequestErrorCode, ParseCertificateSigningRequestFailure, ParseCertificateSigningRequestResult, ParseOptions, ParsedCertificate, ParsedCertificateSigningRequest, ParsedDistributionPoint, ParsedDistributionPointName, ParsedExtension, ParsedIssuingDistributionPoint, ParsedIssuingDistributionPointBase, ParsedIssuingDistributionPointScope, ParsedName, ParsedNameAttribute, ParsedRelativeDistinguishedName, certificateMatchesPrivateKey, decodeExtension, decodeExtensionMap, decodeExtensions, defineExtensionDecoder, defineExtensionDecoderMap, findExtension, getSubjectPublicKey, getSubjectPublicKeyOrThrow, matchCertificatePrivateKey, parseCertificateChainPem, parseCertificateChainPemOrThrow, parseCertificateDer, parseCertificateDerOrThrow, parseCertificateFromSource, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseCertificatesFromSource, parseDistinguishedNameDer } from "./x509/parse.js";
8
11
  import { CreatePfxErrorCode, CreatePfxFailure, CreatePfxInput, CreatePfxResult, ParsePfxErrorCode, ParsePfxFailure, ParsePfxOptions, ParsePfxResult, ParsedPfx, ParsedPfxAttribute, ParsedPfxBag, ParsedPfxBagAttributes, PfxBagAttributesInput, PfxCertificateBagInput, PfxCertificateSource, PfxEncryptionOptions, PfxMaterial, PfxPrivateKeyBagInput, PfxPrivateKeySource, createPfx, parsePfxDer, parsePfxPem } from "./pkcs/pfx.js";
9
- import { CertificateMaterial, CreateCertificateInput, CreateSelfSignedCertificateInput, SelfSignedCertificateResult, ValidityInput, createCertificate, createSelfSignedCertificate } from "./x509/certificate.js";
10
- import { CreatePkcs7CertBagErrorCode, CreatePkcs7CertBagFailure, CreatePkcs7CertBagResult, CreatePkcs7SignedDataErrorCode, CreatePkcs7SignedDataFailure, CreatePkcs7SignedDataInput, CreatePkcs7SignedDataResult, ParsePkcs7CertBagResult, ParsePkcs7ErrorCode, ParsePkcs7Failure, ParsePkcs7SignedDataResult, ParsedPkcs7SignedData, ParsedPkcs7SignerInfo, ParsedPkcs7SignerInfoBase, Pkcs7CertBagMaterial, Pkcs7CertificateSource, Pkcs7SignedDataMaterial, Pkcs7Signer, VerifyPkcs7SignedDataErrorCode, VerifyPkcs7SignedDataFailure, VerifyPkcs7SignedDataOptions, VerifyPkcs7SignedDataResult, createPkcs7CertBag, createPkcs7SignedData, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, verifyPkcs7SignedData } from "./pkcs/pkcs7.js";
11
- import { CertificateRevocationListMaterial, CheckCertificateRevocationAgainstCrlErrorCode, CheckCertificateRevocationAgainstCrlFailure, CheckCertificateRevocationAgainstCrlFailureDetails, CheckCertificateRevocationAgainstCrlGoodValue, CheckCertificateRevocationAgainstCrlInput, CheckCertificateRevocationAgainstCrlResult, CheckCertificateRevocationAgainstCrlRevokedValue, CheckCertificateRevocationAgainstCrlValue, CreateCertificateRevocationListInput, CrlApplicabilityFailureReason, CrlCertificateSource, CrlSource, ParseCertificateRevocationListErrorCode, ParseCertificateRevocationListFailure, ParseCertificateRevocationListResult, ParsedCertificateRevocationList, ParsedRevokedCertificate, RevocationReason, RevokedCertificateInput, ValidateCertificateRevocationListFailure, ValidateCertificateRevocationListInput, ValidateCertificateRevocationListResult, VerifyCertificateRevocationListSignatureFailure, VerifyCertificateRevocationListSignatureResult, checkCertificateRevocationAgainstCrl, createCertificateRevocationList, isCertificateRevoked, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, validateCertificateRevocationList, verifyCertificateRevocationListSignature } from "./revocation/crl.js";
12
- import { CreateOcspRequestInput, CreateOcspRequestItemInput, CreateOcspResponseInput, CreateOcspSingleResponseInput, OcspCertStatus, OcspCertificateSource, OcspHashAlgorithm, OcspRequestMaterial, OcspRequestSource, OcspResponderRevocationPolicy, OcspResponseMaterial, OcspResponseStatus, ParseOcspRequestErrorCode, ParseOcspRequestFailure, ParseOcspRequestResult, ParseOcspResponseErrorCode, ParseOcspResponseFailure, ParseOcspResponseResult, ParsedOcspCertId, ParsedOcspRequest, ParsedOcspResponderId, ParsedOcspResponse, ParsedOcspSingleResponse, ValidateOcspResponseErrorCode, ValidateOcspResponseFailure, ValidateOcspResponseInput, ValidateOcspResponseResult, VerifyOcspResponseSignatureFailure, VerifyOcspResponseSignatureResult, createOcspRequest, createOcspResponse, hasOcspNoCheckExtension, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, validateOcspResponse, verifyOcspResponseSignature } from "./revocation/ocsp.js";
12
+ import { CertificateMaterial, CreateCertificateErrorCode, CreateCertificateInput, CreateSelfSignedCertificateBase, CreateSelfSignedCertificateInput, SelfSignedCertificateResult, SelfSignedKeySource, ValidityInput, createCertificate, createSelfSignedCertificate } from "./x509/certificate.js";
13
+ import { CreatePkcs7CertBagErrorCode, CreatePkcs7CertBagFailure, CreatePkcs7CertBagResult, CreatePkcs7SignedDataErrorCode, CreatePkcs7SignedDataFailure, CreatePkcs7SignedDataInput, CreatePkcs7SignedDataResult, ParsePkcs7CertBagResult, ParsePkcs7ErrorCode, ParsePkcs7Failure, ParsePkcs7SignedDataResult, ParsedCertificateChoice, ParsedPkcs7SignedData, ParsedPkcs7SignerInfo, ParsedPkcs7SignerInfoBase, ParsedSignerIdentifier, Pkcs7CertBagMaterial, Pkcs7CertificateSource, Pkcs7SignedDataMaterial, Pkcs7Signer, VerifiedPkcs7Signer, VerifyPkcs7SignedDataErrorCode, VerifyPkcs7SignedDataFailure, VerifyPkcs7SignedDataOptions, VerifyPkcs7SignedDataResult, createPkcs7CertBag, createPkcs7SignedData, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, verifyPkcs7SignedData } from "./pkcs/pkcs7.js";
14
+ import { CertificateRevocationListMaterial, CheckCertificateRevocationAgainstCrlErrorCode, CheckCertificateRevocationAgainstCrlFailure, CheckCertificateRevocationAgainstCrlFailureDetails, CheckCertificateRevocationAgainstCrlGoodValue, CheckCertificateRevocationAgainstCrlInput, CheckCertificateRevocationAgainstCrlResult, CheckCertificateRevocationAgainstCrlRevokedValue, CheckCertificateRevocationAgainstCrlValue, CreateCertificateRevocationListInput, CrlApplicabilityFailureReason, CrlCertificateSource, CrlEncoderErrorCode, CrlSource, ParseCertificateRevocationListErrorCode, ParseCertificateRevocationListFailure, ParseCertificateRevocationListResult, ParsedCertificateRevocationList, ParsedRevokedCertificate, RevocationReason, RevokedCertificateInput, ValidateCertificateRevocationListFailure, ValidateCertificateRevocationListInput, ValidateCertificateRevocationListResult, VerifyCertificateRevocationListSignatureFailure, VerifyCertificateRevocationListSignatureResult, checkCertificateRevocationAgainstCrl, createCertificateRevocationList, isCertificateRevoked, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, revocationReasonFromCode, validateCertificateRevocationList, verifyCertificateRevocationListSignature } from "./revocation/crl.js";
15
+ import { CreateOcspCertStatusInput, CreateOcspRequestInput, CreateOcspRequestItemInput, CreateOcspResponseInput, CreateOcspSingleResponseInput, OcspCertStatus, OcspCertificateSource, OcspEncoderErrorCode, OcspHashAlgorithm, OcspRequestMaterial, OcspRequestSource, OcspResponderRevocationPolicy, OcspResponseMaterial, OcspResponseStatus, ParseOcspRequestErrorCode, ParseOcspRequestFailure, ParseOcspRequestResult, ParseOcspResponseErrorCode, ParseOcspResponseFailure, ParseOcspResponseResult, ParsedOcspCertId, ParsedOcspCertStatus, ParsedOcspRequest, ParsedOcspResponderId, ParsedOcspResponse, ParsedOcspSingleResponse, ValidateOcspResponseErrorCode, ValidateOcspResponseFailure, ValidateOcspResponseInput, ValidateOcspResponseResult, VerifyOcspResponseSignatureFailure, VerifyOcspResponseSignatureResult, createOcspRequest, createOcspResponse, hasOcspNoCheckExtension, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, validateOcspResponse, verifyOcspResponseSignature } from "./revocation/ocsp.js";
13
16
  import { CheckCertificateRevocationErrorCode, CheckCertificateRevocationFailureDetails, CheckCertificateRevocationInput, CheckCertificateRevocationResult, CheckCertificateRevocationValue, ConfiguredOcspResponder, ConfiguredOcspResponderCertificate, OcspResponderCandidate, OcspResponderSource, REVOCATION_INDETERMINATE_REASON_CODES, ResolveOcspResponderCandidatesInput, RevocationCertificateSource, RevocationCheckGoodValue, RevocationCheckIndeterminateValue, RevocationCheckRevokedValue, RevocationCrlEvidenceInput, RevocationEvidenceInput, RevocationEvidenceKind, RevocationIndeterminateEvidence, RevocationIndeterminateReasonCode, RevocationOcspEvidenceInput, RevocationStatus, checkCertificateRevocation, getCertificateOcspResponderUris, resolveOcspResponderCandidates } from "./revocation/revocation.js";
14
17
  import { CertificateRevocationStatus, CheckChainRevocationInput, CheckChainRevocationResult, CheckChainRevocationValue, OcspResponseSource, REVOCATION_INDETERMINATE_REASONS, RevocationExecutionError, RevocationIndeterminateReason, RevocationPolicy, RevocationSource, checkChainRevocation } from "./revocation/chain.js";
15
18
  import { DnsServiceIdentityInput, IpServiceIdentityInput, MatchServiceIdentityErrorCode, MatchServiceIdentityFailure, MatchServiceIdentityFailureDetails, MatchServiceIdentityFailureResult, MatchServiceIdentityInput, MatchServiceIdentityResult, MatchServiceIdentitySuccess, ServiceIdentityInput, ServiceIdentityType, SrvServiceIdentityInput, UriServiceIdentityInput, matchCertificateServiceIdentity, matchServiceIdentity } from "./verify/identity.js";
16
19
  import { InitialNameConstraintsInput } from "./verify/name-constraints.js";
17
20
  import { ConstrainedPolicy, PolicyValidationInput, PolicyValidationOutcome } from "./verify/policy.js";
21
+ import { isSelfIssued } from "./internal/verify/verify-path.js";
18
22
  import { BuildCandidatePathInput, BuildCandidatePathResult, CandidatePath, CertificateSource, ChainRevocationInput, CsrSource, EkuCheckFailure, EkuCheckPurpose, EkuCheckResult, TrustAnchor, VERIFY_ERROR_CODES, ValidateCandidatePathInput, ValidateCandidatePathResult, ValidateCandidatePathSuccess, ValidateForCaInput, ValidateForCodeSigningInput, ValidateForTlsClientInput, ValidateForTlsServerInput, VerifiedCertificateChain, VerifyCertificateChainInput, VerifyChainFailure, VerifyChainResult, VerifyErrorCode, VerifyFailureDetails, VerifyPurpose, VerifyRequestFailure, VerifyRequestResult, buildCandidatePath, checkExtendedKeyUsage, trustAnchorFromCertificate, validateCandidatePath, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, verifyCertificateChain, verifyCertificateSigningRequest } from "./verify/verify.js";
19
23
  import { CreateCsrInput, CsrMaterial, createCertificateSigningRequest } from "./x509/csr.js";
20
24
  import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint } from "./x509/fingerprint.js";
21
25
  import { SubjectAltNameTextOptions, distinguishedNameToString, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString } from "./x509/name-text.js";
22
- export { type AuthorityInformationAccess, type BasicConstraints, type BuildCandidatePathInput, type BuildCandidatePathResult, type CandidatePath, type CategorizePemBlocksResult, type CategorizedPemBlocks, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CertificateRevocationListMaterial, type CertificateRevocationStatus, type CertificateSource, type ChainRevocationInput, type CheckCertificateRevocationAgainstCrlErrorCode, type CheckCertificateRevocationAgainstCrlFailure, type CheckCertificateRevocationAgainstCrlFailureDetails, type CheckCertificateRevocationAgainstCrlGoodValue, type CheckCertificateRevocationAgainstCrlInput, type CheckCertificateRevocationAgainstCrlResult, type CheckCertificateRevocationAgainstCrlRevokedValue, type CheckCertificateRevocationAgainstCrlValue, type CheckCertificateRevocationErrorCode, type CheckCertificateRevocationFailureDetails, type CheckCertificateRevocationInput, type CheckCertificateRevocationResult, type CheckCertificateRevocationValue, type CheckChainRevocationInput, type CheckChainRevocationResult, type CheckChainRevocationValue, type ConfiguredOcspResponder, type ConfiguredOcspResponderCertificate, type ConstrainedPolicy, type CreateCertificateInput, type CreateCertificateRevocationListInput, type CreateCsrInput, type CreateOcspRequestInput, type CreateOcspRequestItemInput, type CreateOcspResponseInput, type CreateOcspSingleResponseInput, type CreatePfxErrorCode, type CreatePfxFailure, type CreatePfxInput, type CreatePfxResult, type CreatePkcs7CertBagErrorCode, type CreatePkcs7CertBagFailure, type CreatePkcs7CertBagResult, type CreatePkcs7SignedDataErrorCode, type CreatePkcs7SignedDataFailure, type CreatePkcs7SignedDataInput, type CreatePkcs7SignedDataResult, type CreateSelfSignedCertificateInput, type CrlApplicabilityFailureReason, type CrlCertificateSource, type CrlSource, type CsrMaterial, type CsrSource, type DecodedExtensionMap, type DecodedExtensionValue, type DecryptRsaOaepErrorCode, type DecryptRsaOaepFailure, type DecryptRsaOaepResult, type DistributionPoint, type DistributionPointName, type DnsServiceIdentityInput, type EcKeyAlgorithmInput, type EcNamedCurve, type Ed25519KeyAlgorithmInput, type EkuCheckFailure, type EkuCheckPurpose, type EkuCheckResult, type EncryptRsaOaepErrorCode, type EncryptRsaOaepFailure, type EncryptRsaOaepResult, type EncryptedPkcs8Options, type ErrorResult, type ExtendedKeyUsage, type ExtensionDecoder, type ExtensionDecoderMap, type GeneralName, type GeneralSubtree, type ImportEcKeyInput, type ImportEd25519KeyInput, type ImportEncryptedKeyErrorCode, type ImportEncryptedKeyFailure, type ImportEncryptedKeyResult, type ImportKeyErrorCode, type ImportKeyFailure, type ImportKeyResult, type ImportRsaKeyInput, type IndexedErrorResult, type IndexedMicro509Error, type InhibitAnyPolicy, type InitialNameConstraintsInput, type IpServiceIdentityInput, type IssuingDistributionPoint, type IssuingDistributionPointBase, type IssuingDistributionPointForAttributeCerts, type IssuingDistributionPointForCaCerts, type IssuingDistributionPointForUserCerts, type KeyAlgorithmInput, type KeyPairMaterial, type KeyUsage, type LegacyPemEncryptionOptions, type MatchCertificatePrivateKeyErrorCode, type MatchCertificatePrivateKeyFailure, type MatchCertificatePrivateKeyFailureResult, type MatchCertificatePrivateKeyResult, type MatchCertificatePrivateKeySuccess, type MatchServiceIdentityErrorCode, type MatchServiceIdentityFailure, type MatchServiceIdentityFailureDetails, type MatchServiceIdentityFailureResult, type MatchServiceIdentityInput, type MatchServiceIdentityResult, type MatchServiceIdentitySuccess, type Micro509Error, type NameAttribute, type NameConstraintForm, type NameConstraints, type NameFieldKey, type NameInput, type NameObject, type OcspCertStatus, type OcspCertificateSource, type OcspHashAlgorithm, type OcspRequestMaterial, type OcspRequestSource, type OcspResponderCandidate, type OcspResponderRevocationPolicy, type OcspResponderSource, type OcspResponseMaterial, type OcspResponseSource, type OcspResponseStatus, type ParseCertificateErrorCode, type ParseCertificateFailure, type ParseCertificateResult, type ParseCertificateRevocationListErrorCode, type ParseCertificateRevocationListFailure, type ParseCertificateRevocationListResult, type ParseCertificateSigningRequestErrorCode, type ParseCertificateSigningRequestFailure, type ParseCertificateSigningRequestResult, type ParseOcspRequestErrorCode, type ParseOcspRequestFailure, type ParseOcspRequestResult, type ParseOcspResponseErrorCode, type ParseOcspResponseFailure, type ParseOcspResponseResult, type ParseOptions, type ParsePfxErrorCode, type ParsePfxFailure, type ParsePfxOptions, type ParsePfxResult, type ParsePkcs12MacDataErrorCode, type ParsePkcs12MacDataFailure, type ParsePkcs12MacDataResult, type ParsePkcs7CertBagResult, type ParsePkcs7ErrorCode, type ParsePkcs7Failure, type ParsePkcs7SignedDataResult, type ParsedBitFlags, type ParsedCertificate, type ParsedCertificateRevocationList, type ParsedCertificateSigningRequest, type ParsedDistributionPoint, type ParsedDistributionPointName, type ParsedExtension, type ParsedIssuingDistributionPoint, type ParsedName, type ParsedNameAttribute, type ParsedNameConstraintForm, type ParsedOcspCertId, type ParsedOcspRequest, type ParsedOcspResponderId, type ParsedOcspResponse, type ParsedOcspSingleResponse, type ParsedPfx, type ParsedPfxAttribute, type ParsedPfxBag, type ParsedPfxBagAttributes, type ParsedPkcs12MacData, type ParsedPkcs7SignedData, type ParsedPkcs7SignerInfo, type ParsedPkcs7SignerInfoBase, type ParsedRelativeDistinguishedName, type ParsedRevokedCertificate, type PemBlock, type PemDecodeResult, type PemErrorCode, type PemFailure, type PfxBagAttributesInput, type PfxCertificateBagInput, type PfxCertificateSource, type PfxEncryptionOptions, type PfxMaterial, type PfxPrivateKeyBagInput, type PfxPrivateKeySource, type Pkcs12MacOptions, type Pkcs7CertBagMaterial, type Pkcs7CertificateSource, type Pkcs7SignedDataMaterial, type Pkcs7Signer, type PolicyConstraints, type PolicyInformation, type PolicyMapping, type PolicyMappings, type PolicyQualifierInfo, type PolicyValidationInput, type PolicyValidationOutcome, type PrivateKeyImportInput, type PublicKeyImportInput, REVOCATION_INDETERMINATE_REASONS, REVOCATION_INDETERMINATE_REASON_CODES, type RelativeDistinguishedNameInput, type ResolveOcspResponderCandidatesInput, type Result, type ResultError, type RevocationCertificateSource, type RevocationCheckGoodValue, type RevocationCheckIndeterminateValue, type RevocationCheckRevokedValue, type RevocationCrlEvidenceInput, type RevocationEvidenceInput, type RevocationEvidenceKind, type RevocationExecutionError, type RevocationIndeterminateEvidence, type RevocationIndeterminateReason, type RevocationIndeterminateReasonCode, type RevocationOcspEvidenceInput, type RevocationPolicy, type RevocationReason, type RevocationSource, type RevocationStatus, type RevokedCertificateInput, type RsaHash, type RsaKeyAlgorithmInput, type RsaOaepOptions, type RsaScheme, type RsaSignatureScheme, type SelfSignedCertificateResult, type ServiceIdentityInput, type ServiceIdentityType, type SplitPemBlocksResult, type SrvServiceIdentityInput, type SubjectAltName, type SubjectAltNameTextOptions, type TrustAnchor, type UriServiceIdentityInput, VERIFY_ERROR_CODES, type ValidateCandidatePathInput, type ValidateCandidatePathResult, type ValidateCandidatePathSuccess, type ValidateCertificateRevocationListFailure, type ValidateCertificateRevocationListInput, type ValidateCertificateRevocationListResult, type ValidateForCaInput, type ValidateForCodeSigningInput, type ValidateForTlsClientInput, type ValidateForTlsServerInput, type ValidateOcspResponseErrorCode, type ValidateOcspResponseFailure, type ValidateOcspResponseInput, type ValidateOcspResponseResult, type ValidityInput, type VerifiedCertificateChain, type VerifyCertificateChainInput, type VerifyCertificateRevocationListSignatureFailure, type VerifyCertificateRevocationListSignatureResult, type VerifyChainFailure, type VerifyChainResult, type VerifyErrorCode, type VerifyFailureDetails, type VerifyOcspResponseSignatureFailure, type VerifyOcspResponseSignatureResult, type VerifyPkcs7SignedDataErrorCode, type VerifyPkcs7SignedDataFailure, type VerifyPkcs7SignedDataOptions, type VerifyPkcs7SignedDataResult, type VerifyPurpose, type VerifyRequestFailure, type VerifyRequestResult, buildCandidatePath, categorizePemBlocks, categorizePemBlocksOrThrow, certificateFingerprint, certificateMatchesPrivateKey, checkCertificateRevocation, checkCertificateRevocationAgainstCrl, checkChainRevocation, checkExtendedKeyUsage, createCertificate, createCertificateRevocationList, createCertificateSigningRequest, createOcspRequest, createOcspResponse, createPfx, createPkcs7CertBag, createPkcs7SignedData, createSelfSignedCertificate, decodeExtension, decodeExtensionMap, decodeExtensions, decryptRsaOaep, decryptRsaOaepOrThrow, defineExtensionDecoder, defineExtensionDecoderMap, derivePublicKey, distinguishedNameToString, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, findExtension, generateKeyPair, getCertificateOcspResponderUris, getSubjectPublicKey, getSubjectPublicKeyOrThrow, hasOcspNoCheckExtension, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, isCertificateRevoked, isResultError, matchCertificatePrivateKey, matchCertificateServiceIdentity, matchServiceIdentity, parseCertificateChainPem, parseCertificateDer, parseCertificateDerOrThrow, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, parsePfxDer, parsePfxPem, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, pemDecode, pemDecodeOrThrow, pemEncode, relativeDistinguishedNameToString, resolveOcspResponderCandidates, splitPemBlocks, splitPemBlocksOrThrow, subjectAltNameLabel, subjectAltNameToString, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
26
+ export { type AuthorityInformationAccess, type AuthorityInformationAccessInput, type BasicConstraints, type BuildCandidatePathInput, type BuildCandidatePathResult, type CandidatePath, type CategorizePemBlocksResult, type CategorizedPemBlocks, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CertificateRevocationListMaterial, type CertificateRevocationStatus, type CertificateSource, type ChainRevocationInput, type CheckCertificateRevocationAgainstCrlErrorCode, type CheckCertificateRevocationAgainstCrlFailure, type CheckCertificateRevocationAgainstCrlFailureDetails, type CheckCertificateRevocationAgainstCrlGoodValue, type CheckCertificateRevocationAgainstCrlInput, type CheckCertificateRevocationAgainstCrlResult, type CheckCertificateRevocationAgainstCrlRevokedValue, type CheckCertificateRevocationAgainstCrlValue, type CheckCertificateRevocationErrorCode, type CheckCertificateRevocationFailureDetails, type CheckCertificateRevocationInput, type CheckCertificateRevocationResult, type CheckCertificateRevocationValue, type CheckChainRevocationInput, type CheckChainRevocationResult, type CheckChainRevocationValue, type ConfiguredOcspResponder, type ConfiguredOcspResponderCertificate, type ConstrainedPolicy, type CreateCertificateErrorCode, type CreateCertificateInput, type CreateCertificateRevocationListInput, type CreateCsrInput, type CreateOcspCertStatusInput, type CreateOcspRequestInput, type CreateOcspRequestItemInput, type CreateOcspResponseInput, type CreateOcspSingleResponseInput, type CreatePfxErrorCode, type CreatePfxFailure, type CreatePfxInput, type CreatePfxResult, type CreatePkcs7CertBagErrorCode, type CreatePkcs7CertBagFailure, type CreatePkcs7CertBagResult, type CreatePkcs7SignedDataErrorCode, type CreatePkcs7SignedDataFailure, type CreatePkcs7SignedDataInput, type CreatePkcs7SignedDataResult, type CreateSelfSignedCertificateBase, type CreateSelfSignedCertificateInput, type CrlApplicabilityFailureReason, type CrlCertificateSource, type CrlEncoderErrorCode, type CrlSource, type CsrMaterial, type CsrSource, type DecodedExtensionMap, type DecodedExtensionValue, type DecryptRsaOaepErrorCode, type DecryptRsaOaepFailure, type DecryptRsaOaepResult, type DistributionPoint, type DistributionPointName, type DnsServiceIdentityInput, type EcKeyAlgorithmInput, type EcNamedCurve, type Ed25519KeyAlgorithmInput, type EkuCheckFailure, type EkuCheckPurpose, type EkuCheckResult, type EncryptRsaOaepErrorCode, type EncryptRsaOaepFailure, type EncryptRsaOaepResult, type EncryptedPkcs8Options, type ErrorResult, type ExtendedKeyUsage, type ExtensionDecoder, type ExtensionDecoderMap, type ExtensionEncoderErrorCode, type GeneralName, type GeneralSubtree, type ImportEcKeyInput, type ImportEd25519KeyInput, type ImportEncryptedKeyErrorCode, type ImportEncryptedKeyFailure, type ImportEncryptedKeyResult, type ImportKeyErrorCode, type ImportKeyFailure, type ImportKeyResult, type ImportRsaKeyInput, type IndexedErrorResult, type IndexedMicro509Error, type InhibitAnyPolicy, type InitialNameConstraintsInput, type IpServiceIdentityInput, type IssuingDistributionPoint, type IssuingDistributionPointBase, type IssuingDistributionPointForAttributeCerts, type IssuingDistributionPointForCaCerts, type IssuingDistributionPointForUserCerts, type KeyAlgorithmInput, type KeyPairMaterial, type KeyUsage, type LegacyPemEncryptionOptions, type MatchCertificatePrivateKeyErrorCode, type MatchCertificatePrivateKeyFailure, type MatchCertificatePrivateKeyFailureResult, type MatchCertificatePrivateKeyResult, type MatchCertificatePrivateKeySuccess, type MatchServiceIdentityErrorCode, type MatchServiceIdentityFailure, type MatchServiceIdentityFailureDetails, type MatchServiceIdentityFailureResult, type MatchServiceIdentityInput, type MatchServiceIdentityResult, type MatchServiceIdentitySuccess, type Micro509Error, type NameAttribute, type NameConstraintForm, type NameConstraints, type NameEncoderErrorCode, type NameFieldKey, type NameInput, type NameObject, type OcspCertStatus, type OcspCertificateSource, type OcspEncoderErrorCode, type OcspHashAlgorithm, type OcspRequestMaterial, type OcspRequestSource, type OcspResponderCandidate, type OcspResponderRevocationPolicy, type OcspResponderSource, type OcspResponseMaterial, type OcspResponseSource, type OcspResponseStatus, type ParseCertificateChainResult, type ParseCertificateErrorCode, type ParseCertificateFailure, type ParseCertificateResult, type ParseCertificateRevocationListErrorCode, type ParseCertificateRevocationListFailure, type ParseCertificateRevocationListResult, type ParseCertificateSigningRequestErrorCode, type ParseCertificateSigningRequestFailure, type ParseCertificateSigningRequestResult, type ParseOcspRequestErrorCode, type ParseOcspRequestFailure, type ParseOcspRequestResult, type ParseOcspResponseErrorCode, type ParseOcspResponseFailure, type ParseOcspResponseResult, type ParseOptions, type ParsePfxErrorCode, type ParsePfxFailure, type ParsePfxOptions, type ParsePfxResult, type ParsePkcs12MacDataErrorCode, type ParsePkcs12MacDataFailure, type ParsePkcs12MacDataResult, type ParsePkcs7CertBagResult, type ParsePkcs7ErrorCode, type ParsePkcs7Failure, type ParsePkcs7SignedDataResult, type ParsedBitFlags, type ParsedCertificate, type ParsedCertificateChoice, type ParsedCertificateRevocationList, type ParsedCertificateSigningRequest, type ParsedDistributionPoint, type ParsedDistributionPointName, type ParsedExtension, type ParsedIssuingDistributionPoint, type ParsedIssuingDistributionPointBase, type ParsedIssuingDistributionPointScope, type ParsedName, type ParsedNameAttribute, type ParsedNameConstraintForm, type ParsedOcspCertId, type ParsedOcspCertStatus, type ParsedOcspRequest, type ParsedOcspResponderId, type ParsedOcspResponse, type ParsedOcspSingleResponse, type ParsedPfx, type ParsedPfxAttribute, type ParsedPfxBag, type ParsedPfxBagAttributes, type ParsedPkcs12MacData, type ParsedPkcs7SignedData, type ParsedPkcs7SignerInfo, type ParsedPkcs7SignerInfoBase, type ParsedRelativeDistinguishedName, type ParsedRevokedCertificate, type ParsedSignerIdentifier, type Pbes2Parameters, type PemBlock, type PemDecodeResult, type PemErrorCode, type PemFailure, type PfxBagAttributesInput, type PfxCertificateBagInput, type PfxCertificateSource, type PfxEncryptionOptions, type PfxMaterial, type PfxPrivateKeyBagInput, type PfxPrivateKeySource, type Pkcs12MacOptions, type Pkcs7CertBagMaterial, type Pkcs7CertificateSource, type Pkcs7SignedDataMaterial, type Pkcs7Signer, type PolicyConstraints, type PolicyInformation, type PolicyMapping, type PolicyMappings, type PolicyQualifierInfo, type PolicyValidationInput, type PolicyValidationOutcome, type PrivateKeyImportInput, type PublicKeyImportInput, REVOCATION_INDETERMINATE_REASONS, REVOCATION_INDETERMINATE_REASON_CODES, type RelativeDistinguishedNameInput, type ResolveOcspResponderCandidatesInput, type Result, type ResultError, type RevocationCertificateSource, type RevocationCheckGoodValue, type RevocationCheckIndeterminateValue, type RevocationCheckRevokedValue, type RevocationCrlEvidenceInput, type RevocationEvidenceInput, type RevocationEvidenceKind, type RevocationExecutionError, type RevocationIndeterminateEvidence, type RevocationIndeterminateReason, type RevocationIndeterminateReasonCode, type RevocationOcspEvidenceInput, type RevocationPolicy, type RevocationReason, type RevocationSource, type RevocationStatus, type RevokedCertificateInput, type RsaHash, type RsaKeyAlgorithmInput, type RsaOaepOptions, type RsaScheme, type RsaSignatureScheme, type SelfSignedCertificateResult, type SelfSignedKeySource, type ServiceIdentityInput, type ServiceIdentityType, type SplitPemBlocksResult, type SrvServiceIdentityInput, type SubjectAltName, type SubjectAltNameTextOptions, type TrustAnchor, type UriServiceIdentityInput, VERIFY_ERROR_CODES, type ValidateCandidatePathInput, type ValidateCandidatePathResult, type ValidateCandidatePathSuccess, type ValidateCertificateRevocationListFailure, type ValidateCertificateRevocationListInput, type ValidateCertificateRevocationListResult, type ValidateForCaInput, type ValidateForCodeSigningInput, type ValidateForTlsClientInput, type ValidateForTlsServerInput, type ValidateOcspResponseErrorCode, type ValidateOcspResponseFailure, type ValidateOcspResponseInput, type ValidateOcspResponseResult, type ValidityInput, type VerifiedCertificateChain, type VerifiedPkcs7Signer, type VerifyCertificateChainInput, type VerifyCertificateRevocationListSignatureFailure, type VerifyCertificateRevocationListSignatureResult, type VerifyChainFailure, type VerifyChainResult, type VerifyErrorCode, type VerifyFailureDetails, type VerifyOcspResponseSignatureFailure, type VerifyOcspResponseSignatureResult, type VerifyPkcs7SignedDataErrorCode, type VerifyPkcs7SignedDataFailure, type VerifyPkcs7SignedDataOptions, type VerifyPkcs7SignedDataResult, type VerifyPurpose, type VerifyRequestFailure, type VerifyRequestResult, buildCandidatePath, categorizePemBlocks, categorizePemBlocksOrThrow, certificateFingerprint, certificateMatchesPrivateKey, checkCertificateRevocation, checkCertificateRevocationAgainstCrl, checkChainRevocation, checkExtendedKeyUsage, compareDistinguishedNames, createCertificate, createCertificateRevocationList, createCertificateSigningRequest, createOcspRequest, createOcspResponse, createPfx, createPkcs7CertBag, createPkcs7SignedData, createSelfSignedCertificate, decodeExtension, decodeExtensionMap, decodeExtensions, decryptRsaOaep, decryptRsaOaepOrThrow, defineExtensionDecoder, defineExtensionDecoderMap, derivePublicKey, distinguishedNameToString, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, findExtension, generateKeyPair, getCertificateOcspResponderUris, getSubjectPublicKey, getSubjectPublicKeyOrThrow, hasOcspNoCheckExtension, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, inspectEncryptedPkcs8Der, isCertificateRevoked, isResultError, isSelfIssued as isSelfIssuedCertificate, matchCertificatePrivateKey, matchCertificateServiceIdentity, matchServiceIdentity, parseCertificateChainPem, parseCertificateChainPemOrThrow, parseCertificateDer, parseCertificateDerOrThrow, parseCertificateFromSource, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseCertificatesFromSource, parseDistinguishedNameDer, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, parsePfxDer, parsePfxPem, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, pemDecode, pemDecodeOrThrow, pemEncode, relativeDistinguishedNameToString, resolveOcspResponderCandidates, revocationReasonFromCode, splitPemBlocks, splitPemBlocksOrThrow, subjectAltNameLabel, subjectAltNameToString, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
package/dist/index.js CHANGED
@@ -1,17 +1,19 @@
1
1
  import { isResultError as e, unwrap as t, unwrapOr as n } from "./result/result.js";
2
2
  import { categorizePemBlocks as r, categorizePemBlocksOrThrow as i, pemDecode as a, pemDecodeOrThrow as o, pemEncode as s, splitPemBlocks as c, splitPemBlocksOrThrow as l } from "./pem/pem.js";
3
- import { decryptRsaOaep as u, decryptRsaOaepOrThrow as d, derivePublicKey as f, encryptRsaOaep as p, encryptRsaOaepOrThrow as m, exportBinaryBase64 as h, exportEncryptedPkcs1Pem as g, exportEncryptedPkcs8Der as _, exportEncryptedPkcs8Pem as v, exportEncryptedSec1Pem as y, exportPkcs1Der as b, exportPkcs1Pem as x, exportPkcs8Der as S, exportPkcs8Pem as C, exportPrivateJwk as w, exportPublicJwk as T, exportSec1Der as E, exportSec1Pem as D, exportSpkiDer as O, exportSpkiPem as k, generateKeyPair as A, importEncryptedPkcs1Pem as j, importEncryptedPkcs1PemOrThrow as M, importEncryptedPkcs8Der as N, importEncryptedPkcs8DerOrThrow as P, importEncryptedPkcs8Pem as F, importEncryptedPkcs8PemOrThrow as I, importEncryptedSec1Pem as L, importEncryptedSec1PemOrThrow as R, importPkcs1Der as z, importPkcs1DerOrThrow as B, importPkcs1Pem as V, importPkcs1PemOrThrow as H, importPkcs8Base64 as U, importPkcs8Base64OrThrow as W, importPkcs8Der as G, importPkcs8DerOrThrow as K, importPkcs8Pem as q, importPkcs8PemOrThrow as J, importPrivateJwk as Y, importPrivateJwkOrThrow as X, importPublicJwk as Z, importPublicJwkOrThrow as Q, importSec1Der as $, importSec1DerOrThrow as ee, importSec1Pem as te, importSec1PemOrThrow as ne, importSpkiBase64 as re, importSpkiBase64OrThrow as ie, importSpkiDer as ae, importSpkiDerOrThrow as oe, importSpkiPem as se, importSpkiPemOrThrow as ce } from "./keys/keys.js";
4
- import { certificateMatchesPrivateKey as le, decodeExtension as ue, decodeExtensionMap as de, decodeExtensions as fe, defineExtensionDecoder as pe, defineExtensionDecoderMap as me, findExtension as he, getSubjectPublicKey as ge, getSubjectPublicKeyOrThrow as _e, matchCertificatePrivateKey as ve, parseCertificateChainPem as ye, parseCertificateDer as be, parseCertificateDerOrThrow as xe, parseCertificatePem as Se, parseCertificatePemOrThrow as Ce, parseCertificateSigningRequestDer as we, parseCertificateSigningRequestDerOrThrow as Te, parseCertificateSigningRequestPem as Ee, parseCertificateSigningRequestPemOrThrow as De } from "./x509/parse.js";
5
- import { createPfx as Oe, parsePfxDer as ke, parsePfxPem as Ae } from "./pkcs/pfx.js";
6
- import { createPkcs7CertBag as je, createPkcs7SignedData as Me, parsePkcs7CertBagDer as Ne, parsePkcs7CertBagPem as Pe, parsePkcs7SignedDataDer as Fe, parsePkcs7SignedDataPem as Ie, verifyPkcs7SignedData as Le } from "./pkcs/pkcs7.js";
7
- import { checkCertificateRevocationAgainstCrl as Re, createCertificateRevocationList as ze, isCertificateRevoked as Be, parseCertificateRevocationListDer as Ve, parseCertificateRevocationListDerOrThrow as He, parseCertificateRevocationListPem as Ue, parseCertificateRevocationListPemOrThrow as We, validateCertificateRevocationList as Ge, verifyCertificateRevocationListSignature as Ke } from "./revocation/crl.js";
8
- import { matchCertificateServiceIdentity as qe, matchServiceIdentity as Je } from "./verify/identity.js";
9
- import { VERIFY_ERROR_CODES as Ye, buildCandidatePath as Xe, checkExtendedKeyUsage as Ze, trustAnchorFromCertificate as Qe, validateCandidatePath as $e, validateForCa as et, validateForCodeSigning as tt, validateForTlsClient as nt, validateForTlsServer as rt, verifyCertificateChain as it, verifyCertificateSigningRequest as at } from "./verify/verify.js";
10
- import { createOcspRequest as ot, createOcspResponse as st, hasOcspNoCheckExtension as ct, parseOcspRequestDer as lt, parseOcspRequestDerOrThrow as ut, parseOcspRequestPem as dt, parseOcspRequestPemOrThrow as ft, parseOcspResponseDer as pt, parseOcspResponseDerOrThrow as mt, parseOcspResponsePem as ht, parseOcspResponsePemOrThrow as gt, validateOcspResponse as _t, verifyOcspResponseSignature as vt } from "./revocation/ocsp.js";
11
- import { REVOCATION_INDETERMINATE_REASONS as yt, checkChainRevocation as bt } from "./revocation/chain.js";
12
- import { REVOCATION_INDETERMINATE_REASON_CODES as xt, checkCertificateRevocation as St, getCertificateOcspResponderUris as Ct, resolveOcspResponderCandidates as wt } from "./revocation/revocation.js";
13
- import { createCertificate as Tt, createSelfSignedCertificate as Et } from "./x509/certificate.js";
14
- import { createCertificateSigningRequest as Dt } from "./x509/csr.js";
15
- import { certificateFingerprint as Ot } from "./x509/fingerprint.js";
16
- import { distinguishedNameToString as kt, relativeDistinguishedNameToString as At, subjectAltNameLabel as jt, subjectAltNameToString as Mt } from "./x509/name-text.js";
17
- export { yt as REVOCATION_INDETERMINATE_REASONS, xt as REVOCATION_INDETERMINATE_REASON_CODES, Ye as VERIFY_ERROR_CODES, Xe as buildCandidatePath, r as categorizePemBlocks, i as categorizePemBlocksOrThrow, Ot as certificateFingerprint, le as certificateMatchesPrivateKey, St as checkCertificateRevocation, Re as checkCertificateRevocationAgainstCrl, bt as checkChainRevocation, Ze as checkExtendedKeyUsage, Tt as createCertificate, ze as createCertificateRevocationList, Dt as createCertificateSigningRequest, ot as createOcspRequest, st as createOcspResponse, Oe as createPfx, je as createPkcs7CertBag, Me as createPkcs7SignedData, Et as createSelfSignedCertificate, ue as decodeExtension, de as decodeExtensionMap, fe as decodeExtensions, u as decryptRsaOaep, d as decryptRsaOaepOrThrow, pe as defineExtensionDecoder, me as defineExtensionDecoderMap, f as derivePublicKey, kt as distinguishedNameToString, p as encryptRsaOaep, m as encryptRsaOaepOrThrow, h as exportBinaryBase64, g as exportEncryptedPkcs1Pem, _ as exportEncryptedPkcs8Der, v as exportEncryptedPkcs8Pem, y as exportEncryptedSec1Pem, b as exportPkcs1Der, x as exportPkcs1Pem, S as exportPkcs8Der, C as exportPkcs8Pem, w as exportPrivateJwk, T as exportPublicJwk, E as exportSec1Der, D as exportSec1Pem, O as exportSpkiDer, k as exportSpkiPem, he as findExtension, A as generateKeyPair, Ct as getCertificateOcspResponderUris, ge as getSubjectPublicKey, _e as getSubjectPublicKeyOrThrow, ct as hasOcspNoCheckExtension, j as importEncryptedPkcs1Pem, M as importEncryptedPkcs1PemOrThrow, N as importEncryptedPkcs8Der, P as importEncryptedPkcs8DerOrThrow, F as importEncryptedPkcs8Pem, I as importEncryptedPkcs8PemOrThrow, L as importEncryptedSec1Pem, R as importEncryptedSec1PemOrThrow, z as importPkcs1Der, B as importPkcs1DerOrThrow, V as importPkcs1Pem, H as importPkcs1PemOrThrow, U as importPkcs8Base64, W as importPkcs8Base64OrThrow, G as importPkcs8Der, K as importPkcs8DerOrThrow, q as importPkcs8Pem, J as importPkcs8PemOrThrow, Y as importPrivateJwk, X as importPrivateJwkOrThrow, Z as importPublicJwk, Q as importPublicJwkOrThrow, $ as importSec1Der, ee as importSec1DerOrThrow, te as importSec1Pem, ne as importSec1PemOrThrow, re as importSpkiBase64, ie as importSpkiBase64OrThrow, ae as importSpkiDer, oe as importSpkiDerOrThrow, se as importSpkiPem, ce as importSpkiPemOrThrow, Be as isCertificateRevoked, e as isResultError, ve as matchCertificatePrivateKey, qe as matchCertificateServiceIdentity, Je as matchServiceIdentity, ye as parseCertificateChainPem, be as parseCertificateDer, xe as parseCertificateDerOrThrow, Se as parseCertificatePem, Ce as parseCertificatePemOrThrow, Ve as parseCertificateRevocationListDer, He as parseCertificateRevocationListDerOrThrow, Ue as parseCertificateRevocationListPem, We as parseCertificateRevocationListPemOrThrow, we as parseCertificateSigningRequestDer, Te as parseCertificateSigningRequestDerOrThrow, Ee as parseCertificateSigningRequestPem, De as parseCertificateSigningRequestPemOrThrow, lt as parseOcspRequestDer, ut as parseOcspRequestDerOrThrow, dt as parseOcspRequestPem, ft as parseOcspRequestPemOrThrow, pt as parseOcspResponseDer, mt as parseOcspResponseDerOrThrow, ht as parseOcspResponsePem, gt as parseOcspResponsePemOrThrow, ke as parsePfxDer, Ae as parsePfxPem, Ne as parsePkcs7CertBagDer, Pe as parsePkcs7CertBagPem, Fe as parsePkcs7SignedDataDer, Ie as parsePkcs7SignedDataPem, a as pemDecode, o as pemDecodeOrThrow, s as pemEncode, At as relativeDistinguishedNameToString, wt as resolveOcspResponderCandidates, c as splitPemBlocks, l as splitPemBlocksOrThrow, jt as subjectAltNameLabel, Mt as subjectAltNameToString, Qe as trustAnchorFromCertificate, t as unwrap, n as unwrapOr, $e as validateCandidatePath, Ge as validateCertificateRevocationList, et as validateForCa, tt as validateForCodeSigning, nt as validateForTlsClient, rt as validateForTlsServer, _t as validateOcspResponse, it as verifyCertificateChain, Ke as verifyCertificateRevocationListSignature, at as verifyCertificateSigningRequest, vt as verifyOcspResponseSignature, Le as verifyPkcs7SignedData };
3
+ import { decryptRsaOaep as u, decryptRsaOaepOrThrow as d, derivePublicKey as f, encryptRsaOaep as p, encryptRsaOaepOrThrow as m, exportBinaryBase64 as h, exportEncryptedPkcs1Pem as g, exportEncryptedPkcs8Der as _, exportEncryptedPkcs8Pem as v, exportEncryptedSec1Pem as y, exportPkcs1Der as b, exportPkcs1Pem as x, exportPkcs8Der as S, exportPkcs8Pem as C, exportPrivateJwk as w, exportPublicJwk as T, exportSec1Der as E, exportSec1Pem as D, exportSpkiDer as O, exportSpkiPem as k, generateKeyPair as A, importEncryptedPkcs1Pem as j, importEncryptedPkcs1PemOrThrow as M, importEncryptedPkcs8Der as N, importEncryptedPkcs8DerOrThrow as P, importEncryptedPkcs8Pem as F, importEncryptedPkcs8PemOrThrow as I, importEncryptedSec1Pem as L, importEncryptedSec1PemOrThrow as R, importPkcs1Der as z, importPkcs1DerOrThrow as B, importPkcs1Pem as V, importPkcs1PemOrThrow as H, importPkcs8Base64 as U, importPkcs8Base64OrThrow as W, importPkcs8Der as G, importPkcs8DerOrThrow as K, importPkcs8Pem as q, importPkcs8PemOrThrow as J, importPrivateJwk as Y, importPrivateJwkOrThrow as X, importPublicJwk as Z, importPublicJwkOrThrow as Q, importSec1Der as $, importSec1DerOrThrow as ee, importSec1Pem as te, importSec1PemOrThrow as ne, importSpkiBase64 as re, importSpkiBase64OrThrow as ie, importSpkiDer as ae, importSpkiDerOrThrow as oe, importSpkiPem as se, importSpkiPemOrThrow as ce, inspectEncryptedPkcs8Der as le } from "./keys/keys.js";
4
+ import { compareDistinguishedNames as ue } from "./internal/shared/dn.js";
5
+ import { certificateMatchesPrivateKey as de, decodeExtension as fe, decodeExtensionMap as pe, decodeExtensions as me, defineExtensionDecoder as he, defineExtensionDecoderMap as ge, findExtension as _e, getSubjectPublicKey as ve, getSubjectPublicKeyOrThrow as ye, matchCertificatePrivateKey as be, parseCertificateChainPem as xe, parseCertificateChainPemOrThrow as Se, parseCertificateDer as Ce, parseCertificateDerOrThrow as we, parseCertificateFromSource as Te, parseCertificatePem as Ee, parseCertificatePemOrThrow as De, parseCertificateSigningRequestDer as Oe, parseCertificateSigningRequestDerOrThrow as ke, parseCertificateSigningRequestPem as Ae, parseCertificateSigningRequestPemOrThrow as je, parseCertificatesFromSource as Me, parseDistinguishedNameDer as Ne } from "./x509/parse.js";
6
+ import { createPfx as Pe, parsePfxDer as Fe, parsePfxPem as Ie } from "./pkcs/pfx.js";
7
+ import { createPkcs7CertBag as Le, createPkcs7SignedData as Re, parsePkcs7CertBagDer as ze, parsePkcs7CertBagPem as Be, parsePkcs7SignedDataDer as Ve, parsePkcs7SignedDataPem as He, verifyPkcs7SignedData as Ue } from "./pkcs/pkcs7.js";
8
+ import { checkCertificateRevocationAgainstCrl as We, createCertificateRevocationList as Ge, isCertificateRevoked as Ke, parseCertificateRevocationListDer as qe, parseCertificateRevocationListDerOrThrow as Je, parseCertificateRevocationListPem as Ye, parseCertificateRevocationListPemOrThrow as Xe, revocationReasonFromCode as Ze, validateCertificateRevocationList as Qe, verifyCertificateRevocationListSignature as $e } from "./revocation/crl.js";
9
+ import { isSelfIssued as et } from "./internal/verify/verify-path.js";
10
+ import { matchCertificateServiceIdentity as tt, matchServiceIdentity as nt } from "./verify/identity.js";
11
+ import { VERIFY_ERROR_CODES as rt, buildCandidatePath as it, checkExtendedKeyUsage as at, trustAnchorFromCertificate as ot, validateCandidatePath as st, validateForCa as ct, validateForCodeSigning as lt, validateForTlsClient as ut, validateForTlsServer as dt, verifyCertificateChain as ft, verifyCertificateSigningRequest as pt } from "./verify/verify.js";
12
+ import { createOcspRequest as mt, createOcspResponse as ht, hasOcspNoCheckExtension as gt, parseOcspRequestDer as _t, parseOcspRequestDerOrThrow as vt, parseOcspRequestPem as yt, parseOcspRequestPemOrThrow as bt, parseOcspResponseDer as xt, parseOcspResponseDerOrThrow as St, parseOcspResponsePem as Ct, parseOcspResponsePemOrThrow as wt, validateOcspResponse as Tt, verifyOcspResponseSignature as Et } from "./revocation/ocsp.js";
13
+ import { REVOCATION_INDETERMINATE_REASONS as Dt, checkChainRevocation as Ot } from "./revocation/chain.js";
14
+ import { REVOCATION_INDETERMINATE_REASON_CODES as kt, checkCertificateRevocation as At, getCertificateOcspResponderUris as jt, resolveOcspResponderCandidates as Mt } from "./revocation/revocation.js";
15
+ import { createCertificate as Nt, createSelfSignedCertificate as Pt } from "./x509/certificate.js";
16
+ import { createCertificateSigningRequest as Ft } from "./x509/csr.js";
17
+ import { certificateFingerprint as It } from "./x509/fingerprint.js";
18
+ import { distinguishedNameToString as Lt, relativeDistinguishedNameToString as Rt, subjectAltNameLabel as zt, subjectAltNameToString as Bt } from "./x509/name-text.js";
19
+ export { Dt as REVOCATION_INDETERMINATE_REASONS, kt as REVOCATION_INDETERMINATE_REASON_CODES, rt as VERIFY_ERROR_CODES, it as buildCandidatePath, r as categorizePemBlocks, i as categorizePemBlocksOrThrow, It as certificateFingerprint, de as certificateMatchesPrivateKey, At as checkCertificateRevocation, We as checkCertificateRevocationAgainstCrl, Ot as checkChainRevocation, at as checkExtendedKeyUsage, ue as compareDistinguishedNames, Nt as createCertificate, Ge as createCertificateRevocationList, Ft as createCertificateSigningRequest, mt as createOcspRequest, ht as createOcspResponse, Pe as createPfx, Le as createPkcs7CertBag, Re as createPkcs7SignedData, Pt as createSelfSignedCertificate, fe as decodeExtension, pe as decodeExtensionMap, me as decodeExtensions, u as decryptRsaOaep, d as decryptRsaOaepOrThrow, he as defineExtensionDecoder, ge as defineExtensionDecoderMap, f as derivePublicKey, Lt as distinguishedNameToString, p as encryptRsaOaep, m as encryptRsaOaepOrThrow, h as exportBinaryBase64, g as exportEncryptedPkcs1Pem, _ as exportEncryptedPkcs8Der, v as exportEncryptedPkcs8Pem, y as exportEncryptedSec1Pem, b as exportPkcs1Der, x as exportPkcs1Pem, S as exportPkcs8Der, C as exportPkcs8Pem, w as exportPrivateJwk, T as exportPublicJwk, E as exportSec1Der, D as exportSec1Pem, O as exportSpkiDer, k as exportSpkiPem, _e as findExtension, A as generateKeyPair, jt as getCertificateOcspResponderUris, ve as getSubjectPublicKey, ye as getSubjectPublicKeyOrThrow, gt as hasOcspNoCheckExtension, j as importEncryptedPkcs1Pem, M as importEncryptedPkcs1PemOrThrow, N as importEncryptedPkcs8Der, P as importEncryptedPkcs8DerOrThrow, F as importEncryptedPkcs8Pem, I as importEncryptedPkcs8PemOrThrow, L as importEncryptedSec1Pem, R as importEncryptedSec1PemOrThrow, z as importPkcs1Der, B as importPkcs1DerOrThrow, V as importPkcs1Pem, H as importPkcs1PemOrThrow, U as importPkcs8Base64, W as importPkcs8Base64OrThrow, G as importPkcs8Der, K as importPkcs8DerOrThrow, q as importPkcs8Pem, J as importPkcs8PemOrThrow, Y as importPrivateJwk, X as importPrivateJwkOrThrow, Z as importPublicJwk, Q as importPublicJwkOrThrow, $ as importSec1Der, ee as importSec1DerOrThrow, te as importSec1Pem, ne as importSec1PemOrThrow, re as importSpkiBase64, ie as importSpkiBase64OrThrow, ae as importSpkiDer, oe as importSpkiDerOrThrow, se as importSpkiPem, ce as importSpkiPemOrThrow, le as inspectEncryptedPkcs8Der, Ke as isCertificateRevoked, e as isResultError, et as isSelfIssuedCertificate, be as matchCertificatePrivateKey, tt as matchCertificateServiceIdentity, nt as matchServiceIdentity, xe as parseCertificateChainPem, Se as parseCertificateChainPemOrThrow, Ce as parseCertificateDer, we as parseCertificateDerOrThrow, Te as parseCertificateFromSource, Ee as parseCertificatePem, De as parseCertificatePemOrThrow, qe as parseCertificateRevocationListDer, Je as parseCertificateRevocationListDerOrThrow, Ye as parseCertificateRevocationListPem, Xe as parseCertificateRevocationListPemOrThrow, Oe as parseCertificateSigningRequestDer, ke as parseCertificateSigningRequestDerOrThrow, Ae as parseCertificateSigningRequestPem, je as parseCertificateSigningRequestPemOrThrow, Me as parseCertificatesFromSource, Ne as parseDistinguishedNameDer, _t as parseOcspRequestDer, vt as parseOcspRequestDerOrThrow, yt as parseOcspRequestPem, bt as parseOcspRequestPemOrThrow, xt as parseOcspResponseDer, St as parseOcspResponseDerOrThrow, Ct as parseOcspResponsePem, wt as parseOcspResponsePemOrThrow, Fe as parsePfxDer, Ie as parsePfxPem, ze as parsePkcs7CertBagDer, Be as parsePkcs7CertBagPem, Ve as parsePkcs7SignedDataDer, He as parsePkcs7SignedDataPem, a as pemDecode, o as pemDecodeOrThrow, s as pemEncode, Rt as relativeDistinguishedNameToString, Mt as resolveOcspResponderCandidates, Ze as revocationReasonFromCode, c as splitPemBlocks, l as splitPemBlocksOrThrow, zt as subjectAltNameLabel, Bt as subjectAltNameToString, ot as trustAnchorFromCertificate, t as unwrap, n as unwrapOr, st as validateCandidatePath, Qe as validateCertificateRevocationList, ct as validateForCa, lt as validateForCodeSigning, ut as validateForTlsClient, dt as validateForTlsServer, Tt as validateOcspResponse, ft as verifyCertificateChain, $e as verifyCertificateRevocationListSignature, pt as verifyCertificateSigningRequest, Et as verifyOcspResponseSignature, Ue as verifyPkcs7SignedData };