micro509 0.17.0 → 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 +123 -6
- package/README.md +3 -0
- 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-arithmetic.js +15 -0
- package/dist/kdf/argon2-arithmetic.js.map +1 -0
- package/dist/kdf/argon2-core.js +486 -0
- package/dist/kdf/argon2-core.js.map +1 -0
- package/dist/kdf/argon2-memory.js +20 -0
- package/dist/kdf/argon2-memory.js.map +1 -0
- package/dist/kdf/argon2-portable.js +18 -0
- package/dist/kdf/argon2-portable.js.map +1 -0
- package/dist/kdf/argon2.d.ts +22 -11
- package/dist/kdf/argon2.js +32 -13
- package/dist/kdf/argon2.js.map +1 -1
- 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 +27 -34
- package/dist/internal/asn1/oids2.js +0 -75
- package/dist/internal/asn1/oids2.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DecodeRefusalCode, Result } from "../result/result.js";
|
|
2
|
-
import { ParsedCertificate } from "../x509/parse.js";
|
|
3
2
|
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 "./crl.js";
|
|
4
3
|
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 "./ocsp.js";
|
|
4
|
+
import { ParsedCertificate } from "../x509/parse.js";
|
|
5
5
|
/** Unified revocation outcome across CRL and OCSP evidence. */
|
|
6
6
|
export type RevocationStatus = "good" | "revoked" | "indeterminate";
|
|
7
7
|
/** Which revocation mechanism produced the evidence. */
|
|
@@ -177,5 +177,4 @@ export declare function resolveOcspResponderCandidates(input: ResolveOcspRespond
|
|
|
177
177
|
* ```
|
|
178
178
|
*/
|
|
179
179
|
export declare function checkCertificateRevocation(input: CheckCertificateRevocationInput): Promise<CheckCertificateRevocationResult>;
|
|
180
|
-
export type { CertificateRevocationListMaterial, CheckCertificateRevocationAgainstCrlErrorCode, CheckCertificateRevocationAgainstCrlFailure, CheckCertificateRevocationAgainstCrlFailureDetails, CheckCertificateRevocationAgainstCrlGoodValue, CheckCertificateRevocationAgainstCrlInput, CheckCertificateRevocationAgainstCrlResult, CheckCertificateRevocationAgainstCrlRevokedValue, CheckCertificateRevocationAgainstCrlValue, CreateCertificateRevocationListInput, CreateOcspCertStatusInput, CreateOcspRequestInput, CreateOcspRequestItemInput, CreateOcspResponseInput, CreateOcspSingleResponseInput, CrlApplicabilityFailureReason, CrlCertificateSource, CrlEncoderErrorCode, CrlSource, OcspCertStatus, OcspCertificateSource, OcspEncoderErrorCode, OcspHashAlgorithm, OcspRequestMaterial, OcspRequestSource, OcspResponderRevocationPolicy, OcspResponseMaterial, OcspResponseStatus, ParseCertificateRevocationListErrorCode, ParseCertificateRevocationListFailure, ParseCertificateRevocationListResult, ParseOcspRequestErrorCode, ParseOcspRequestFailure, ParseOcspRequestResult, ParseOcspResponseErrorCode, ParseOcspResponseFailure, ParseOcspResponseResult, ParsedCertificateRevocationList, ParsedOcspCertId, ParsedOcspCertStatus, ParsedOcspRequest, ParsedOcspResponderId, ParsedOcspResponse, ParsedOcspSingleResponse, ParsedRevocationReason, ParsedRevokedCertificate, RevocationReason, RevokedCertificateInput, UnrecognizedReasonCodePolicy, UnrecognizedRevocationReason, ValidateCertificateRevocationListFailure, ValidateCertificateRevocationListInput, ValidateCertificateRevocationListResult, ValidateOcspResponseErrorCode, ValidateOcspResponseFailure, ValidateOcspResponseInput, ValidateOcspResponseResult, VerifyCertificateRevocationListSignatureFailure, VerifyCertificateRevocationListSignatureResult, VerifyOcspResponseSignatureFailure, VerifyOcspResponseSignatureResult, checkCertificateRevocationAgainstCrl, createCertificateRevocationList, createOcspRequest, createOcspResponse, hasOcspNoCheckExtension, isCertificateRevoked, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, revocationReasonFromCode, validateCertificateRevocationList, validateOcspResponse, verifyCertificateRevocationListSignature, verifyOcspResponseSignature };
|
|
181
|
-
//# sourceMappingURL=revocation.d.ts.map
|
|
180
|
+
export type { CertificateRevocationListMaterial, CheckCertificateRevocationAgainstCrlErrorCode, CheckCertificateRevocationAgainstCrlFailure, CheckCertificateRevocationAgainstCrlFailureDetails, CheckCertificateRevocationAgainstCrlGoodValue, CheckCertificateRevocationAgainstCrlInput, CheckCertificateRevocationAgainstCrlResult, CheckCertificateRevocationAgainstCrlRevokedValue, CheckCertificateRevocationAgainstCrlValue, CreateCertificateRevocationListInput, CreateOcspCertStatusInput, CreateOcspRequestInput, CreateOcspRequestItemInput, CreateOcspResponseInput, CreateOcspSingleResponseInput, CrlApplicabilityFailureReason, CrlCertificateSource, CrlEncoderErrorCode, CrlSource, OcspCertStatus, OcspCertificateSource, OcspEncoderErrorCode, OcspHashAlgorithm, OcspRequestMaterial, OcspRequestSource, OcspResponderRevocationPolicy, OcspResponseMaterial, OcspResponseStatus, ParseCertificateRevocationListErrorCode, ParseCertificateRevocationListFailure, ParseCertificateRevocationListResult, ParseOcspRequestErrorCode, ParseOcspRequestFailure, ParseOcspRequestResult, ParseOcspResponseErrorCode, ParseOcspResponseFailure, ParseOcspResponseResult, ParsedCertificateRevocationList, ParsedOcspCertId, ParsedOcspCertStatus, ParsedOcspRequest, ParsedOcspResponderId, ParsedOcspResponse, ParsedOcspSingleResponse, ParsedRevocationReason, ParsedRevokedCertificate, RevocationReason, RevokedCertificateInput, UnrecognizedReasonCodePolicy, UnrecognizedRevocationReason, ValidateCertificateRevocationListFailure, ValidateCertificateRevocationListInput, ValidateCertificateRevocationListResult, ValidateOcspResponseErrorCode, ValidateOcspResponseFailure, ValidateOcspResponseInput, ValidateOcspResponseResult, VerifyCertificateRevocationListSignatureFailure, VerifyCertificateRevocationListSignatureResult, VerifyOcspResponseSignatureFailure, VerifyOcspResponseSignatureResult, checkCertificateRevocationAgainstCrl, createCertificateRevocationList, createOcspRequest, createOcspResponse, hasOcspNoCheckExtension, isCertificateRevoked, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, revocationReasonFromCode, validateCertificateRevocationList, validateOcspResponse, verifyCertificateRevocationListSignature, verifyOcspResponseSignature };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { decodeRefusalOf as e } from "../internal/asn1/decode-refusal.js";
|
|
2
|
+
import { DECODE_REFUSAL_CODES as t, rethrowIfInvariant as n } from "../result/result.js";
|
|
3
|
+
import { assertCrlMaxAge as r, checkCertificateRevocationAgainstCrl as i, coversAllDistributionPointReasons as a, revocationReasonFromCode as o } from "./crl.js";
|
|
4
|
+
import { validateOcspResponse as s } from "./ocsp.js";
|
|
5
|
+
import { parseCertificateDerOrThrow as c, parseCertificateFromSource as l } from "../x509/parse.js";
|
|
6
6
|
// src/revocation/revocation.ts
|
|
7
7
|
/**
|
|
8
8
|
* Revocation orchestration: evaluates CRL and OCSP evidence to produce a
|
|
@@ -92,7 +92,7 @@ function resolveOcspResponderCandidates(e) {
|
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
94
|
async function checkCertificateRevocation(e) {
|
|
95
|
-
|
|
95
|
+
r(e.crlMaxAgeMs);
|
|
96
96
|
let t = e.evidence ?? [], n = t.map((e) => e.kind);
|
|
97
97
|
if (t.length === 0) return revocationSuccess({
|
|
98
98
|
status: "indeterminate",
|
|
@@ -103,30 +103,30 @@ async function checkCertificateRevocation(e) {
|
|
|
103
103
|
indeterminateEvidence: []
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
let
|
|
106
|
+
let i;
|
|
107
107
|
try {
|
|
108
|
-
|
|
108
|
+
i = normalizeCertificate(e.certificate);
|
|
109
109
|
} catch (e) {
|
|
110
110
|
return undecodableCertificateResult(e, n);
|
|
111
111
|
}
|
|
112
|
-
let
|
|
112
|
+
let a, o, s = /* @__PURE__ */ new Set(), c = [];
|
|
113
113
|
for (let n of t) {
|
|
114
|
-
let t = await checkRevocationEvidenceEntry(e, n,
|
|
114
|
+
let t = await checkRevocationEvidenceEntry(e, n, i);
|
|
115
115
|
if (t.status === "revoked") return revocationSuccess(t.result);
|
|
116
116
|
if (t.status === "good") {
|
|
117
|
-
if (t.coveredReasons === void 0)
|
|
117
|
+
if (t.coveredReasons === void 0) a ??= t.result;
|
|
118
118
|
else {
|
|
119
119
|
o ??= t.result;
|
|
120
120
|
for (let e of t.coveredReasons) s.add(e);
|
|
121
121
|
}
|
|
122
122
|
} else c.push(t.detail);
|
|
123
123
|
}
|
|
124
|
-
return settleRevocationEvidence(
|
|
124
|
+
return settleRevocationEvidence(a, o, s, c, n);
|
|
125
125
|
}
|
|
126
126
|
/** The result once no evidence revoked the certificate outright. */
|
|
127
127
|
function settleRevocationEvidence(e, t, n, r, i) {
|
|
128
|
-
let
|
|
129
|
-
return e !== void 0 && !
|
|
128
|
+
let o = r.some((e) => e.code === "reason_code_unrecognized");
|
|
129
|
+
return e !== void 0 && !o ? revocationSuccess(e) : t !== void 0 && !o && a(n) ? revocationSuccess(t) : (t !== void 0 && !a(n) && r.push({
|
|
130
130
|
kind: "crl",
|
|
131
131
|
code: "reason_coverage_incomplete",
|
|
132
132
|
message: "CRL evidence covers only some revocation reasons"
|
|
@@ -140,8 +140,8 @@ function settleRevocationEvidence(e, t, n, r, i) {
|
|
|
140
140
|
}
|
|
141
141
|
}));
|
|
142
142
|
}
|
|
143
|
-
function undecodableCertificateResult(
|
|
144
|
-
let i = n
|
|
143
|
+
function undecodableCertificateResult(n, r) {
|
|
144
|
+
let i = e(n, t);
|
|
145
145
|
return revocationSuccess({
|
|
146
146
|
status: "indeterminate",
|
|
147
147
|
code: i?.code ?? "revocation_status_indeterminate",
|
|
@@ -156,8 +156,8 @@ async function checkRevocationEvidenceEntry(r, i, a) {
|
|
|
156
156
|
try {
|
|
157
157
|
return i.kind === "crl" ? await checkCertificateRevocationWithCrl(r, i, a) : await checkCertificateRevocationWithOcsp(r, i, a);
|
|
158
158
|
} catch (r) {
|
|
159
|
-
|
|
160
|
-
let a =
|
|
159
|
+
n(r);
|
|
160
|
+
let a = e(r, t);
|
|
161
161
|
return {
|
|
162
162
|
status: "indeterminate",
|
|
163
163
|
detail: {
|
|
@@ -170,7 +170,7 @@ async function checkRevocationEvidenceEntry(r, i, a) {
|
|
|
170
170
|
}
|
|
171
171
|
/** Evaluates a single CRL evidence entry via {@linkcode checkCertificateRevocationAgainstCrl}. */
|
|
172
172
|
async function checkCertificateRevocationWithCrl(e, t, n) {
|
|
173
|
-
let r = await
|
|
173
|
+
let r = await i({
|
|
174
174
|
certificate: n,
|
|
175
175
|
issuerCertificate: e.issuerCertificate,
|
|
176
176
|
crl: t.crl,
|
|
@@ -209,7 +209,7 @@ async function checkCertificateRevocationWithCrl(e, t, n) {
|
|
|
209
209
|
}
|
|
210
210
|
/** Evaluates a single OCSP evidence entry via {@linkcode validateOcspResponse}. */
|
|
211
211
|
async function checkCertificateRevocationWithOcsp(e, t, n) {
|
|
212
|
-
let r = await
|
|
212
|
+
let r = await s({
|
|
213
213
|
response: t.response,
|
|
214
214
|
issuerCertificate: e.issuerCertificate,
|
|
215
215
|
...t.request === void 0 ? {} : { request: t.request },
|
|
@@ -234,7 +234,7 @@ async function checkCertificateRevocationWithOcsp(e, t, n) {
|
|
|
234
234
|
code: "certificate_status_missing",
|
|
235
235
|
message: "OCSP response does not include certificate status for the target certificate"
|
|
236
236
|
}
|
|
237
|
-
} : i.certStatus === "revoked" ? e.unrecognizedReasonCode === "reject" && typeof
|
|
237
|
+
} : i.certStatus === "revoked" ? e.unrecognizedReasonCode === "reject" && typeof o(i.revocationReasonCode) == "object" ? {
|
|
238
238
|
status: "indeterminate",
|
|
239
239
|
detail: {
|
|
240
240
|
kind: "ocsp",
|
|
@@ -268,7 +268,7 @@ async function checkCertificateRevocationWithOcsp(e, t, n) {
|
|
|
268
268
|
}
|
|
269
269
|
/** Accepts PEM, DER, or already-parsed certificate and returns a parsed certificate. */
|
|
270
270
|
function normalizeCertificate(e) {
|
|
271
|
-
return hasParsedCertificateShape(e) ?
|
|
271
|
+
return hasParsedCertificateShape(e) ? c(new Uint8Array(e.der)) : l(e);
|
|
272
272
|
}
|
|
273
273
|
function hasParsedCertificateShape(e) {
|
|
274
274
|
return typeof e != "string" && "subjectPublicKeyInfoDer" in e;
|
package/dist/revocation.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Create and validate CRLs and OCSP responses, then check certificate status.
|
|
3
|
+
*
|
|
4
|
+
* Use {@linkcode checkCertificateRevocation} with evidence your application
|
|
5
|
+
* supplies. Create evidence with {@linkcode createCertificateRevocationList}
|
|
6
|
+
* or {@linkcode createOcspResponse}. Network retrieval belongs to the caller.
|
|
7
|
+
*
|
|
8
|
+
* @module micro509/revocation
|
|
9
|
+
*/
|
|
10
|
+
import { CertificateRevocationStatus, CheckChainRevocationInput, CheckChainRevocationResult, CheckChainRevocationValue, OcspResponseSource, REVOCATION_INDETERMINATE_REASONS, RevocationExecutionError, RevocationIndeterminateReason, RevocationParseError, RevocationPolicy, RevocationProcessingError, RevocationSource, TrustedOcspResponder, checkChainRevocation } from "./revocation/chain.js";
|
|
3
11
|
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";
|
|
4
12
|
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";
|
|
5
13
|
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";
|
|
6
|
-
import {
|
|
14
|
+
import { IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts } from "./x509/extensions.js";
|
|
15
|
+
import { ParsedIssuingDistributionPoint, ParsedIssuingDistributionPointBase, ParsedIssuingDistributionPointScope } from "./x509/parse.js";
|
|
7
16
|
export { type CertificateRevocationListMaterial, type CertificateRevocationStatus, 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 CreateCertificateRevocationListInput, type CreateOcspCertStatusInput, type CreateOcspRequestInput, type CreateOcspRequestItemInput, type CreateOcspResponseInput, type CreateOcspSingleResponseInput, type CrlApplicabilityFailureReason, type CrlCertificateSource, type CrlEncoderErrorCode, type CrlSource, type IssuingDistributionPoint, type IssuingDistributionPointBase, type IssuingDistributionPointForAttributeCerts, type IssuingDistributionPointForCaCerts, type IssuingDistributionPointForUserCerts, 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 ParseCertificateRevocationListErrorCode, type ParseCertificateRevocationListFailure, type ParseCertificateRevocationListResult, type ParseOcspRequestErrorCode, type ParseOcspRequestFailure, type ParseOcspRequestResult, type ParseOcspResponseErrorCode, type ParseOcspResponseFailure, type ParseOcspResponseResult, type ParsedCertificateRevocationList, type ParsedIssuingDistributionPoint, type ParsedIssuingDistributionPointBase, type ParsedIssuingDistributionPointScope, type ParsedOcspCertId, type ParsedOcspCertStatus, type ParsedOcspRequest, type ParsedOcspResponderId, type ParsedOcspResponse, type ParsedOcspSingleResponse, type ParsedRevocationReason, type ParsedRevokedCertificate, REVOCATION_INDETERMINATE_REASONS, REVOCATION_INDETERMINATE_REASON_CODES, type ResolveOcspResponderCandidatesInput, 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 TrustedOcspResponder, type UnrecognizedReasonCodePolicy, type UnrecognizedRevocationReason, type ValidateCertificateRevocationListFailure, type ValidateCertificateRevocationListInput, type ValidateCertificateRevocationListResult, type ValidateOcspResponseErrorCode, type ValidateOcspResponseFailure, type ValidateOcspResponseInput, type ValidateOcspResponseResult, type VerifyCertificateRevocationListSignatureFailure, type VerifyCertificateRevocationListSignatureResult, type VerifyOcspResponseSignatureFailure, type VerifyOcspResponseSignatureResult, checkCertificateRevocation, checkCertificateRevocationAgainstCrl, checkChainRevocation, createCertificateRevocationList, createOcspRequest, createOcspResponse, getCertificateOcspResponderUris, hasOcspNoCheckExtension, isCertificateRevoked, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, resolveOcspResponderCandidates, revocationReasonFromCode, validateCertificateRevocationList, validateOcspResponse, verifyCertificateRevocationListSignature, verifyOcspResponseSignature };
|
package/dist/revocation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { REVOCATION_INDETERMINATE_REASONS as e, checkChainRevocation as t } from "./revocation/chain.js";
|
|
2
|
+
import { checkCertificateRevocationAgainstCrl as n, createCertificateRevocationList as r, isCertificateRevoked as i, parseCertificateRevocationListDer as a, parseCertificateRevocationListDerOrThrow as o, parseCertificateRevocationListPem as s, parseCertificateRevocationListPemOrThrow as c, revocationReasonFromCode as l, validateCertificateRevocationList as u, verifyCertificateRevocationListSignature as d } from "./revocation/crl.js";
|
|
3
|
+
import { createOcspRequest as f, createOcspResponse as p, hasOcspNoCheckExtension as m, parseOcspRequestDer as h, parseOcspRequestDerOrThrow as g, parseOcspRequestPem as _, parseOcspRequestPemOrThrow as v, parseOcspResponseDer as y, parseOcspResponseDerOrThrow as b, parseOcspResponsePem as x, parseOcspResponsePemOrThrow as S, validateOcspResponse as C, verifyOcspResponseSignature as w } from "./revocation/ocsp.js";
|
|
4
4
|
import { REVOCATION_INDETERMINATE_REASON_CODES as T, checkCertificateRevocation as E, getCertificateOcspResponderUris as D, resolveOcspResponderCandidates as O } from "./revocation/revocation.js";
|
|
5
|
-
export {
|
|
5
|
+
export { e as REVOCATION_INDETERMINATE_REASONS, T as REVOCATION_INDETERMINATE_REASON_CODES, E as checkCertificateRevocation, n as checkCertificateRevocationAgainstCrl, t as checkChainRevocation, r as createCertificateRevocationList, f as createOcspRequest, p as createOcspResponse, D as getCertificateOcspResponderUris, m as hasOcspNoCheckExtension, i as isCertificateRevoked, a as parseCertificateRevocationListDer, o as parseCertificateRevocationListDerOrThrow, s as parseCertificateRevocationListPem, c as parseCertificateRevocationListPemOrThrow, h as parseOcspRequestDer, g as parseOcspRequestDerOrThrow, _ as parseOcspRequestPem, v as parseOcspRequestPemOrThrow, y as parseOcspResponseDer, b as parseOcspResponseDerOrThrow, x as parseOcspResponsePem, S as parseOcspResponsePemOrThrow, O as resolveOcspResponderCandidates, l as revocationReasonFromCode, u as validateCertificateRevocationList, C as validateOcspResponse, d as verifyCertificateRevocationListSignature, w as verifyOcspResponseSignature };
|
package/dist/ssh/ssh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ErrorResult, Micro509Error } from "../result/result.js";
|
|
2
1
|
import { EcNamedCurve, RsaHash, RsaSignatureScheme } from "../keys/keys.js";
|
|
2
|
+
import { ErrorResult, Micro509Error } from "../result/result.js";
|
|
3
3
|
import { SshErrorCode } from "./wire.js";
|
|
4
4
|
/** SSH public-key type names (RFC 4253 §6.6, RFC 5656 §6.2, RFC 8709 §4) this module reads and writes. */
|
|
5
5
|
export type SshKeyType = "ssh-rsa" | "ssh-ed25519" | "ecdsa-sha2-nistp256" | "ecdsa-sha2-nistp384" | "ecdsa-sha2-nistp521";
|
|
@@ -196,5 +196,4 @@ export declare function exportOpenSshPrivateKey(privateKey: CryptoKey, options?:
|
|
|
196
196
|
* @throws {ResultError} Carrying an {@linkcode SshExportErrorCode} when a `CryptoKey` cannot be encoded
|
|
197
197
|
*/
|
|
198
198
|
export declare function sshFingerprintSha256(key: CryptoKey | Uint8Array): Promise<string>;
|
|
199
|
-
export type { SshErrorCode };
|
|
200
|
-
//# sourceMappingURL=ssh.d.ts.map
|
|
199
|
+
export type { SshErrorCode };
|