micro509 0.9.0 → 0.11.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/dist/index.d.ts +5 -4
- package/dist/index.js +16 -15
- package/dist/internal/asn1/asn1.js +145 -186
- package/dist/internal/asn1/asn1.js.map +1 -0
- package/dist/internal/asn1/der.js +210 -227
- package/dist/internal/asn1/der.js.map +1 -0
- package/dist/internal/asn1/oids.js +297 -101
- package/dist/internal/asn1/oids.js.map +1 -0
- package/dist/internal/asn1/oids2.js +69 -0
- package/dist/internal/asn1/oids2.js.map +1 -0
- package/dist/internal/crypto/algorithm-names.js +37 -35
- package/dist/internal/crypto/algorithm-names.js.map +1 -0
- package/dist/internal/crypto/ecdsa.js +25 -28
- package/dist/internal/crypto/ecdsa.js.map +1 -0
- package/dist/internal/crypto/hash.js +56 -117
- package/dist/internal/crypto/hash.js.map +1 -0
- package/dist/internal/crypto/pbes2.js +122 -133
- package/dist/internal/crypto/pbes2.js.map +1 -0
- package/dist/internal/crypto/rsa-pss.js +118 -124
- package/dist/internal/crypto/rsa-pss.js.map +1 -0
- package/dist/internal/crypto/sig-verify.js +87 -99
- package/dist/internal/crypto/sig-verify.js.map +1 -0
- package/dist/internal/crypto/signing.d.ts +12 -8
- package/dist/internal/crypto/signing.js +53 -55
- package/dist/internal/crypto/signing.js.map +1 -0
- package/dist/internal/crypto/webcrypto.js +5 -3
- package/dist/internal/crypto/webcrypto.js.map +1 -0
- package/dist/internal/shared/base64.js +10 -9
- package/dist/internal/shared/base64.js.map +1 -0
- package/dist/internal/shared/dn.js +50 -57
- package/dist/internal/shared/dn.js.map +1 -0
- package/dist/internal/shared/ip.js +43 -53
- package/dist/internal/shared/ip.js.map +1 -0
- package/dist/internal/verify/name-constraints-engine.js +211 -239
- package/dist/internal/verify/name-constraints-engine.js.map +1 -0
- package/dist/internal/verify/policy-engine.js +228 -247
- package/dist/internal/verify/policy-engine.js.map +1 -0
- package/dist/internal/verify/verify-path.js +213 -228
- package/dist/internal/verify/verify-path.js.map +1 -0
- package/dist/internal/x509/extension-bits.js +62 -59
- package/dist/internal/x509/extension-bits.js.map +1 -0
- package/dist/internal/x509/extension-registry.js +133 -164
- package/dist/internal/x509/extension-registry.js.map +1 -0
- package/dist/internal/x509/name-fields.js +35 -41
- package/dist/internal/x509/name-fields.js.map +1 -0
- package/dist/keys/keys.d.ts +583 -547
- package/dist/keys/keys.js +519 -431
- package/dist/keys/keys.js.map +1 -0
- package/dist/keys.js +2 -2
- package/dist/pem/pem.d.ts +46 -46
- package/dist/pem/pem.js +62 -81
- package/dist/pem/pem.js.map +1 -0
- package/dist/pem.js +2 -2
- package/dist/pkcs/pfx.d.ts +96 -80
- package/dist/pkcs/pfx.js +191 -231
- package/dist/pkcs/pfx.js.map +1 -0
- package/dist/pkcs/pkcs12-mac.d.ts +20 -18
- package/dist/pkcs/pkcs12-mac.js +90 -111
- package/dist/pkcs/pkcs12-mac.js.map +1 -0
- package/dist/pkcs/pkcs7.d.ts +118 -69
- package/dist/pkcs/pkcs7.js +401 -443
- package/dist/pkcs/pkcs7.js.map +1 -0
- package/dist/pkcs.d.ts +2 -2
- package/dist/pkcs.js +4 -4
- package/dist/result/result.d.ts +37 -32
- package/dist/result/result.js +46 -44
- package/dist/result/result.js.map +1 -0
- package/dist/result.js +2 -2
- package/dist/revocation/chain.d.ts +138 -119
- package/dist/revocation/chain.js +248 -281
- package/dist/revocation/chain.js.map +1 -0
- package/dist/revocation/crl.d.ts +125 -123
- package/dist/revocation/crl.js +653 -745
- package/dist/revocation/crl.js.map +1 -0
- package/dist/revocation/ocsp.d.ts +183 -177
- package/dist/revocation/ocsp.js +579 -636
- package/dist/revocation/ocsp.js.map +1 -0
- package/dist/revocation/revocation.d.ts +26 -26
- package/dist/revocation/revocation.js +104 -125
- package/dist/revocation/revocation.js.map +1 -0
- package/dist/revocation.js +5 -5
- package/dist/verify/identity.d.ts +42 -42
- package/dist/verify/identity.js +158 -167
- package/dist/verify/identity.js.map +1 -0
- package/dist/verify/name-constraints.d.ts +7 -7
- package/dist/verify/policy.d.ts +10 -10
- package/dist/verify/verify.d.ts +163 -163
- package/dist/verify/verify.js +396 -392
- package/dist/verify/verify.js.map +1 -0
- package/dist/verify.js +3 -3
- package/dist/x509/certificate.d.ts +117 -117
- package/dist/x509/certificate.js +51 -60
- package/dist/x509/certificate.js.map +1 -0
- package/dist/x509/csr.d.ts +25 -25
- package/dist/x509/csr.js +26 -30
- package/dist/x509/csr.js.map +1 -0
- package/dist/x509/extensions.d.ts +228 -184
- package/dist/x509/extensions.js +175 -200
- package/dist/x509/extensions.js.map +1 -0
- package/dist/x509/fingerprint.d.ts +55 -0
- package/dist/x509/fingerprint.js +55 -0
- package/dist/x509/fingerprint.js.map +1 -0
- package/dist/x509/name.d.ts +94 -93
- package/dist/x509/name.js +30 -29
- package/dist/x509/name.js.map +1 -0
- package/dist/x509/parse.d.ts +288 -185
- package/dist/x509/parse.js +762 -677
- package/dist/x509/parse.js.map +1 -0
- package/dist/x509.d.ts +3 -2
- package/dist/x509.js +7 -6
- package/package.json +79 -41
package/dist/x509/parse.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { ErrorResult, Micro509Error } from "../result/result.js";
|
|
|
2
2
|
import { ImportKeyResult, PublicKeyImportInput } from "../keys/keys.js";
|
|
3
3
|
import { NameFieldKey } from "./name.js";
|
|
4
4
|
import { AuthorityInformationAccess, BasicConstraints, CertificatePolicies, DistributionPointReason, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, KeyUsage, NameConstraints, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyMappings, SubjectAltName } from "./extensions.js";
|
|
5
|
-
|
|
6
5
|
//#region src/x509/parse.d.ts
|
|
7
6
|
/** Machine-readable failure reason for {@linkcode parseCertificateDer} / {@linkcode parseCertificatePem}. */
|
|
8
7
|
type ParseCertificateErrorCode = "malformed";
|
|
@@ -24,20 +23,20 @@ interface ParseCertificateSigningRequestFailure extends Micro509Error<ParseCerti
|
|
|
24
23
|
readonly ok: false;
|
|
25
24
|
}
|
|
26
25
|
/**
|
|
27
|
-
* Success-or-failure result from {@linkcode parseCertificateSigningRequestDer} /
|
|
28
|
-
* {@linkcode parseCertificateSigningRequestPem}.
|
|
29
|
-
*/
|
|
26
|
+
* Success-or-failure result from {@linkcode parseCertificateSigningRequestDer} /
|
|
27
|
+
* {@linkcode parseCertificateSigningRequestPem}.
|
|
28
|
+
*/
|
|
30
29
|
type ParseCertificateSigningRequestResult<TMap extends ExtensionDecoderMap = Record<never, never>> = {
|
|
31
30
|
readonly ok: true;
|
|
32
31
|
readonly value: ParsedCertificateSigningRequest<TMap>;
|
|
33
32
|
} | ErrorResult<ParseCertificateSigningRequestErrorCode, Record<never, never>, ParseCertificateSigningRequestFailure>;
|
|
34
33
|
/**
|
|
35
|
-
* A single decoded name attribute from an X.501 RelativeDistinguishedName.
|
|
36
|
-
*
|
|
37
|
-
* RFC 5280 / X.501 call this structure an `AttributeTypeAndValue`.
|
|
38
|
-
*
|
|
39
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc5280#appendix-A.1 RFC 5280 Appendix A.1}
|
|
40
|
-
*/
|
|
34
|
+
* A single decoded name attribute from an X.501 RelativeDistinguishedName.
|
|
35
|
+
*
|
|
36
|
+
* RFC 5280 / X.501 call this structure an `AttributeTypeAndValue`.
|
|
37
|
+
*
|
|
38
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc5280#appendix-A.1 RFC 5280 Appendix A.1}
|
|
39
|
+
*/
|
|
41
40
|
interface ParsedNameAttribute {
|
|
42
41
|
/** Dotted-decimal OID of the attribute type (e.g. `"2.5.4.3"` for CN). */
|
|
43
42
|
readonly oid: string;
|
|
@@ -49,11 +48,11 @@ interface ParsedNameAttribute {
|
|
|
49
48
|
readonly value: string;
|
|
50
49
|
}
|
|
51
50
|
/**
|
|
52
|
-
* An X.501 Distinguished Name decoded from an issuer or subject field.
|
|
53
|
-
*
|
|
54
|
-
* Provides three views of the same data: ordered RDNs, a flat attribute
|
|
55
|
-
* list, and a convenience key-value map for well-known fields.
|
|
56
|
-
*/
|
|
51
|
+
* An X.501 Distinguished Name decoded from an issuer or subject field.
|
|
52
|
+
*
|
|
53
|
+
* Provides three views of the same data: ordered RDNs, a flat attribute
|
|
54
|
+
* list, and a convenience key-value map for well-known fields.
|
|
55
|
+
*/
|
|
57
56
|
interface ParsedName {
|
|
58
57
|
/** Hex-encoded DER of the complete Name SEQUENCE, usable for byte-exact comparisons. */
|
|
59
58
|
readonly derHex: string;
|
|
@@ -74,9 +73,9 @@ interface ParsedRelativeDistinguishedName {
|
|
|
74
73
|
readonly values: Readonly<Partial<Record<NameFieldKey, string>>>;
|
|
75
74
|
}
|
|
76
75
|
/**
|
|
77
|
-
* The name component of a CRL Distribution Point (RFC 5280 §4.2.1.13).
|
|
78
|
-
* Exactly one of `fullName` or `relativeName` will be present.
|
|
79
|
-
*/
|
|
76
|
+
* The name component of a CRL Distribution Point (RFC 5280 §4.2.1.13).
|
|
77
|
+
* Exactly one of `fullName` or `relativeName` will be present.
|
|
78
|
+
*/
|
|
80
79
|
interface ParsedDistributionPointName {
|
|
81
80
|
/** Absolute GeneralName(s) identifying the distribution point. */
|
|
82
81
|
readonly fullName?: readonly GeneralName[];
|
|
@@ -93,9 +92,9 @@ interface ParsedDistributionPoint {
|
|
|
93
92
|
readonly crlIssuer?: readonly GeneralName[];
|
|
94
93
|
}
|
|
95
94
|
/**
|
|
96
|
-
* Decoded Issuing Distribution Point CRL extension (RFC 5280 §5.2.5).
|
|
97
|
-
* Constrains which certificates a CRL covers (scope, reasons, indirection).
|
|
98
|
-
*/
|
|
95
|
+
* Decoded Issuing Distribution Point CRL extension (RFC 5280 §5.2.5).
|
|
96
|
+
* Constrains which certificates a CRL covers (scope, reasons, indirection).
|
|
97
|
+
*/
|
|
99
98
|
interface ParsedIssuingDistributionPoint {
|
|
100
99
|
/** Where to fetch this CRL, if specified. */
|
|
101
100
|
readonly distributionPoint?: ParsedDistributionPointName;
|
|
@@ -122,11 +121,11 @@ interface ParsedExtension {
|
|
|
122
121
|
readonly valueHex: string;
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
|
-
* User-supplied decoder for a single extension OID.
|
|
126
|
-
*
|
|
127
|
-
* Register with {@linkcode ParseOptions.decoders} or {@linkcode ParseOptions.decoderMap}
|
|
128
|
-
* to decode custom extensions during parsing.
|
|
129
|
-
*/
|
|
124
|
+
* User-supplied decoder for a single extension OID.
|
|
125
|
+
*
|
|
126
|
+
* Register with {@linkcode ParseOptions.decoders} or {@linkcode ParseOptions.decoderMap}
|
|
127
|
+
* to decode custom extensions during parsing.
|
|
128
|
+
*/
|
|
130
129
|
interface ExtensionDecoder<TValue> {
|
|
131
130
|
/** OID this decoder handles. */
|
|
132
131
|
readonly oid: string;
|
|
@@ -134,23 +133,23 @@ interface ExtensionDecoder<TValue> {
|
|
|
134
133
|
decode(extension: ParsedExtension): TValue;
|
|
135
134
|
}
|
|
136
135
|
/**
|
|
137
|
-
* Identity helper that narrows the type of a custom {@linkcode ExtensionDecoder} literal.
|
|
138
|
-
*
|
|
139
|
-
* @param decoder Decoder definition to return unchanged.
|
|
140
|
-
* @returns The same decoder, properly typed.
|
|
141
|
-
*/
|
|
136
|
+
* Identity helper that narrows the type of a custom {@linkcode ExtensionDecoder} literal.
|
|
137
|
+
*
|
|
138
|
+
* @param decoder Decoder definition to return unchanged.
|
|
139
|
+
* @returns The same decoder, properly typed.
|
|
140
|
+
*/
|
|
142
141
|
declare function defineExtensionDecoder<TValue>(decoder: ExtensionDecoder<TValue>): ExtensionDecoder<TValue>;
|
|
143
142
|
/**
|
|
144
|
-
* Identity helper that narrows the type of a custom {@linkcode ExtensionDecoderMap} literal.
|
|
145
|
-
*
|
|
146
|
-
* @param decoderMap Map of named decoders to return unchanged.
|
|
147
|
-
* @returns The same map, properly typed.
|
|
148
|
-
*/
|
|
143
|
+
* Identity helper that narrows the type of a custom {@linkcode ExtensionDecoderMap} literal.
|
|
144
|
+
*
|
|
145
|
+
* @param decoderMap Map of named decoders to return unchanged.
|
|
146
|
+
* @returns The same map, properly typed.
|
|
147
|
+
*/
|
|
149
148
|
declare function defineExtensionDecoderMap<TMap extends ExtensionDecoderMap>(decoderMap: TMap): TMap;
|
|
150
149
|
/** String-keyed map of {@linkcode ExtensionDecoder}s, used with {@linkcode ParseOptions.decoderMap}. */
|
|
151
150
|
type ExtensionDecoderMap = Record<string, ExtensionDecoder<unknown>>;
|
|
152
151
|
/** Inferred result type when decoding extensions via an {@linkcode ExtensionDecoderMap}. */
|
|
153
|
-
type DecodedExtensionMap<TMap extends ExtensionDecoderMap> = { [TKey in keyof TMap]?: TMap[TKey] extends ExtensionDecoder<infer TValue> ? DecodedExtensionValue<TValue> : never };
|
|
152
|
+
type DecodedExtensionMap<TMap extends ExtensionDecoderMap> = { [TKey in keyof TMap]?: TMap[TKey] extends ExtensionDecoder<infer TValue> ? DecodedExtensionValue<TValue> : never; };
|
|
154
153
|
/** A successfully decoded extension value paired with its OID and criticality. */
|
|
155
154
|
interface DecodedExtensionValue<TValue> {
|
|
156
155
|
/** Dotted-decimal OID of the decoded extension. */
|
|
@@ -161,12 +160,12 @@ interface DecodedExtensionValue<TValue> {
|
|
|
161
160
|
readonly value: TValue;
|
|
162
161
|
}
|
|
163
162
|
/**
|
|
164
|
-
* Options for {@linkcode parseCertificateDer}, {@linkcode parseCertificatePem},
|
|
165
|
-
* and CSR parse functions.
|
|
166
|
-
*
|
|
167
|
-
* Supply custom extension decoders to have their results included in the parsed output alongside
|
|
168
|
-
* the built-in extensions.
|
|
169
|
-
*/
|
|
163
|
+
* Options for {@linkcode parseCertificateDer}, {@linkcode parseCertificatePem},
|
|
164
|
+
* and CSR parse functions.
|
|
165
|
+
*
|
|
166
|
+
* Supply custom extension decoders to have their results included in the parsed output alongside
|
|
167
|
+
* the built-in extensions.
|
|
168
|
+
*/
|
|
170
169
|
interface ParseOptions<TMap extends ExtensionDecoderMap = Record<never, never>> {
|
|
171
170
|
/** Array of decoders; decoded values appear in `decodedExtensions`. */
|
|
172
171
|
readonly decoders?: readonly ExtensionDecoder<unknown>[];
|
|
@@ -174,12 +173,12 @@ interface ParseOptions<TMap extends ExtensionDecoderMap = Record<never, never>>
|
|
|
174
173
|
readonly decoderMap?: TMap;
|
|
175
174
|
}
|
|
176
175
|
/**
|
|
177
|
-
* A fully decoded X.509 certificate.
|
|
178
|
-
*
|
|
179
|
-
* Built-in extensions (basicConstraints, keyUsage, etc.) are decoded into
|
|
180
|
-
* typed fields automatically.\
|
|
181
|
-
* Supply {@linkcode ParseOptions} to also decode custom extensions.
|
|
182
|
-
*/
|
|
176
|
+
* A fully decoded X.509 certificate.
|
|
177
|
+
*
|
|
178
|
+
* Built-in extensions (basicConstraints, keyUsage, etc.) are decoded into
|
|
179
|
+
* typed fields automatically.\
|
|
180
|
+
* Supply {@linkcode ParseOptions} to also decode custom extensions.
|
|
181
|
+
*/
|
|
183
182
|
interface ParsedCertificate<TMap extends ExtensionDecoderMap = Record<never, never>> {
|
|
184
183
|
/** Complete DER encoding of the certificate (copied from the input). */
|
|
185
184
|
readonly der: Uint8Array;
|
|
@@ -249,11 +248,11 @@ interface ParsedCertificate<TMap extends ExtensionDecoderMap = Record<never, nev
|
|
|
249
248
|
readonly authorityKeyIdentifier?: string;
|
|
250
249
|
}
|
|
251
250
|
/**
|
|
252
|
-
* A fully decoded PKCS#10 Certificate Signing Request.
|
|
253
|
-
*
|
|
254
|
-
* Extension fields mirror {@linkcode ParsedCertificate} but come from the
|
|
255
|
-
* CSR's extensionRequest attribute rather than the v3 extensions block.
|
|
256
|
-
*/
|
|
251
|
+
* A fully decoded PKCS#10 Certificate Signing Request.
|
|
252
|
+
*
|
|
253
|
+
* Extension fields mirror {@linkcode ParsedCertificate} but come from the
|
|
254
|
+
* CSR's extensionRequest attribute rather than the v3 extensions block.
|
|
255
|
+
*/
|
|
257
256
|
interface ParsedCertificateSigningRequest<TMap extends ExtensionDecoderMap = Record<never, never>> {
|
|
258
257
|
/** PKCS#10 version number (always 1). */
|
|
259
258
|
readonly version: number;
|
|
@@ -309,164 +308,268 @@ interface ParsedCertificateSigningRequest<TMap extends ExtensionDecoderMap = Rec
|
|
|
309
308
|
readonly decodedExtensionMap?: DecodedExtensionMap<TMap>;
|
|
310
309
|
}
|
|
311
310
|
/**
|
|
312
|
-
* Throwing core for {@linkcode parseCertificateDer}.
|
|
313
|
-
*
|
|
314
|
-
* Decodes a DER-encoded X.509 certificate into a {@linkcode ParsedCertificate},
|
|
315
|
-
* throwing on malformed input. All built-in extensions (basicConstraints,
|
|
316
|
-
* keyUsage, subjectAltNames, etc.) are decoded automatically.\
|
|
317
|
-
* Pass {@linkcode ParseOptions} to also decode custom extensions.
|
|
318
|
-
*
|
|
319
|
-
* @param der Raw DER bytes of an X.509 certificate.
|
|
320
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
321
|
-
*/
|
|
311
|
+
* Throwing core for {@linkcode parseCertificateDer}.
|
|
312
|
+
*
|
|
313
|
+
* Decodes a DER-encoded X.509 certificate into a {@linkcode ParsedCertificate},
|
|
314
|
+
* throwing on malformed input. All built-in extensions (basicConstraints,
|
|
315
|
+
* keyUsage, subjectAltNames, etc.) are decoded automatically.\
|
|
316
|
+
* Pass {@linkcode ParseOptions} to also decode custom extensions.
|
|
317
|
+
*
|
|
318
|
+
* @param der Raw DER bytes of an X.509 certificate.
|
|
319
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
320
|
+
*/
|
|
322
321
|
declare function parseCertificateDerOrThrow<TMap extends ExtensionDecoderMap = Record<never, never>>(der: Uint8Array, options?: ParseOptions<TMap>): ParsedCertificate<TMap>;
|
|
323
322
|
/**
|
|
324
|
-
* Decode a DER-encoded X.509 certificate into a {@linkcode ParsedCertificate}.
|
|
325
|
-
*
|
|
326
|
-
* @example
|
|
327
|
-
* ```ts
|
|
328
|
-
* import { parseCertificateDer } from 'micro509';
|
|
329
|
-
*
|
|
330
|
-
* const result = parseCertificateDer(derBytes);
|
|
331
|
-
* if (result.ok) {
|
|
332
|
-
* console.log(result.value.subject.values.commonName); // "example.com"
|
|
333
|
-
* }
|
|
334
|
-
* ```
|
|
335
|
-
*
|
|
336
|
-
* @param der Raw DER bytes of an X.509 certificate.
|
|
337
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
338
|
-
*/
|
|
323
|
+
* Decode a DER-encoded X.509 certificate into a {@linkcode ParsedCertificate}.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```ts
|
|
327
|
+
* import { parseCertificateDer } from 'micro509';
|
|
328
|
+
*
|
|
329
|
+
* const result = parseCertificateDer(derBytes);
|
|
330
|
+
* if (result.ok) {
|
|
331
|
+
* console.log(result.value.subject.values.commonName); // "example.com"
|
|
332
|
+
* }
|
|
333
|
+
* ```
|
|
334
|
+
*
|
|
335
|
+
* @param der Raw DER bytes of an X.509 certificate.
|
|
336
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
337
|
+
*/
|
|
339
338
|
declare function parseCertificateDer<TMap extends ExtensionDecoderMap = Record<never, never>>(der: Uint8Array, options?: ParseOptions<TMap>): ParseCertificateResult<TMap>;
|
|
340
339
|
/**
|
|
341
|
-
* Decode a PEM-encoded X.509 certificate into a {@linkcode ParsedCertificate}.
|
|
342
|
-
*
|
|
343
|
-
* Expects a single `-----BEGIN CERTIFICATE-----` block. For bundles
|
|
344
|
-
* containing multiple certificates, use {@linkcode parseCertificateChainPem}.
|
|
345
|
-
*
|
|
346
|
-
* @example
|
|
347
|
-
* Throws on malformed input. For a typed failure instead, use the
|
|
348
|
-
* Result-returning {@linkcode parseCertificatePem}.
|
|
349
|
-
*
|
|
350
|
-
* ```ts
|
|
351
|
-
* const certificate = parseCertificatePemOrThrow(pemString); // throws if malformed
|
|
352
|
-
* console.log(certificate.issuer.values.organization); // "Let's Encrypt"
|
|
353
|
-
* ```
|
|
354
|
-
*
|
|
355
|
-
* @param pem PEM string with a CERTIFICATE block.
|
|
356
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
357
|
-
*/
|
|
340
|
+
* Decode a PEM-encoded X.509 certificate into a {@linkcode ParsedCertificate}.
|
|
341
|
+
*
|
|
342
|
+
* Expects a single `-----BEGIN CERTIFICATE-----` block. For bundles
|
|
343
|
+
* containing multiple certificates, use {@linkcode parseCertificateChainPem}.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* Throws on malformed input. For a typed failure instead, use the
|
|
347
|
+
* Result-returning {@linkcode parseCertificatePem}.
|
|
348
|
+
*
|
|
349
|
+
* ```ts
|
|
350
|
+
* const certificate = parseCertificatePemOrThrow(pemString); // throws if malformed
|
|
351
|
+
* console.log(certificate.issuer.values.organization); // "Let's Encrypt"
|
|
352
|
+
* ```
|
|
353
|
+
*
|
|
354
|
+
* @param pem PEM string with a CERTIFICATE block.
|
|
355
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
356
|
+
*/
|
|
358
357
|
declare function parseCertificatePemOrThrow<TMap extends ExtensionDecoderMap = Record<never, never>>(pem: string, options?: ParseOptions<TMap>): ParsedCertificate<TMap>;
|
|
359
358
|
/**
|
|
360
|
-
* Decode a PEM-encoded X.509 certificate into a {@linkcode ParsedCertificate}.
|
|
361
|
-
*
|
|
362
|
-
* Expects a single `-----BEGIN CERTIFICATE-----` block. For bundles
|
|
363
|
-
* containing multiple certificates, use {@linkcode parseCertificateChainPem}.
|
|
364
|
-
*
|
|
365
|
-
* @param pem PEM string with a CERTIFICATE block.
|
|
366
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
367
|
-
*/
|
|
359
|
+
* Decode a PEM-encoded X.509 certificate into a {@linkcode ParsedCertificate}.
|
|
360
|
+
*
|
|
361
|
+
* Expects a single `-----BEGIN CERTIFICATE-----` block. For bundles
|
|
362
|
+
* containing multiple certificates, use {@linkcode parseCertificateChainPem}.
|
|
363
|
+
*
|
|
364
|
+
* @param pem PEM string with a CERTIFICATE block.
|
|
365
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
366
|
+
*/
|
|
368
367
|
declare function parseCertificatePem<TMap extends ExtensionDecoderMap = Record<never, never>>(pem: string, options?: ParseOptions<TMap>): ParseCertificateResult<TMap>;
|
|
369
368
|
/**
|
|
370
|
-
* Decode a PEM bundle containing one or more certificates.
|
|
371
|
-
*
|
|
372
|
-
* Non-CERTIFICATE blocks (e.g. private keys) are silently skipped.
|
|
373
|
-
*
|
|
374
|
-
* @param pemBundle PEM text that may contain multiple CERTIFICATE blocks.
|
|
375
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
376
|
-
*/
|
|
369
|
+
* Decode a PEM bundle containing one or more certificates.
|
|
370
|
+
*
|
|
371
|
+
* Non-CERTIFICATE blocks (e.g. private keys) are silently skipped.
|
|
372
|
+
*
|
|
373
|
+
* @param pemBundle PEM text that may contain multiple CERTIFICATE blocks.
|
|
374
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
375
|
+
*/
|
|
377
376
|
declare function parseCertificateChainPem<TMap extends ExtensionDecoderMap = Record<never, never>>(pemBundle: string, options?: ParseOptions<TMap>): readonly ParsedCertificate<TMap>[];
|
|
378
377
|
/**
|
|
379
|
-
* Decode a DER-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
380
|
-
*
|
|
381
|
-
* @param der Raw DER bytes of a PKCS#10 certificate signing request.
|
|
382
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
383
|
-
*/
|
|
378
|
+
* Decode a DER-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
379
|
+
*
|
|
380
|
+
* @param der Raw DER bytes of a PKCS#10 certificate signing request.
|
|
381
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
382
|
+
*/
|
|
384
383
|
declare function parseCertificateSigningRequestDerOrThrow<TMap extends ExtensionDecoderMap = Record<never, never>>(der: Uint8Array, options?: ParseOptions<TMap>): ParsedCertificateSigningRequest<TMap>;
|
|
385
384
|
/**
|
|
386
|
-
* Decode a DER-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
387
|
-
*
|
|
388
|
-
* @param der Raw DER bytes of a PKCS#10 certificate signing request.
|
|
389
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
390
|
-
*/
|
|
385
|
+
* Decode a DER-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
386
|
+
*
|
|
387
|
+
* @param der Raw DER bytes of a PKCS#10 certificate signing request.
|
|
388
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
389
|
+
*/
|
|
391
390
|
declare function parseCertificateSigningRequestDer<TMap extends ExtensionDecoderMap = Record<never, never>>(der: Uint8Array, options?: ParseOptions<TMap>): ParseCertificateSigningRequestResult<TMap>;
|
|
392
391
|
/**
|
|
393
|
-
* Decode a PEM-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
394
|
-
*
|
|
395
|
-
* @param pem PEM string with a CERTIFICATE REQUEST block.
|
|
396
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
397
|
-
*/
|
|
392
|
+
* Decode a PEM-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
393
|
+
*
|
|
394
|
+
* @param pem PEM string with a CERTIFICATE REQUEST block.
|
|
395
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
396
|
+
*/
|
|
398
397
|
declare function parseCertificateSigningRequestPemOrThrow<TMap extends ExtensionDecoderMap = Record<never, never>>(pem: string, options?: ParseOptions<TMap>): ParsedCertificateSigningRequest<TMap>;
|
|
399
398
|
/**
|
|
400
|
-
* Decode a PEM-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
401
|
-
*
|
|
402
|
-
* @param pem PEM string with a CERTIFICATE REQUEST block.
|
|
403
|
-
* @param options Custom extension decoders to apply during parsing.
|
|
404
|
-
*/
|
|
399
|
+
* Decode a PEM-encoded PKCS#10 CSR into a {@linkcode ParsedCertificateSigningRequest}.
|
|
400
|
+
*
|
|
401
|
+
* @param pem PEM string with a CERTIFICATE REQUEST block.
|
|
402
|
+
* @param options Custom extension decoders to apply during parsing.
|
|
403
|
+
*/
|
|
405
404
|
declare function parseCertificateSigningRequestPem<TMap extends ExtensionDecoderMap = Record<never, never>>(pem: string, options?: ParseOptions<TMap>): ParseCertificateSigningRequestResult<TMap>;
|
|
406
405
|
/**
|
|
407
|
-
* Import the subject public key of a parsed certificate or CSR as a WebCrypto `CryptoKey`.
|
|
408
|
-
*
|
|
409
|
-
* The key algorithm — and, for EC keys, the curve — is inferred from the
|
|
410
|
-
* SubjectPublicKeyInfo's own AlgorithmIdentifier (the same resolution
|
|
411
|
-
* {@linkcode importSpkiDerOrThrow} applies when no algorithm is given), so
|
|
412
|
-
* callers never map {@linkcode ParsedCertificate.publicKeyAlgorithmOid} /
|
|
413
|
-
* {@linkcode ParsedCertificate.publicKeyParametersOid} by hand.\
|
|
414
|
-
* RSA keys import with the default `pkcs1-v1_5`/`SHA-256` parameters (a plain
|
|
415
|
-
* `rsaEncryption` SPKI encodes neither padding scheme nor hash); pass
|
|
416
|
-
* `algorithm` to choose other RSA parameters or to assert an expected
|
|
417
|
-
* algorithm.
|
|
418
|
-
*
|
|
419
|
-
* @param parsed Parsed certificate or CSR whose subject public key to import.
|
|
420
|
-
* @param algorithm Optional expected algorithm; must match the key contents when given.
|
|
421
|
-
* @returns Extractable `CryptoKey` with `verify` usage.
|
|
422
|
-
*
|
|
423
|
-
* @throws {Error} If the SubjectPublicKeyInfo is malformed, encodes an
|
|
424
|
-
* unsupported algorithm, or doesn't match `algorithm`
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```ts
|
|
428
|
-
* const parsed = parseCertificatePemOrThrow(pem);
|
|
429
|
-
* const publicKey = await getSubjectPublicKeyOrThrow(parsed);
|
|
430
|
-
* ```
|
|
431
|
-
*
|
|
432
|
-
* @see {@linkcode getSubjectPublicKey} for the non-throwing variant
|
|
433
|
-
*/
|
|
406
|
+
* Import the subject public key of a parsed certificate or CSR as a WebCrypto `CryptoKey`.
|
|
407
|
+
*
|
|
408
|
+
* The key algorithm — and, for EC keys, the curve — is inferred from the
|
|
409
|
+
* SubjectPublicKeyInfo's own AlgorithmIdentifier (the same resolution
|
|
410
|
+
* {@linkcode importSpkiDerOrThrow} applies when no algorithm is given), so
|
|
411
|
+
* callers never map {@linkcode ParsedCertificate.publicKeyAlgorithmOid} /
|
|
412
|
+
* {@linkcode ParsedCertificate.publicKeyParametersOid} by hand.\
|
|
413
|
+
* RSA keys import with the default `pkcs1-v1_5`/`SHA-256` parameters (a plain
|
|
414
|
+
* `rsaEncryption` SPKI encodes neither padding scheme nor hash); pass
|
|
415
|
+
* `algorithm` to choose other RSA parameters or to assert an expected
|
|
416
|
+
* algorithm.
|
|
417
|
+
*
|
|
418
|
+
* @param parsed Parsed certificate or CSR whose subject public key to import.
|
|
419
|
+
* @param algorithm Optional expected algorithm; must match the key contents when given.
|
|
420
|
+
* @returns Extractable `CryptoKey` with `verify` usage.
|
|
421
|
+
*
|
|
422
|
+
* @throws {Error} If the SubjectPublicKeyInfo is malformed, encodes an
|
|
423
|
+
* unsupported algorithm, or doesn't match `algorithm`
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* ```ts
|
|
427
|
+
* const parsed = parseCertificatePemOrThrow(pem);
|
|
428
|
+
* const publicKey = await getSubjectPublicKeyOrThrow(parsed);
|
|
429
|
+
* ```
|
|
430
|
+
*
|
|
431
|
+
* @see {@linkcode getSubjectPublicKey} for the non-throwing variant
|
|
432
|
+
*/
|
|
434
433
|
declare function getSubjectPublicKeyOrThrow<TMap extends ExtensionDecoderMap = Record<never, never>>(parsed: ParsedCertificate<TMap> | ParsedCertificateSigningRequest<TMap>, algorithm?: PublicKeyImportInput): Promise<CryptoKey>;
|
|
435
434
|
/**
|
|
436
|
-
* Import the subject public key of a parsed certificate or CSR as a WebCrypto `CryptoKey`.
|
|
437
|
-
*
|
|
438
|
-
* @see `getSubjectPublicKeyOrThrow` for the throwing variant
|
|
439
|
-
*/
|
|
435
|
+
* Import the subject public key of a parsed certificate or CSR as a WebCrypto `CryptoKey`.
|
|
436
|
+
*
|
|
437
|
+
* @see `getSubjectPublicKeyOrThrow` for the throwing variant
|
|
438
|
+
*/
|
|
440
439
|
declare function getSubjectPublicKey<TMap extends ExtensionDecoderMap = Record<never, never>>(parsed: ParsedCertificate<TMap> | ParsedCertificateSigningRequest<TMap>, algorithm?: PublicKeyImportInput): Promise<ImportKeyResult<CryptoKey>>;
|
|
441
440
|
/**
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
|
|
441
|
+
* Check whether a certificate's subject public key belongs to a private key.
|
|
442
|
+
*
|
|
443
|
+
* Confirming that an uploaded private key actually matches the certificate it
|
|
444
|
+
* was submitted with is the first thing a key-intake or issuance endpoint must
|
|
445
|
+
* do. This derives the public half of `privateKey`, exports it as
|
|
446
|
+
* SubjectPublicKeyInfo DER, and compares those bytes against the certificate's
|
|
447
|
+
* own SubjectPublicKeyInfo — the canonical, algorithm-agnostic way to test key
|
|
448
|
+
* ownership. (Comparing JWKs field by field, or signing a probe and verifying
|
|
449
|
+
* it, are both more fragile.)
|
|
450
|
+
*
|
|
451
|
+
* A private key of a different type — e.g. an ECDSA key against an RSA
|
|
452
|
+
* certificate — simply produces different SPKI DER and returns `false`, so
|
|
453
|
+
* callers get a single boolean without branching on the kind of mismatch. Reach
|
|
454
|
+
* for {@linkcode matchCertificatePrivateKey} when you need the reason a match
|
|
455
|
+
* failed (or a typed failure instead of a thrown error) at a trust boundary.
|
|
456
|
+
*
|
|
457
|
+
* The comparison is over the exact DER encoding. A certificate whose
|
|
458
|
+
* SubjectPublicKeyInfo pins RSASSA-PSS parameters (rather than the plain
|
|
459
|
+
* `rsaEncryption` OID that WebCrypto emits) therefore will not match even for
|
|
460
|
+
* the same modulus; such certificates are rare in practice.
|
|
461
|
+
*
|
|
462
|
+
* @param certificate PEM string, DER bytes, or an already-parsed certificate.
|
|
463
|
+
* @param privateKey An extractable private `CryptoKey`.
|
|
464
|
+
* @returns `true` when the private key's public half matches the certificate's
|
|
465
|
+
* subject public key.
|
|
466
|
+
*
|
|
467
|
+
* @throws {Error} If `certificate` is malformed, or `privateKey` is not an
|
|
468
|
+
* extractable private key of a supported type (propagated from
|
|
469
|
+
* {@linkcode derivePublicKey}). Use {@linkcode matchCertificatePrivateKey} for a
|
|
470
|
+
* typed `Result` instead of thrown errors.
|
|
471
|
+
*
|
|
472
|
+
* @example
|
|
473
|
+
* ```ts
|
|
474
|
+
* const privateKey = await importPkcs8PemOrThrow(keyPem, { kind: 'ecdsa', curve: 'P-256' });
|
|
475
|
+
* if (!(await certificateMatchesPrivateKey(certificatePem, privateKey))) {
|
|
476
|
+
* throw new Error('uploaded key does not match the certificate');
|
|
477
|
+
* }
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @see {@linkcode matchCertificatePrivateKey} for the typed-`Result` variant with a mismatch reason
|
|
481
|
+
* @see {@linkcode getSubjectPublicKeyOrThrow} to obtain the certificate's public key directly
|
|
482
|
+
* @see {@linkcode derivePublicKey} for the private-to-public bridge this builds on
|
|
483
|
+
*/
|
|
484
|
+
declare function certificateMatchesPrivateKey<TMap extends ExtensionDecoderMap = Record<never, never>>(certificate: ParsedCertificate<TMap> | string | Uint8Array, privateKey: CryptoKey): Promise<boolean>;
|
|
485
|
+
/** Machine-readable failure reason for {@linkcode matchCertificatePrivateKey}. */
|
|
486
|
+
type MatchCertificatePrivateKeyErrorCode = "malformed_certificate" | "unsupported_private_key" | "key_type_mismatch" | "key_mismatch";
|
|
487
|
+
/** Structured failure payload for {@linkcode matchCertificatePrivateKey}. */
|
|
488
|
+
interface MatchCertificatePrivateKeyFailure extends Micro509Error<MatchCertificatePrivateKeyErrorCode> {
|
|
489
|
+
/** Always `false` for failures. */
|
|
490
|
+
readonly ok: false;
|
|
491
|
+
}
|
|
492
|
+
/** A successful match: the private key's public half is the certificate's subject public key. */
|
|
493
|
+
interface MatchCertificatePrivateKeySuccess {
|
|
494
|
+
/** Always `true` for success. */
|
|
495
|
+
readonly ok: true;
|
|
496
|
+
/** No payload on success — the match itself is the signal. */
|
|
497
|
+
readonly value: undefined;
|
|
498
|
+
}
|
|
499
|
+
/** Failure branch of {@linkcode MatchCertificatePrivateKeyResult} with structured error details. */
|
|
500
|
+
type MatchCertificatePrivateKeyFailureResult = ErrorResult<MatchCertificatePrivateKeyErrorCode, Record<never, never>, MatchCertificatePrivateKeyFailure>;
|
|
501
|
+
/** Result of {@linkcode matchCertificatePrivateKey}. */
|
|
502
|
+
type MatchCertificatePrivateKeyResult = MatchCertificatePrivateKeySuccess | MatchCertificatePrivateKeyFailureResult;
|
|
503
|
+
/**
|
|
504
|
+
* Check whether a certificate's subject public key belongs to a private key,
|
|
505
|
+
* returning a typed {@linkcode MatchCertificatePrivateKeyResult}.
|
|
506
|
+
*
|
|
507
|
+
* The `Result`-returning companion to {@linkcode certificateMatchesPrivateKey}:
|
|
508
|
+
* where the boolean helper answers only "does it match?" (and throws on bad
|
|
509
|
+
* input), this surfaces the expected failures a key-intake or issuance endpoint
|
|
510
|
+
* meets on untrusted input as typed codes rather than exceptions — matching the
|
|
511
|
+
* house rule of returning `Result` for expected failures and throwing only for
|
|
512
|
+
* invariants. `ok: true` means the key owns the certificate; a failure carries
|
|
513
|
+
* one of:
|
|
514
|
+
*
|
|
515
|
+
* - `malformed_certificate` — `certificate` could not be parsed.
|
|
516
|
+
* - `unsupported_private_key` — `privateKey` is not an extractable private key
|
|
517
|
+
* of a supported type (from {@linkcode derivePublicKey}).
|
|
518
|
+
* - `key_type_mismatch` — the key is a different algorithm than the
|
|
519
|
+
* certificate's subject public key.
|
|
520
|
+
* - `key_mismatch` — the key is the right algorithm but a different key.
|
|
521
|
+
*
|
|
522
|
+
* As with {@linkcode certificateMatchesPrivateKey}, the comparison is over exact
|
|
523
|
+
* SPKI DER, so a certificate pinning RSASSA-PSS parameters reports
|
|
524
|
+
* `key_type_mismatch` against the `rsaEncryption` SPKI WebCrypto emits.
|
|
525
|
+
*
|
|
526
|
+
* @param certificate PEM string, DER bytes, or an already-parsed certificate.
|
|
527
|
+
* @param privateKey An extractable private `CryptoKey`.
|
|
528
|
+
* @returns A success when the key matches, or a typed failure otherwise.
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* ```ts
|
|
532
|
+
* const result = await matchCertificatePrivateKey(certificatePem, privateKey);
|
|
533
|
+
* if (!result.ok) {
|
|
534
|
+
* // result.code is 'malformed_certificate' | 'unsupported_private_key'
|
|
535
|
+
* // | 'key_type_mismatch' | 'key_mismatch'
|
|
536
|
+
* throw new Error(`key does not match certificate: ${result.code}`);
|
|
537
|
+
* }
|
|
538
|
+
* ```
|
|
539
|
+
*
|
|
540
|
+
* @see {@linkcode certificateMatchesPrivateKey} for the plain-boolean variant
|
|
541
|
+
*/
|
|
542
|
+
declare function matchCertificatePrivateKey<TMap extends ExtensionDecoderMap = Record<never, never>>(certificate: ParsedCertificate<TMap> | string | Uint8Array, privateKey: CryptoKey): Promise<MatchCertificatePrivateKeyResult>;
|
|
543
|
+
/**
|
|
544
|
+
* Find a raw extension by OID within a parsed extension list.
|
|
545
|
+
*
|
|
546
|
+
* @param extensions Extension list from a {@linkcode ParsedCertificate} or CSR.
|
|
547
|
+
* @param oid Dotted-decimal OID to look up.
|
|
548
|
+
* @returns The matching extension, or `undefined` if not present.
|
|
549
|
+
*/
|
|
448
550
|
declare function findExtension(extensions: readonly ParsedExtension[], oid: string): ParsedExtension | undefined;
|
|
449
551
|
/**
|
|
450
|
-
* Decode a single extension using a custom {@linkcode ExtensionDecoder}.
|
|
451
|
-
*
|
|
452
|
-
* @param extensions Extension list to search.
|
|
453
|
-
* @param decoder Decoder whose OID will be matched.
|
|
454
|
-
* @returns The decoded value, or `undefined` if the extension is absent.
|
|
455
|
-
*/
|
|
552
|
+
* Decode a single extension using a custom {@linkcode ExtensionDecoder}.
|
|
553
|
+
*
|
|
554
|
+
* @param extensions Extension list to search.
|
|
555
|
+
* @param decoder Decoder whose OID will be matched.
|
|
556
|
+
* @returns The decoded value, or `undefined` if the extension is absent.
|
|
557
|
+
*/
|
|
456
558
|
declare function decodeExtension<TValue>(extensions: readonly ParsedExtension[], decoder: ExtensionDecoder<TValue>): TValue | undefined;
|
|
457
559
|
/**
|
|
458
|
-
* Decode all matching extensions using an array of {@linkcode ExtensionDecoder}s.
|
|
459
|
-
*
|
|
460
|
-
* @param extensions Extension list to search.
|
|
461
|
-
* @param decoders Decoders to apply. Only matching OIDs produce output.
|
|
462
|
-
*/
|
|
560
|
+
* Decode all matching extensions using an array of {@linkcode ExtensionDecoder}s.
|
|
561
|
+
*
|
|
562
|
+
* @param extensions Extension list to search.
|
|
563
|
+
* @param decoders Decoders to apply. Only matching OIDs produce output.
|
|
564
|
+
*/
|
|
463
565
|
declare function decodeExtensions(extensions: readonly ParsedExtension[], decoders: readonly ExtensionDecoder<unknown>[]): readonly DecodedExtensionValue<unknown>[];
|
|
464
566
|
/**
|
|
465
|
-
* Decode all matching extensions using a named {@linkcode ExtensionDecoderMap}.
|
|
466
|
-
*
|
|
467
|
-
* @param extensions Extension list to search.
|
|
468
|
-
* @param decoderMap Named decoders. Results are keyed by the same map keys.
|
|
469
|
-
*/
|
|
567
|
+
* Decode all matching extensions using a named {@linkcode ExtensionDecoderMap}.
|
|
568
|
+
*
|
|
569
|
+
* @param extensions Extension list to search.
|
|
570
|
+
* @param decoderMap Named decoders. Results are keyed by the same map keys.
|
|
571
|
+
*/
|
|
470
572
|
declare function decodeExtensionMap<TMap extends ExtensionDecoderMap>(extensions: readonly ParsedExtension[], decoderMap: TMap): DecodedExtensionMap<TMap>;
|
|
471
573
|
//#endregion
|
|
472
|
-
export { DecodedExtensionMap, DecodedExtensionValue, ExtensionDecoder, ExtensionDecoderMap, ParseCertificateErrorCode, ParseCertificateFailure, ParseCertificateResult, ParseCertificateSigningRequestErrorCode, ParseCertificateSigningRequestFailure, ParseCertificateSigningRequestResult, ParseOptions, type ParsedBitFlags, ParsedCertificate, ParsedCertificateSigningRequest, ParsedDistributionPoint, ParsedDistributionPointName, ParsedExtension, ParsedIssuingDistributionPoint, ParsedName, ParsedNameAttribute, ParsedRelativeDistinguishedName, decodeExtension, decodeExtensionMap, decodeExtensions, defineExtensionDecoder, defineExtensionDecoderMap, findExtension, getSubjectPublicKey, getSubjectPublicKeyOrThrow, parseCertificateChainPem, parseCertificateDer, parseCertificateDerOrThrow, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow };
|
|
574
|
+
export { DecodedExtensionMap, DecodedExtensionValue, ExtensionDecoder, ExtensionDecoderMap, MatchCertificatePrivateKeyErrorCode, MatchCertificatePrivateKeyFailure, MatchCertificatePrivateKeyFailureResult, MatchCertificatePrivateKeyResult, MatchCertificatePrivateKeySuccess, ParseCertificateErrorCode, ParseCertificateFailure, ParseCertificateResult, ParseCertificateSigningRequestErrorCode, ParseCertificateSigningRequestFailure, ParseCertificateSigningRequestResult, ParseOptions, type ParsedBitFlags, 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 };
|
|
575
|
+
//# sourceMappingURL=parse.d.ts.map
|