micro509 0.17.1 → 0.18.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.
- package/CHANGELOG.md +78 -6
- package/dist/crypto/crypto.d.ts +2 -3
- package/dist/crypto.d.ts +6 -0
- package/dist/der/der.d.ts +14 -4
- package/dist/der/der.js +19 -19
- package/dist/der.d.ts +26 -2
- package/dist/der.js +4 -4
- package/dist/index.d.ts +82 -15
- package/dist/index.js +19 -19
- package/dist/internal/asn1/asn1.d.ts +1 -2
- package/dist/internal/asn1/der.d.ts +1 -2
- package/dist/internal/asn1/oids.js +71 -353
- package/dist/internal/asn1/oids.js.map +1 -1
- package/dist/internal/asn1/oids.json.js +357 -0
- package/dist/internal/asn1/oids.json.js.map +1 -0
- package/dist/internal/crypto/algorithm-names.js +1 -1
- package/dist/internal/crypto/pbes2.d.ts +1 -2
- package/dist/internal/crypto/pbes2.js +70 -70
- package/dist/internal/crypto/prime-ec.js +37 -0
- package/dist/internal/crypto/prime-ec.js.map +1 -0
- package/dist/internal/crypto/rsa-pss.js +50 -50
- package/dist/internal/crypto/sig-verify.d.ts +1 -2
- package/dist/internal/crypto/sig-verify.js +60 -60
- package/dist/internal/crypto/signing.d.ts +1 -2
- package/dist/internal/crypto/signing.js +26 -26
- package/dist/internal/jose/json-data.js +108 -0
- package/dist/internal/jose/json-data.js.map +1 -0
- package/dist/internal/jose/strict-json.d.ts +1 -2
- package/dist/internal/shared/dn.d.ts +1 -2
- package/dist/internal/shared/dn.js +1 -1
- package/dist/internal/shared/ip.d.ts +1 -2
- package/dist/internal/verify/name-constraints-engine.js +64 -64
- package/dist/internal/verify/policy-engine.js +1 -1
- package/dist/internal/verify/verify-path.d.ts +1 -2
- package/dist/internal/verify/verify-path.js +19 -19
- package/dist/internal/x509/directory-name.js +10 -10
- package/dist/internal/x509/extension-errors.d.ts +1 -2
- package/dist/internal/x509/extension-registry.js +18 -18
- package/dist/internal/x509/general-name-profile.js +9 -9
- package/dist/internal/x509/general-name.js +32 -32
- package/dist/internal/x509/name-fields.js +1 -1
- package/dist/jose/base64url.d.ts +4 -0
- package/dist/jose/base64url.js +14 -0
- package/dist/jose/base64url.js.map +1 -0
- package/dist/jose/errors.d.ts +9 -3
- package/dist/jose/errors.js.map +1 -1
- package/dist/jose/jwe.d.ts +64 -0
- package/dist/jose/jwe.js +188 -0
- package/dist/jose/jwe.js.map +1 -0
- package/dist/jose/jwks.d.ts +38 -10
- package/dist/jose/jwks.js +156 -96
- package/dist/jose/jwks.js.map +1 -1
- package/dist/jose/jws.d.ts +8 -6
- package/dist/jose/jws.js +216 -170
- package/dist/jose/jws.js.map +1 -1
- package/dist/jose/jwt.d.ts +8 -2
- package/dist/jose/jwt.js +98 -98
- package/dist/jose/remote-jwks.d.ts +1 -2
- package/dist/jose/remote-jwks.js +106 -108
- package/dist/jose/remote-jwks.js.map +1 -1
- package/dist/jose.d.ts +15 -4
- package/dist/jose.js +7 -5
- package/dist/kdf/argon2.d.ts +7 -2
- package/dist/kdf.d.ts +6 -0
- package/dist/keys/keys.d.ts +31 -6
- package/dist/keys/keys.js +315 -233
- package/dist/keys/keys.js.map +1 -1
- package/dist/keys.d.ts +11 -2
- package/dist/keys.js +2 -2
- package/dist/pem/pem.d.ts +1 -2
- package/dist/pem/pem.js +40 -25
- package/dist/pem/pem.js.map +1 -1
- package/dist/pem.d.ts +6 -0
- package/dist/pkcs/pfx.d.ts +2 -3
- package/dist/pkcs/pfx.js +142 -142
- package/dist/pkcs/pkcs12-mac.d.ts +1 -2
- package/dist/pkcs/pkcs12-mac.js +122 -122
- package/dist/pkcs/pkcs7.d.ts +14 -3
- package/dist/pkcs/pkcs7.js +268 -248
- package/dist/pkcs/pkcs7.js.map +1 -1
- package/dist/pkcs.d.ts +10 -1
- package/dist/pkcs.js +4 -4
- package/dist/result/result.d.ts +1 -2
- package/dist/result.d.ts +6 -0
- package/dist/revocation/chain.d.ts +2 -3
- package/dist/revocation/chain.js +52 -52
- package/dist/revocation/crl.d.ts +2 -3
- package/dist/revocation/crl.js +319 -319
- package/dist/revocation/crl.js.map +1 -1
- package/dist/revocation/ocsp.d.ts +2 -3
- package/dist/revocation/ocsp.js +395 -395
- package/dist/revocation/revocation.d.ts +2 -3
- package/dist/revocation/revocation.js +22 -22
- package/dist/revocation.d.ts +12 -3
- package/dist/revocation.js +4 -4
- package/dist/ssh/ssh.d.ts +2 -3
- package/dist/ssh/ssh.js +165 -170
- package/dist/ssh/ssh.js.map +1 -1
- package/dist/ssh/wire.d.ts +1 -2
- package/dist/ssh/wire.js +10 -10
- package/dist/ssh.d.ts +8 -0
- package/dist/verify/identity.d.ts +1 -2
- package/dist/verify/identity.js +31 -31
- package/dist/verify/name-constraints.d.ts +9 -2
- package/dist/verify/policy.d.ts +9 -2
- package/dist/verify/verify.d.ts +3 -4
- package/dist/verify/verify.js +121 -121
- package/dist/verify.d.ts +9 -0
- package/dist/x509/certificate.d.ts +4 -5
- package/dist/x509/certificate.js +40 -40
- package/dist/x509/csr.d.ts +3 -4
- package/dist/x509/csr.js +15 -15
- package/dist/x509/extensions.d.ts +1 -2
- package/dist/x509/extensions.js +165 -165
- package/dist/x509/extensions.js.map +1 -1
- package/dist/x509/fingerprint.d.ts +1 -2
- package/dist/x509/name-text.d.ts +1 -2
- package/dist/x509/name.d.ts +1 -2
- package/dist/x509/name.js +15 -15
- package/dist/x509/parse.d.ts +3 -4
- package/dist/x509/parse.js +423 -423
- package/dist/x509.d.ts +17 -4
- package/dist/x509.js +8 -8
- package/package.json +22 -23
- package/dist/internal/asn1/oids2.js +0 -75
- package/dist/internal/asn1/oids2.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<!--
|
|
4
4
|
Release checklist — every box, every release:
|
|
5
|
-
- [ ]
|
|
6
|
-
- [ ]
|
|
5
|
+
- [ ] Start the release with `beepboop release <bump>` or the Start release workflow; Beepboop opens the version PR that bumps package.json AND jsr.json
|
|
6
|
+
- [ ] On the version PR, move [Unreleased] entries under a new `## [X.Y.Z] - YYYY-MM-DD` header + intro line
|
|
7
7
|
- [ ] Bump the version in examples/browser/index.html's import map. examples/vite/package.json uses `latest`
|
|
8
8
|
- [ ] Run `bun install` after the example bump so bun.lock matches; CI installs with a frozen lockfile
|
|
9
9
|
- [ ] Link definitions at the BOTTOM of this file: add [X.Y.Z] compare link, repoint [Unreleased]
|
|
10
|
-
- [ ]
|
|
11
|
-
- [ ] Push the tag to trigger the Publish workflow
|
|
10
|
+
- [ ] Merge the version PR; Beepboop pushes the signed vX.Y.Z tag, which starts the Publish workflow
|
|
12
11
|
- [ ] Verify npm, JSR, the GitHub release and the documentation deployment
|
|
13
12
|
-->
|
|
14
13
|
|
|
@@ -19,6 +18,77 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
18
|
|
|
20
19
|
## [Unreleased]
|
|
21
20
|
|
|
21
|
+
## [0.18.0] - 2026-11-14
|
|
22
|
+
|
|
23
|
+
Sign and verify JWTs with RS384, RS512, ES256 and ES384, encrypt with compact
|
|
24
|
+
JWE, and migrate from jose with runnable guides and an independent test corpus.
|
|
25
|
+
One function imports any unencrypted private-key PEM, and JWK Sets that arrive
|
|
26
|
+
as parsed objects get the same validation as JSON text.
|
|
27
|
+
|
|
28
|
+
CMS verification now defaults to the application profile: `id-data` content
|
|
29
|
+
with signed attributes from every signer. Callers that accept bare `id-data`
|
|
30
|
+
signatures opt in.
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **Sign and verify RS384, RS512, ES256 and ES384.** `micro509/jose` signs and
|
|
35
|
+
verifies compact JWS and JWT with these algorithms next to RS256, through
|
|
36
|
+
direct keys, local JWK Sets and remote resolvers. Callers accept only the
|
|
37
|
+
algorithms they list. RSA keys are checked for hash, modulus, exponent and
|
|
38
|
+
key usage. ECDSA keys are bound to their exact curve and hash, and signatures
|
|
39
|
+
use the fixed-width raw encoding. EC JWK entries are checked for coordinate
|
|
40
|
+
encoding, width, field range and curve membership. `importJwkEntry(entry)`
|
|
41
|
+
stays RS256, and other algorithms take an explicit argument.
|
|
42
|
+
[#227](https://github.com/kjanat/micro509/issues/227)
|
|
43
|
+
- **Encrypt with compact JWE.** `encryptCompactJwe` and `decryptCompactJwe`
|
|
44
|
+
support RSA-OAEP-512 with A256GCM under an explicit `alg` and `enc` policy.
|
|
45
|
+
Headers and segments are strict and bounded, and `zip` and critical
|
|
46
|
+
extensions are refused. A failed RSA unwrap, a wrong key, a wrong content-key
|
|
47
|
+
length and a failed GCM tag return one refusal, and a failed unwrap continues
|
|
48
|
+
with a random content key as [RFC 7516 §11.5][rfc7516-section-11.5]
|
|
49
|
+
recommends. Decryption returns the plaintext bytes and the authenticated
|
|
50
|
+
protected header members. [#231](https://github.com/kjanat/micro509/issues/231)
|
|
51
|
+
- **Encode and decode base64url.** `micro509/jose` exports `base64UrlEncode` and
|
|
52
|
+
the strict `base64UrlDecode`, which refuses padding, whitespace, noncanonical
|
|
53
|
+
trailing bits and invalid lengths.
|
|
54
|
+
[#232](https://github.com/kjanat/micro509/issues/232)
|
|
55
|
+
- **Validate parsed JWK Sets.** `validateJwks` checks a JWK Set that is already
|
|
56
|
+
a JavaScript object with the rules of `parseJwks`. It reads data without
|
|
57
|
+
calling getters or `toJSON`, rejects non-JSON values and cycles, bounds depth,
|
|
58
|
+
node count and data size, and keeps a detached copy.
|
|
59
|
+
[#229](https://github.com/kjanat/micro509/issues/229)
|
|
60
|
+
- **Import any private-key PEM.** `importPrivateKeyPem` and
|
|
61
|
+
`importPrivateKeyPemOrThrow` accept exactly one PKCS#8, PKCS#1 or SEC1 block
|
|
62
|
+
and pass it to the matching importer. Bundles and encrypted input return
|
|
63
|
+
typed refusals. [#222](https://github.com/kjanat/micro509/issues/222)
|
|
64
|
+
- Key import failures carry the stage, reason and container in their details,
|
|
65
|
+
and a bounded diagnostic replaces native backend messages.
|
|
66
|
+
[#223](https://github.com/kjanat/micro509/issues/223)
|
|
67
|
+
- **Migrate from jose.** The migration guide maps jose APIs to micro509 with
|
|
68
|
+
runnable examples. Recipes cover key generation and import, verified claims
|
|
69
|
+
flowing into application schemas, and an application-owned JWKS cache. 21
|
|
70
|
+
independently signed JWT cases with fixed-clock expectations are reusable in
|
|
71
|
+
consumer tests. [#220](https://github.com/kjanat/micro509/issues/220),
|
|
72
|
+
[#221](https://github.com/kjanat/micro509/issues/221),
|
|
73
|
+
[#224](https://github.com/kjanat/micro509/issues/224),
|
|
74
|
+
[#225](https://github.com/kjanat/micro509/issues/225),
|
|
75
|
+
[#226](https://github.com/kjanat/micro509/issues/226)
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
- CMS verification defaults to `id-data` content with signed attributes required
|
|
80
|
+
for every signer. Set `expectedContentTypeOid` for another application content
|
|
81
|
+
type. Legacy bare `id-data` signatures require explicit `signedAttributes:
|
|
82
|
+
'allowed'` or `'forbidden'`; non-`id-data` always requires signed attributes
|
|
83
|
+
under RFC 5652 §5.3. New typed content-type and attribute-policy failures are
|
|
84
|
+
distinct from invalid signatures. This changes verification defaults.
|
|
85
|
+
[#216](https://github.com/kjanat/micro509/issues/216)
|
|
86
|
+
- Format with kprint through `bun fmt` (`@kjanat/fmt`). TOML formats through
|
|
87
|
+
the Tombi plugin.
|
|
88
|
+
- Releases start from `beepboop release`, the Start release workflow or the
|
|
89
|
+
Beepboop dashboard. Beepboop opens the version PR and, after the merge,
|
|
90
|
+
pushes the signed version tag that starts the Publish workflow.
|
|
91
|
+
|
|
22
92
|
## [0.17.1] - 2026-10-26
|
|
23
93
|
|
|
24
94
|
Derive Argon2 keys across supported runtimes with the TypeScript implementation,
|
|
@@ -1136,7 +1206,7 @@ stricter typed-contract pass.
|
|
|
1136
1206
|
octets ([RFC 5915 §3][rfc5915-section-3], "version SHALL be ... one"). Only the tag was checked, so
|
|
1137
1207
|
version 0 or 2 was deferred to the WebCrypto backend as a misleading error.
|
|
1138
1208
|
- PBES2 decryption no longer rejects a PBKDF2 salt shorter than eight bytes. [RFC
|
|
1139
|
-
8018 §4.1][rfc8018-section-4.1] makes the eight-octet minimum a "should" for salt
|
|
1209
|
+
8018 §4.1][rfc8018-section-4.1] makes the eight-octet minimum a "should" for salt *selection* and
|
|
1140
1210
|
says the salt need not be checked on receipt, so `openssl pkcs8 -saltlen 4`
|
|
1141
1211
|
could not be decrypted. The encrypt path keeps the minimum.
|
|
1142
1212
|
(https://github.com/kjanat/micro509/pull/85)
|
|
@@ -2072,7 +2142,8 @@ Initial prerelease. API may change before 1.0.
|
|
|
2072
2142
|
- Zero runtime dependencies, WebCrypto-native, tree-shakeable subpath exports;
|
|
2073
2143
|
runs on Node, Bun, Deno, browsers, and Cloudflare Workers.
|
|
2074
2144
|
|
|
2075
|
-
[Unreleased]: https://github.com/kjanat/micro509/compare/v0.
|
|
2145
|
+
[Unreleased]: https://github.com/kjanat/micro509/compare/v0.18.0...HEAD
|
|
2146
|
+
[0.18.0]: https://github.com/kjanat/micro509/compare/v0.17.1...v0.18.0
|
|
2076
2147
|
[0.17.1]: https://github.com/kjanat/micro509/compare/v0.17.0...v0.17.1
|
|
2077
2148
|
[0.17.0]: https://github.com/kjanat/micro509/compare/v0.16.0...v0.17.0
|
|
2078
2149
|
[0.16.0]: https://github.com/kjanat/micro509/compare/v0.15.0...v0.16.0
|
|
@@ -2208,6 +2279,7 @@ Initial prerelease. API may change before 1.0.
|
|
|
2208
2279
|
[rfc7468-section-8]: https://www.rfc-editor.org/rfc/rfc7468.html#section-8
|
|
2209
2280
|
[rfc7468-section-9]: https://www.rfc-editor.org/rfc/rfc7468.html#section-9
|
|
2210
2281
|
[rfc7468-section-14]: https://www.rfc-editor.org/rfc/rfc7468.html#section-14
|
|
2282
|
+
[rfc7516-section-11.5]: https://www.rfc-editor.org/rfc/rfc7516.html#section-11.5
|
|
2211
2283
|
[rfc8018-appendix-A.2]: https://www.rfc-editor.org/rfc/rfc8018.html#appendix-A.2
|
|
2212
2284
|
[rfc8018-section-4.1]: https://www.rfc-editor.org/rfc/rfc8018.html#section-4.1
|
|
2213
2285
|
[rfc8410-section-5]: https://www.rfc-editor.org/rfc/rfc8410.html#section-5
|
package/dist/crypto/crypto.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EcNamedCurve } from "../keys/keys.js";
|
|
2
1
|
import { VerifySignatureConfigFailure, VerifySignedDataFailure, VerifySignedDataResult, VerifySignedDataSuccess } from "../internal/crypto/sig-verify.js";
|
|
3
2
|
import { SignatureProfileInput } from "../internal/crypto/signing.js";
|
|
3
|
+
import { EcNamedCurve } from "../keys/keys.js";
|
|
4
4
|
/** Failure: the signature algorithm parameters exceed a micro509 decoding limit. */
|
|
5
5
|
export interface VerifySignatureLimitFailure {
|
|
6
6
|
/** Discriminant for the failure branch. */
|
|
@@ -100,5 +100,4 @@ export declare function ecdsaSignatureDerToRaw(signature: Uint8Array, curve: EcN
|
|
|
100
100
|
* Throws when the input length does not match the curve.
|
|
101
101
|
*/
|
|
102
102
|
export declare function ecdsaSignatureRawToDer(signature: Uint8Array, curve: EcNamedCurve): Uint8Array;
|
|
103
|
-
export type { SignatureProfileInput, VerifySignatureConfigFailure, VerifySignedDataFailure, VerifySignedDataResult, VerifySignedDataSuccess };
|
|
104
|
-
//# sourceMappingURL=crypto.d.ts.map
|
|
103
|
+
export type { SignatureProfileInput, VerifySignatureConfigFailure, VerifySignedDataFailure, VerifySignedDataResult, VerifySignedDataSuccess };
|
package/dist/crypto.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical detached-signature crypto surface.
|
|
3
|
+
* Owns raw sign/verify primitives and ECDSA signature encoding conversion.
|
|
4
|
+
*
|
|
5
|
+
* @module micro509/crypto
|
|
6
|
+
*/
|
|
1
7
|
import { VerifySignatureConfigFailure, VerifySignedDataFailure, VerifySignedDataResult, VerifySignedDataSuccess } from "./internal/crypto/sig-verify.js";
|
|
2
8
|
import { SignatureProfileInput } from "./internal/crypto/signing.js";
|
|
3
9
|
import { SignDataResult, VerifySignatureInput, VerifySignatureLimitFailure, VerifySignatureResult, VerifySignatureWithKeyInput, ecdsaSignatureDerToRaw, ecdsaSignatureRawToDer, signData, verifySignature, verifySignatureWithKey } from "./crypto/crypto.js";
|
package/dist/der/der.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Element-oriented DER readers and decoders.
|
|
3
|
+
*
|
|
4
|
+
* Each decoder validates the element's tag before reading its value, so a
|
|
5
|
+
* mis-tagged element fails instead of yielding a wrong value.
|
|
6
|
+
*
|
|
7
|
+
* The `OrThrow` variants throw on malformed input.
|
|
8
|
+
* The plain variants return a {@linkcode DecodeDerResult}.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
3
12
|
import { DerBitString } from "../internal/asn1/asn1.js";
|
|
13
|
+
import { DerElement, ReadRootElementOptions, ReadSequenceChildrenOptions } from "../internal/asn1/der.js";
|
|
14
|
+
import { DecodeFailureCode, ErrorResult, Micro509Error } from "../result/result.js";
|
|
4
15
|
/**
|
|
5
16
|
* Machine-readable failure reason for the DER readers and decoders.
|
|
6
17
|
*
|
|
@@ -131,5 +142,4 @@ export declare function decodeDerString(element: DerElement): DecodeDerResult<st
|
|
|
131
142
|
*/
|
|
132
143
|
export declare function decodeDerTimeOrThrow(element: DerElement): Date;
|
|
133
144
|
/** Decodes a UTCTime (tag `0x17`) or GeneralizedTime (tag `0x18`) element into a {@linkcode Date}. */
|
|
134
|
-
export declare function decodeDerTime(element: DerElement): DecodeDerResult<Date>;
|
|
135
|
-
//# sourceMappingURL=der.d.ts.map
|
|
145
|
+
export declare function decodeDerTime(element: DerElement): DecodeDerResult<Date>;
|
package/dist/der/der.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { decodeFailureResult as
|
|
3
|
-
import { readElement as
|
|
4
|
-
import {
|
|
1
|
+
import { childrenOf as e, decodeBitString as t, decodeBoolean as n, decodeIntegerNumber as r, decodeObjectIdentifier as i, decodeString as a, parseTime as o } from "../internal/asn1/asn1.js";
|
|
2
|
+
import { decodeFailureResult as s } from "../internal/asn1/decode-refusal.js";
|
|
3
|
+
import { readElement as c, readRootElement as l, readSequenceChildren as u } from "../internal/asn1/der.js";
|
|
4
|
+
import { DECODE_REFUSAL_CODES as d, rethrowIfInvariant as f, successResult as p } from "../result/result.js";
|
|
5
5
|
// src/der/der.ts
|
|
6
|
-
function attempt(
|
|
6
|
+
function attempt(e, t) {
|
|
7
7
|
try {
|
|
8
|
-
return
|
|
9
|
-
} catch (
|
|
10
|
-
return
|
|
8
|
+
return p(e());
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return f(e), s(e, d, t);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function requireTag(e, t, n) {
|
|
@@ -21,7 +21,7 @@ function requireTag(e, t, n) {
|
|
|
21
21
|
* @throws if the element is truncated, indefinite-length, or non-minimally encoded.
|
|
22
22
|
*/
|
|
23
23
|
function readDerElementOrThrow(e, t = 0) {
|
|
24
|
-
return
|
|
24
|
+
return c(e, t);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Reads one TLV element from {@linkcode bytes} starting at {@linkcode offset}.
|
|
@@ -37,7 +37,7 @@ function readDerElement(e, t = 0) {
|
|
|
37
37
|
* @throws if {@linkcode bytes} carries trailing data, or nesting exceeds the depth guard.
|
|
38
38
|
*/
|
|
39
39
|
function readDerRootOrThrow(e, t) {
|
|
40
|
-
return
|
|
40
|
+
return l(e, t);
|
|
41
41
|
}
|
|
42
42
|
/** Reads the single top-level TLV element from {@linkcode bytes}. */
|
|
43
43
|
function readDerRoot(e, t) {
|
|
@@ -49,7 +49,7 @@ function readDerRoot(e, t) {
|
|
|
49
49
|
* @throws if the root element is not a SEQUENCE, or if child boundaries are inconsistent.
|
|
50
50
|
*/
|
|
51
51
|
function readDerSequenceOrThrow(e, t) {
|
|
52
|
-
return
|
|
52
|
+
return u(e, t);
|
|
53
53
|
}
|
|
54
54
|
/** Reads a DER-encoded SEQUENCE from {@linkcode bytes} and returns its direct children. */
|
|
55
55
|
function readDerSequence(e, t) {
|
|
@@ -60,8 +60,8 @@ function readDerSequence(e, t) {
|
|
|
60
60
|
*
|
|
61
61
|
* @throws if a child overflows {@linkcode parent}, or data is left between the last child and its end.
|
|
62
62
|
*/
|
|
63
|
-
function derChildrenOrThrow(
|
|
64
|
-
return
|
|
63
|
+
function derChildrenOrThrow(t, n) {
|
|
64
|
+
return e(t, n);
|
|
65
65
|
}
|
|
66
66
|
/** Reads the direct children of a constructed {@linkcode parent} within {@linkcode source}. */
|
|
67
67
|
function derChildren(e, t) {
|
|
@@ -73,7 +73,7 @@ function derChildren(e, t) {
|
|
|
73
73
|
* @throws if {@linkcode element} is mis-tagged, or holds anything but `0x00` or `0xff`.
|
|
74
74
|
*/
|
|
75
75
|
function decodeDerBooleanOrThrow(e) {
|
|
76
|
-
return
|
|
76
|
+
return n(requireTag(e, 1, "BOOLEAN").value);
|
|
77
77
|
}
|
|
78
78
|
/** Decodes a BOOLEAN element (tag `0x01`). */
|
|
79
79
|
function decodeDerBoolean(e) {
|
|
@@ -86,7 +86,7 @@ function decodeDerBoolean(e) {
|
|
|
86
86
|
* or exceeds {@linkcode Number.MAX_SAFE_INTEGER}.
|
|
87
87
|
*/
|
|
88
88
|
function decodeDerIntegerOrThrow(e) {
|
|
89
|
-
return
|
|
89
|
+
return r(requireTag(e, 2, "INTEGER").value);
|
|
90
90
|
}
|
|
91
91
|
/** Decodes an INTEGER element (tag `0x02`) into a `number`. */
|
|
92
92
|
function decodeDerInteger(e) {
|
|
@@ -110,7 +110,7 @@ function decodeDerOctetString(e) {
|
|
|
110
110
|
* @throws if {@linkcode element} is mis-tagged, or holds a malformed sub-identifier.
|
|
111
111
|
*/
|
|
112
112
|
function decodeDerOidOrThrow(e) {
|
|
113
|
-
return
|
|
113
|
+
return i(requireTag(e, 6, "OBJECT IDENTIFIER").value);
|
|
114
114
|
}
|
|
115
115
|
/** Decodes an OBJECT IDENTIFIER element (tag `0x06`) into dotted-decimal form. */
|
|
116
116
|
function decodeDerOid(e) {
|
|
@@ -125,7 +125,7 @@ function decodeDerOid(e) {
|
|
|
125
125
|
* @throws if {@linkcode element} is mis-tagged, or claims more than seven unused bits.
|
|
126
126
|
*/
|
|
127
127
|
function decodeDerBitStringOrThrow(e) {
|
|
128
|
-
return
|
|
128
|
+
return t(e);
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Decodes a BIT STRING element (tag `0x03`) into a {@linkcode DerBitString}.
|
|
@@ -145,7 +145,7 @@ function decodeDerBitString(e) {
|
|
|
145
145
|
* @throws on every other string tag, and on a TeletexString octet outside that state.
|
|
146
146
|
*/
|
|
147
147
|
function decodeDerStringOrThrow(e) {
|
|
148
|
-
return
|
|
148
|
+
return a(e.tag, e.value);
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Decodes a string element into text, dispatching on its tag.
|
|
@@ -162,7 +162,7 @@ function decodeDerString(e) {
|
|
|
162
162
|
* @throws if {@linkcode element} carries any other tag, or a malformed time value.
|
|
163
163
|
*/
|
|
164
164
|
function decodeDerTimeOrThrow(e) {
|
|
165
|
-
return
|
|
165
|
+
return o(e);
|
|
166
166
|
}
|
|
167
167
|
/** Decodes a UTCTime (tag `0x17`) or GeneralizedTime (tag `0x18`) element into a {@linkcode Date}. */
|
|
168
168
|
function decodeDerTime(e) {
|
package/dist/der.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* DER reading and writing primitives.
|
|
3
|
+
*
|
|
4
|
+
* The building blocks every other entrypoint is made of, for the cases the typed APIs do not cover:
|
|
5
|
+
*
|
|
6
|
+
* - decoding a private extension's {@linkcode https://www.rfc-editor.org/info/rfc5280/#section-4.1 | extnValue} inside an {@linkcode https://micro509.kjanat.dev/next/api/x509#type-extensiondecoder | ExtensionDecoder}
|
|
7
|
+
* - encoding the bytes a {@linkcode https://micro509.kjanat.dev/next/api/x509#type-customextension | CustomExtension} carries
|
|
8
|
+
* - inspecting a structure this library does not model
|
|
9
|
+
*
|
|
10
|
+
* Reading accepts definite lengths and minimal length encodings, rejects the high-tag-number form,
|
|
11
|
+
* and applies a nesting-depth guard capped at {@linkcode DEFAULT_MAX_DER_DEPTH}.
|
|
12
|
+
* BER-only constructs fail.
|
|
13
|
+
*
|
|
14
|
+
* Readers and decoders take untrusted bytes, so each one comes as a pair:
|
|
15
|
+
*
|
|
16
|
+
* - {@linkcode https://micro509.kjanat.dev/next/api/der#fn-decodederinteger | decodeDerInteger} returns a {@linkcode https://micro509.kjanat.dev/next/api/der#type-decodederresult | DecodeDerResult}
|
|
17
|
+
* - {@linkcode https://micro509.kjanat.dev/next/api/der#fn-decodederintegerorthrow | decodeDerIntegerOrThrow} throws
|
|
18
|
+
*
|
|
19
|
+
* Writers take typed input and throw, matching {@linkcode https://micro509.kjanat.dev/next/api/x509#fn-encodename | encodeName} and {@linkcode https://micro509.kjanat.dev/next/api/pem#fn-pemencode | pemEncode}.
|
|
20
|
+
*
|
|
21
|
+
* All operations are synchronous.
|
|
22
|
+
*
|
|
23
|
+
* @module micro509/der
|
|
24
|
+
*/
|
|
3
25
|
import { DecodeDerErrorCode, DecodeDerFailure, DecodeDerResult, decodeDerBitString, decodeDerBitStringOrThrow, decodeDerBoolean, decodeDerBooleanOrThrow, decodeDerInteger, decodeDerIntegerOrThrow, decodeDerOctetString, decodeDerOctetStringOrThrow, decodeDerOid, decodeDerOidOrThrow, decodeDerString, decodeDerStringOrThrow, decodeDerTime, decodeDerTimeOrThrow, derChildren, derChildrenOrThrow, readDerElement, readDerElementOrThrow, readDerRoot, readDerRootOrThrow, readDerSequence, readDerSequenceOrThrow } from "./der/der.js";
|
|
26
|
+
import { DerBitString, hexToBytes, toHex } from "./internal/asn1/asn1.js";
|
|
27
|
+
import { DEFAULT_MAX_DER_DEPTH, DerElement, ReadRootElementOptions, ReadSequenceChildrenOptions, assertDerMaxDepth, bitString, bmpString, bool, concatBytes, explicitContext, generalizedTime, ia5String, implicitConstructedContext, implicitPrimitiveContext, integer, integerFromNumber, nullValue, objectIdentifier, octetString, printableString, sequence, setOf, time, tlv, universalString, utcTime, utf8String } from "./internal/asn1/der.js";
|
|
4
28
|
export { DEFAULT_MAX_DER_DEPTH, type DecodeDerErrorCode, type DecodeDerFailure, type DecodeDerResult, type DerBitString, type DerElement, type ReadRootElementOptions, type ReadSequenceChildrenOptions, assertDerMaxDepth, concatBytes, decodeDerBitString, decodeDerBitStringOrThrow, decodeDerBoolean, decodeDerBooleanOrThrow, decodeDerInteger, decodeDerIntegerOrThrow, decodeDerOctetString, decodeDerOctetStringOrThrow, decodeDerOid, decodeDerOidOrThrow, decodeDerString, decodeDerStringOrThrow, decodeDerTime, decodeDerTimeOrThrow, bitString as derBitString, bmpString as derBmpString, bool as derBoolean, derChildren, derChildrenOrThrow, explicitContext as derExplicitContext, generalizedTime as derGeneralizedTime, ia5String as derIa5String, implicitConstructedContext as derImplicitConstructedContext, implicitPrimitiveContext as derImplicitPrimitiveContext, integer as derInteger, integerFromNumber as derIntegerFromNumber, nullValue as derNull, octetString as derOctetString, objectIdentifier as derOid, printableString as derPrintableString, sequence as derSequence, setOf as derSet, time as derTime, tlv as derTlv, universalString as derUniversalString, utcTime as derUtcTime, utf8String as derUtf8String, hexToBytes, readDerElement, readDerElementOrThrow, readDerRoot, readDerRootOrThrow, readDerSequence, readDerSequenceOrThrow, toHex };
|
package/dist/der.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { hexToBytes as
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { decodeDerBitString as e, decodeDerBitStringOrThrow as t, decodeDerBoolean as n, decodeDerBooleanOrThrow as r, decodeDerInteger as i, decodeDerIntegerOrThrow as a, decodeDerOctetString as o, decodeDerOctetStringOrThrow as s, decodeDerOid as c, decodeDerOidOrThrow as l, decodeDerString as u, decodeDerStringOrThrow as d, decodeDerTime as f, decodeDerTimeOrThrow as p, derChildren as m, derChildrenOrThrow as h, readDerElement as g, readDerElementOrThrow as _, readDerRoot as v, readDerRootOrThrow as y, readDerSequence as b, readDerSequenceOrThrow as x } from "./der/der.js";
|
|
2
|
+
import { hexToBytes as S, toHex as C } from "./internal/asn1/asn1.js";
|
|
3
|
+
import { DEFAULT_MAX_DER_DEPTH as w, assertDerMaxDepth as T, bitString as E, bmpString as D, bool as O, concatBytes as k, explicitContext as A, generalizedTime as j, ia5String as M, implicitConstructedContext as N, implicitPrimitiveContext as P, integer as F, integerFromNumber as I, nullValue as L, objectIdentifier as R, octetString as z, printableString as B, sequence as V, setOf as H, time as U, tlv as W, universalString as G, utcTime as K, utf8String as q } from "./internal/asn1/der.js";
|
|
4
|
+
export { w as DEFAULT_MAX_DER_DEPTH, T as assertDerMaxDepth, k as concatBytes, e as decodeDerBitString, t as decodeDerBitStringOrThrow, n as decodeDerBoolean, r as decodeDerBooleanOrThrow, i as decodeDerInteger, a as decodeDerIntegerOrThrow, o as decodeDerOctetString, s as decodeDerOctetStringOrThrow, c as decodeDerOid, l as decodeDerOidOrThrow, u as decodeDerString, d as decodeDerStringOrThrow, f as decodeDerTime, p as decodeDerTimeOrThrow, E as derBitString, D as derBmpString, O as derBoolean, m as derChildren, h as derChildrenOrThrow, A as derExplicitContext, j as derGeneralizedTime, M as derIa5String, N as derImplicitConstructedContext, P as derImplicitPrimitiveContext, F as derInteger, I as derIntegerFromNumber, L as derNull, z as derOctetString, R as derOid, B as derPrintableString, V as derSequence, H as derSet, U as derTime, W as derTlv, G as derUniversalString, K as derUtcTime, q as derUtf8String, S as hexToBytes, g as readDerElement, _ as readDerElementOrThrow, v as readDerRoot, y as readDerRootOrThrow, b as readDerSequence, x as readDerSequenceOrThrow, C as toHex };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable root import for `micro509`.\
|
|
3
|
+
* Re-exports the common certificate, parsing, verification, revocation, key, and PKCS
|
|
4
|
+
* workflows from one package entrypoint.
|
|
5
|
+
*
|
|
6
|
+
* Reach for this module when you want the default workflow-first package surface.
|
|
7
|
+
* Use domain entrypoints such as `micro509/x509`, `micro509/verify`, and
|
|
8
|
+
* `micro509/revocation` when you need exhaustive advanced types.
|
|
9
|
+
*
|
|
10
|
+
* The root export is organized around common PKI flows:
|
|
11
|
+
*
|
|
12
|
+
* - create certificates, CSRs, CRLs, OCSP responses, PKCS#7, and PFX artifacts
|
|
13
|
+
* - parse DER or PEM inputs into typed certificate and request shapes
|
|
14
|
+
* - verify certificate chains, service identities, CRLs, OCSP, and signed data
|
|
15
|
+
* - import, export, generate, and encrypt key material with WebCrypto-safe algorithms
|
|
16
|
+
* - work with the common extension inputs, revocation evidence, and validation results
|
|
17
|
+
*
|
|
18
|
+
* Advanced PKCS#12 MAC plumbing, signature profile tuning, and other domain-specific helper
|
|
19
|
+
* types stay in their owner domains instead of being headlined here.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import {
|
|
24
|
+
* createSelfSignedCertificate,
|
|
25
|
+
* parseCertificatePem,
|
|
26
|
+
* unwrap,
|
|
27
|
+
* verifyCertificateChain,
|
|
28
|
+
* } from 'micro509';
|
|
29
|
+
*
|
|
30
|
+
* const { certificate } = await createSelfSignedCertificate({
|
|
31
|
+
* subject: { commonName: 'example.com' },
|
|
32
|
+
* algorithm: { kind: 'ecdsa', curve: 'P-256' },
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* const parsed = unwrap(parseCertificatePem(certificate.pem));
|
|
36
|
+
* // parsed.subject.values.commonName === 'example.com'
|
|
37
|
+
*
|
|
38
|
+
* const result = await verifyCertificateChain({
|
|
39
|
+
* leaf: certificate.pem,
|
|
40
|
+
* roots: [certificate.pem],
|
|
41
|
+
* allowSelfSignedLeaf: true,
|
|
42
|
+
* });
|
|
43
|
+
* // result.ok === true
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import {
|
|
49
|
+
* generateKeyPair,
|
|
50
|
+
* parseCertificateSigningRequestPem,
|
|
51
|
+
* createCertificateSigningRequest,
|
|
52
|
+
* unwrap,
|
|
53
|
+
* } from 'micro509';
|
|
54
|
+
*
|
|
55
|
+
* const keyPair = await generateKeyPair({ kind: 'ecdsa', curve: 'P-256' });
|
|
56
|
+
* const csr = await createCertificateSigningRequest({
|
|
57
|
+
* subject: { commonName: 'example.com' },
|
|
58
|
+
* publicKey: keyPair.publicKey,
|
|
59
|
+
* signerPrivateKey: keyPair.privateKey,
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* const parsed = unwrap(parseCertificateSigningRequestPem(csr.pem));
|
|
63
|
+
* // parsed.subject.values.commonName === 'example.com'
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @module micro509
|
|
67
|
+
*/
|
|
68
|
+
import { DecryptRsaOaepErrorCode, DecryptRsaOaepFailure, DecryptRsaOaepResult, EcKeyAlgorithmInput, EcNamedCurve, Ed25519KeyAlgorithmInput, EncryptRsaOaepErrorCode, EncryptRsaOaepFailure, EncryptRsaOaepResult, EncryptedPkcs8Options, ImportEcKeyInput, ImportEd25519KeyInput, ImportEncryptedKeyErrorCode, ImportEncryptedKeyFailure, ImportEncryptedKeyOptions, ImportEncryptedKeyResult, ImportKeyErrorCode, ImportKeyErrorDetails, ImportKeyFailure, ImportKeyReason, ImportKeyResult, ImportKeyStage, 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, importPrivateKeyPem, importPrivateKeyPemOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, inspectEncryptedPkcs8Der } from "./keys/keys.js";
|
|
1
69
|
import { KdfLimitOptions, Pbes2Parameters } from "./internal/crypto/pbes2.js";
|
|
2
|
-
import { DECODE_REFUSAL_CODES, DecodeFailureCode, DecodeRefusalCode, ErrorResult, IndexedErrorResult, IndexedMicro509Error, Micro509Error, Result, ResultError, isResultError, unwrap, unwrapOr } from "./result/result.js";
|
|
3
|
-
import { DecryptRsaOaepErrorCode, DecryptRsaOaepFailure, DecryptRsaOaepResult, EcKeyAlgorithmInput, EcNamedCurve, Ed25519KeyAlgorithmInput, EncryptRsaOaepErrorCode, EncryptRsaOaepFailure, EncryptRsaOaepResult, EncryptedPkcs8Options, ImportEcKeyInput, ImportEd25519KeyInput, ImportEncryptedKeyErrorCode, ImportEncryptedKeyFailure, ImportEncryptedKeyOptions, 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";
|
|
4
70
|
import { CategorizePemBlocksResult, CategorizedPemBlocks, PemBlock, PemDecodeResult, PemErrorCode, PemFailure, SplitPemBlocksResult, categorizePemBlocks, categorizePemBlocksOrThrow, pemDecode, pemDecodeOrThrow, pemEncode, splitPemBlocks, splitPemBlocksOrThrow } from "./pem/pem.js";
|
|
5
|
-
import { CreatePkcs12MacDataErrorCode, ParsePkcs12MacDataErrorCode, ParsePkcs12MacDataFailure, ParsePkcs12MacDataOptions, ParsePkcs12MacDataResult, ParsedPkcs12MacData, Pkcs12MacOptions } from "./pkcs/pkcs12-mac.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, DisplayTextType, DistributionPoint, DistributionPointName, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, NameConstraintForm, NameConstraints, OversizedDisplayText, 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";
|
|
11
71
|
import { CreatePfxErrorCode, CreatePfxFailure, CreatePfxInput, CreatePfxResult, ParsePfxErrorCode, ParsePfxFailure, ParsePfxOptions, ParsePfxResult, ParsedPfx, ParsedPfxAttribute, ParsedPfxBag, ParsedPfxBagAttributes, PfxBagAttributesInput, PfxCertificateBagInput, PfxCertificateSource, PfxEncoderErrorCode, PfxEncryptionOptions, PfxMaterial, PfxPrivateKeyBagInput, PfxPrivateKeySource, createPfx, parsePfxDer, parsePfxPem } from "./pkcs/pfx.js";
|
|
12
|
-
import { CertificateMaterial, CreateCertificateErrorCode, CreateCertificateInput, CreateSelfSignedCertificateBase, CreateSelfSignedCertificateInput, SelfSignedCertificateResult, SelfSignedKeySource, ValidityInput, createCertificate, createSelfSignedCertificate } from "./x509/certificate.js";
|
|
13
72
|
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";
|
|
73
|
+
import { CreatePkcs12MacDataErrorCode, ParsePkcs12MacDataErrorCode, ParsePkcs12MacDataFailure, ParsePkcs12MacDataOptions, ParsePkcs12MacDataResult, ParsedPkcs12MacData, Pkcs12MacOptions } from "./pkcs/pkcs12-mac.js";
|
|
74
|
+
import { DECODE_REFUSAL_CODES, DecodeFailureCode, DecodeRefusalCode, ErrorResult, IndexedErrorResult, IndexedMicro509Error, Micro509Error, Result, ResultError, isResultError, unwrap, unwrapOr } from "./result/result.js";
|
|
14
75
|
import { CertificateRevocationListMaterial, CheckCertificateRevocationAgainstCrlErrorCode, CheckCertificateRevocationAgainstCrlFailure, CheckCertificateRevocationAgainstCrlFailureDetails, CheckCertificateRevocationAgainstCrlGoodValue, CheckCertificateRevocationAgainstCrlInput, CheckCertificateRevocationAgainstCrlResult, CheckCertificateRevocationAgainstCrlRevokedValue, CheckCertificateRevocationAgainstCrlValue, CreateCertificateRevocationListInput, CrlApplicabilityFailureReason, CrlCertificateSource, CrlEncoderErrorCode, CrlSource, ParseCertificateRevocationListErrorCode, ParseCertificateRevocationListFailure, ParseCertificateRevocationListResult, ParsedCertificateRevocationList, ParsedRevocationReason, ParsedRevokedCertificate, RevocationReason, RevokedCertificateInput, UnrecognizedReasonCodePolicy, UnrecognizedRevocationReason, 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";
|
|
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";
|
|
17
76
|
import { CertificateRevocationStatus, CheckChainRevocationInput, CheckChainRevocationResult, CheckChainRevocationValue, OcspResponseSource, REVOCATION_INDETERMINATE_REASONS, RevocationExecutionError, RevocationIndeterminateReason, RevocationParseError, RevocationPolicy, RevocationProcessingError, RevocationSource, TrustedOcspResponder, checkChainRevocation } from "./revocation/chain.js";
|
|
77
|
+
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";
|
|
78
|
+
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";
|
|
79
|
+
import { AuthorityInformationAccess, AuthorityInformationAccessInput, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, DisplayTextType, DistributionPoint, DistributionPointName, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, NameConstraintForm, NameConstraints, OversizedDisplayText, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyQualifierInfo, SubjectAltName } from "./x509/extensions.js";
|
|
80
|
+
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";
|
|
81
|
+
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, VerifyFailureSource, VerifyPurpose, VerifyRequestFailure, VerifyRequestResult, buildCandidatePath, checkExtendedKeyUsage, trustAnchorFromCertificate, validateCandidatePath, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, verifyCertificateChain, verifyCertificateSigningRequest } from "./verify/verify.js";
|
|
82
|
+
import { ConstrainedPolicy, PolicyValidationInput, PolicyValidationOutcome } from "./verify/policy.js";
|
|
18
83
|
import { DnsServiceIdentityInput, IpServiceIdentityInput, MatchServiceIdentityErrorCode, MatchServiceIdentityFailure, MatchServiceIdentityFailureDetails, MatchServiceIdentityFailureResult, MatchServiceIdentityInput, MatchServiceIdentityResult, MatchServiceIdentitySuccess, ServiceIdentityInput, ServiceIdentityType, SrvServiceIdentityInput, UriServiceIdentityInput, matchCertificateServiceIdentity, matchServiceIdentity } from "./verify/identity.js";
|
|
19
84
|
import { InitialNameConstraintsInput } from "./verify/name-constraints.js";
|
|
20
|
-
import { ConstrainedPolicy, PolicyValidationInput, PolicyValidationOutcome } from "./verify/policy.js";
|
|
21
85
|
import { isSelfIssued } from "./internal/verify/verify-path.js";
|
|
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, VerifyFailureSource, VerifyPurpose, VerifyRequestFailure, VerifyRequestResult, buildCandidatePath, checkExtendedKeyUsage, trustAnchorFromCertificate, validateCandidatePath, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, verifyCertificateChain, verifyCertificateSigningRequest } from "./verify/verify.js";
|
|
23
|
-
import { CreateCsrInput, CsrMaterial, createCertificateSigningRequest } from "./x509/csr.js";
|
|
24
86
|
import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint, subjectPublicKeyInfoFingerprint } from "./x509/fingerprint.js";
|
|
87
|
+
import { CertificateMaterial, CreateCertificateErrorCode, CreateCertificateInput, CreateSelfSignedCertificateBase, CreateSelfSignedCertificateInput, SelfSignedCertificateResult, SelfSignedKeySource, ValidityInput, createCertificate, createSelfSignedCertificate } from "./x509/certificate.js";
|
|
88
|
+
import { CreateCsrInput, CsrMaterial, createCertificateSigningRequest } from "./x509/csr.js";
|
|
89
|
+
import { ExtensionEncoderErrorCode } from "./internal/x509/extension-errors.js";
|
|
90
|
+
import { NameAttribute, NameEncoderErrorCode, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput } from "./x509/name.js";
|
|
25
91
|
import { SubjectAltNameTextOptions, distinguishedNameToString, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString } from "./x509/name-text.js";
|
|
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 CreatePkcs12MacDataErrorCode, 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, DECODE_REFUSAL_CODES, type DecodeFailureCode, type DecodeRefusalCode, type DecodedExtensionMap, type DecodedExtensionValue, type DecryptRsaOaepErrorCode, type DecryptRsaOaepFailure, type DecryptRsaOaepResult, type DisplayTextType, 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 ImportEncryptedKeyOptions, 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 KdfLimitOptions, 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 OversizedDisplayText, 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 ParsePkcs12MacDataOptions, 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 ParsedRevocationReason, type ParsedRevokedCertificate, type ParsedSignerIdentifier, type Pbes2Parameters, type PemBlock, type PemDecodeResult, type PemErrorCode, type PemFailure, type PfxBagAttributesInput, type PfxCertificateBagInput, type PfxCertificateSource, type PfxEncoderErrorCode, 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 RevocationParseError, type RevocationPolicy, type RevocationProcessingError, 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 TrustedOcspResponder, type UnrecognizedReasonCodePolicy, type UnrecognizedRevocationReason, 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 VerifyFailureSource, 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, subjectPublicKeyInfoFingerprint, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
|
|
92
|
+
import { compareDistinguishedNames } from "./internal/shared/dn.js";
|
|
93
|
+
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 CreatePkcs12MacDataErrorCode, 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, DECODE_REFUSAL_CODES, type DecodeFailureCode, type DecodeRefusalCode, type DecodedExtensionMap, type DecodedExtensionValue, type DecryptRsaOaepErrorCode, type DecryptRsaOaepFailure, type DecryptRsaOaepResult, type DisplayTextType, 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 ImportEncryptedKeyOptions, type ImportEncryptedKeyResult, type ImportKeyErrorCode, type ImportKeyErrorDetails, type ImportKeyFailure, type ImportKeyReason, type ImportKeyResult, type ImportKeyStage, type ImportRsaKeyInput, type IndexedErrorResult, type IndexedMicro509Error, type InhibitAnyPolicy, type InitialNameConstraintsInput, type IpServiceIdentityInput, type IssuingDistributionPoint, type IssuingDistributionPointBase, type IssuingDistributionPointForAttributeCerts, type IssuingDistributionPointForCaCerts, type IssuingDistributionPointForUserCerts, type KdfLimitOptions, 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 OversizedDisplayText, 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 ParsePkcs12MacDataOptions, 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 ParsedRevocationReason, type ParsedRevokedCertificate, type ParsedSignerIdentifier, type Pbes2Parameters, type PemBlock, type PemDecodeResult, type PemErrorCode, type PemFailure, type PfxBagAttributesInput, type PfxCertificateBagInput, type PfxCertificateSource, type PfxEncoderErrorCode, 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 RevocationParseError, type RevocationPolicy, type RevocationProcessingError, 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 TrustedOcspResponder, type UnrecognizedReasonCodePolicy, type UnrecognizedRevocationReason, 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 VerifyFailureSource, 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, importPrivateKeyPem, importPrivateKeyPemOrThrow, 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, subjectPublicKeyInfoFingerprint, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
|