micro509 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +130 -1
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +3 -3
  4. package/dist/internal/jose/base64url.js +40 -0
  5. package/dist/internal/jose/base64url.js.map +1 -0
  6. package/dist/internal/jose/strict-json.d.ts +9 -0
  7. package/dist/internal/jose/strict-json.js +155 -0
  8. package/dist/internal/jose/strict-json.js.map +1 -0
  9. package/dist/internal/verify/spki-distrust.js +23 -0
  10. package/dist/internal/verify/spki-distrust.js.map +1 -0
  11. package/dist/internal/verify/verify-path.js +77 -60
  12. package/dist/internal/verify/verify-path.js.map +1 -1
  13. package/dist/jose/errors.d.ts +44 -0
  14. package/dist/jose/errors.js +11 -0
  15. package/dist/jose/errors.js.map +1 -0
  16. package/dist/jose/jwks.d.ts +93 -0
  17. package/dist/jose/jwks.js +193 -0
  18. package/dist/jose/jwks.js.map +1 -0
  19. package/dist/jose/jws.d.ts +158 -0
  20. package/dist/jose/jws.js +362 -0
  21. package/dist/jose/jws.js.map +1 -0
  22. package/dist/jose/jwt.d.ts +91 -0
  23. package/dist/jose/jwt.js +187 -0
  24. package/dist/jose/jwt.js.map +1 -0
  25. package/dist/jose/remote-jwks.d.ts +95 -0
  26. package/dist/jose/remote-jwks.js +298 -0
  27. package/dist/jose/remote-jwks.js.map +1 -0
  28. package/dist/jose.d.ts +7 -0
  29. package/dist/jose.js +5 -0
  30. package/dist/kdf/argon2.d.ts +78 -0
  31. package/dist/kdf/argon2.js +167 -0
  32. package/dist/kdf/argon2.js.map +1 -0
  33. package/dist/kdf.d.ts +2 -0
  34. package/dist/kdf.js +1 -0
  35. package/dist/keys/keys.d.ts +11 -8
  36. package/dist/keys/keys.js.map +1 -1
  37. package/dist/revocation/crl.js +2 -7
  38. package/dist/revocation/crl.js.map +1 -1
  39. package/dist/ssh/ssh.d.ts +200 -0
  40. package/dist/ssh/ssh.js +648 -0
  41. package/dist/ssh/ssh.js.map +1 -0
  42. package/dist/ssh/wire.d.ts +3 -0
  43. package/dist/ssh/wire.js +105 -0
  44. package/dist/ssh/wire.js.map +1 -0
  45. package/dist/ssh.d.ts +3 -0
  46. package/dist/ssh.js +1 -0
  47. package/dist/verify/verify.d.ts +32 -1
  48. package/dist/verify/verify.js +100 -58
  49. package/dist/verify/verify.js.map +1 -1
  50. package/dist/x509/fingerprint.d.ts +11 -0
  51. package/dist/x509/fingerprint.js +19 -1
  52. package/dist/x509/fingerprint.js.map +1 -1
  53. package/dist/x509.d.ts +2 -2
  54. package/dist/x509.js +3 -3
  55. package/package.json +20 -6
package/CHANGELOG.md CHANGED
@@ -19,6 +19,133 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
19
 
20
20
  ## [Unreleased]
21
21
 
22
+ ## [0.17.0] - 2026-10-25
23
+
24
+ Work with OpenSSH keys, derive encryption keys with Argon2, and sign and verify
25
+ JWTs with local or remote JWK Sets. Three optional entrypoints extend micro509
26
+ beyond certificate workflows: `micro509/ssh`, `micro509/kdf` and `micro509/jose`.
27
+
28
+ The new guides follow complete workflows with runnable examples, inspectable
29
+ key material and returned verification results. Navigation distinguishes PR
30
+ previews from published versions and makes the version list usable on mobile.
31
+
32
+ ### Added
33
+
34
+ - `micro509/ssh` entrypoint for OpenSSH key material: public-key lines
35
+ (`importSshPublicKey`, `exportSshPublicKey`), unencrypted single-key
36
+ `openssh-key-v1` private files (`importOpenSshPrivateKey`,
37
+ `exportOpenSshPrivateKey`) and `SHA256:` fingerprints
38
+ (`sshFingerprintSha256`) for RSA, Ed25519 and ECDSA P-256/P-384/P-521.
39
+ Imports check the private key against its embedded public key, bound input
40
+ sizes and RSA moduli, and return typed `malformed`, `unsupported`,
41
+ `limit_exceeded` and `key_mismatch` results. Encrypted files and files with
42
+ several keys return `unsupported`. `minRsaModulusBits` and
43
+ `acceptCompressedEcPoints` expose the choices the standards leave open.
44
+ [#190](https://github.com/kjanat/micro509/issues/190)
45
+ - Optional `micro509/kdf` entrypoint for Argon2id and Argon2d raw key
46
+ derivation, with explicit versions, per-call resource limits and typed
47
+ failures. The native WebCrypto adapter supports version `0x13` on
48
+ compatible runtimes. An explicit backend callback supports separately
49
+ installed implementations, including legacy `0x10` handling.
50
+ [#189](https://github.com/kjanat/micro509/issues/189)
51
+ - **Verify JWTs with `micro509/jose`.** The optional entrypoint signs and
52
+ verifies compact JWS and JWT with RS256 and returns typed failures. Callers
53
+ state the algorithm list, token type, issuer and audience; `exp` is required
54
+ by default, and `iat`, `nbf`, maximum age and clock tolerance are checked
55
+ against a caller-supplied clock. Parsing rejects non-canonical base64url,
56
+ invalid UTF-8, duplicate members, `crit`, `b64: false` and nested JWTs, and
57
+ bounds token, header, payload and JSON size. `VerifiedJwt` and `UnverifiedJwt`
58
+ are separate types. [#148](https://github.com/kjanat/micro509/issues/148)
59
+ - **Select keys from a JWK Set.** `parseJwks`, `selectJwk` and
60
+ `createJwksKeyResolver` match `kid`, key type, `use`, `key_ops` and `alg`, and
61
+ reject ambiguous matches.
62
+ - **Read a JWK Set from a trusted URL.** `createRemoteJwksKeyResolver` is
63
+ opt-in and keeps a cache per source. It bounds timeout, streamed bytes, key
64
+ count and redirects, shares concurrent fetches, refreshes at most once per
65
+ cooldown, enforces its deadline even when a transport ignores cancellation,
66
+ and never reuses an expired set after a failed refresh.
67
+
68
+ ### Changed
69
+
70
+ - **Follow complete SSH, Argon2 and JWT workflows.** The SSH guide uses one
71
+ key through import, conversion, export and fingerprint comparison. The
72
+ Argon2 guide derives an encryption key, saves the salt and parameters, and
73
+ derives it again to decrypt. The JWT guide verifies the same token with a
74
+ direct key, local JWKS and remote resolver, then demonstrates rejection for
75
+ the wrong audience. Short sidebar labels link to descriptive articles and
76
+ their API references. [#201](https://github.com/kjanat/micro509/pull/201)
77
+
78
+ ### Fixed
79
+
80
+ - Multiline LiveCode output, including PEM keys and JSON, starts below its
81
+ label so readers can inspect and copy complete blocks.
82
+ - Mobile navigation uses compact rows and an inline version list that expands
83
+ like VitePress's own screen-menu groups, scrolling with the menu instead of
84
+ inside a nested box. The version button toggles the list, and Escape or an
85
+ outside click closes it. Desktop version lists scroll within the viewport,
86
+ and the navbar's overflow menu renders both as flat panel rows.
87
+ [#188](https://github.com/kjanat/micro509/issues/188)
88
+ - PR previews have a separate version entry alongside production's `next` and
89
+ release entries. Switching from a preview opens the matching production page.
90
+ - The version list shows one entry per release instead of one per published
91
+ base, so the latest release no longer appears twice, and it reads in
92
+ timeline order: this preview, `next`, the latest release, then the archives.
93
+ Entries without a version number say which channel they are.
94
+
95
+ ## [0.16.0] - 2026-10-24
96
+
97
+ Block a compromised public key across every certificate that carries it,
98
+ including certificates cross-signed by different CAs. This release adds
99
+ SPKI-based distrust to chain verification, tightens indirect CRL issuer
100
+ matching, and reports the certificate responsible for a revocation failure.
101
+
102
+ It also adds explicit SHA-1 RSA-OAEP imports for legacy Bitwarden envelopes
103
+ and restores individual API reference pages with versioned documentation.
104
+
105
+ ### Added
106
+
107
+ - **Distrust compromised keys across certificate paths.** Supply SHA-256 SPKI
108
+ fingerprints through `distrustedSpkiSha256` to reject a key in a leaf,
109
+ intermediate, or trust anchor with `public_key_distrusted`. The same entry
110
+ covers certificates sharing that key across alternative cross-signed paths.
111
+ `subjectPublicKeyInfoFingerprint` computes the fingerprint from a
112
+ certificate and returns bytes, lowercase hex, and colon-separated hex.
113
+ Applications supply their own distrust list. [#178](https://github.com/kjanat/micro509/pull/178)
114
+ - **Import legacy RSA-OAEP keys.** Explicit RSA-OAEP imports accept
115
+ `hash: 'SHA-1'`, including keys for Bitwarden type 4 organization envelopes.
116
+ SHA-256 is the default. RSA signature imports and key generation accept
117
+ SHA-2 hashes. [#180](https://github.com/kjanat/micro509/issues/180)
118
+
119
+ ### Changed
120
+
121
+ - **Browse API documentation by symbol and version.** Functions, types, and
122
+ variables have dedicated pages at `/api/fn/`, `/api/type/`, and `/api/var/`.
123
+ The version switcher links to pages available in each snapshot. Algorithm
124
+ documentation distinguishes certificate parsing, key import, generation,
125
+ and signature verification support.
126
+ [#56](https://github.com/kjanat/micro509/issues/56),
127
+ [#179](https://github.com/kjanat/micro509/pull/179)
128
+ - **Read released and development docs separately.** The site root serves the
129
+ latest release, `/next/` follows master, and `/vX.Y.Z/` provides release
130
+ snapshots. Publishing updates the affected version without rebuilding every
131
+ archive. [#60](https://github.com/kjanat/micro509/issues/60)
132
+
133
+ ### Fixed
134
+
135
+ - **Reject incorrect indirect CRL issuer identities.** Every `cRLIssuer` entry
136
+ must be a `directoryName` with the exact DER encoding of the CRL issuer,
137
+ as required by RFC 5280 §4.2.1.13. A matching name alongside a URI or another
138
+ issuer no longer makes the CRL applicable. Equivalent names with different
139
+ DER encodings are also rejected. [#13](https://github.com/kjanat/micro509/issues/13)
140
+ - **Identify the certificate behind revocation failures.** Chain verification
141
+ reports the certificate index for revoked and indeterminate results,
142
+ including failures on intermediate certificates.
143
+ - **Serve the published docs tree in production.** Both build entrypoints
144
+ select the versioned publication. Deployment rejects preview-only output
145
+ and waits for the exact publication identifier and its documentation routes
146
+ to appear on the live site. An older deployment with an identical version
147
+ catalog cannot satisfy that check. [#185](https://github.com/kjanat/micro509/pull/185)
148
+
22
149
  ## [0.15.0] - 2026-10-23
23
150
 
24
151
  Security fixes for revocation decisions, name constraints and service identity,
@@ -1901,7 +2028,9 @@ Initial prerelease. API may change before 1.0.
1901
2028
  - Zero runtime dependencies, WebCrypto-native, tree-shakeable subpath exports;
1902
2029
  runs on Node, Bun, Deno, browsers, and Cloudflare Workers.
1903
2030
 
1904
- [Unreleased]: https://github.com/kjanat/micro509/compare/v0.15.0...HEAD
2031
+ [Unreleased]: https://github.com/kjanat/micro509/compare/v0.17.0...HEAD
2032
+ [0.17.0]: https://github.com/kjanat/micro509/compare/v0.16.0...v0.17.0
2033
+ [0.16.0]: https://github.com/kjanat/micro509/compare/v0.15.0...v0.16.0
1905
2034
  [0.15.0]: https://github.com/kjanat/micro509/compare/v0.14.0...v0.15.0
1906
2035
  [0.14.0]: https://github.com/kjanat/micro509/compare/v0.13.0...v0.14.0
1907
2036
  [0.13.0]: https://github.com/kjanat/micro509/compare/v0.12.0...v0.13.0
package/dist/index.d.ts CHANGED
@@ -21,6 +21,6 @@ import { ConstrainedPolicy, PolicyValidationInput, PolicyValidationOutcome } fro
21
21
  import { isSelfIssued } from "./internal/verify/verify-path.js";
22
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
23
  import { CreateCsrInput, CsrMaterial, createCertificateSigningRequest } from "./x509/csr.js";
24
- import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint } from "./x509/fingerprint.js";
24
+ import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint, subjectPublicKeyInfoFingerprint } from "./x509/fingerprint.js";
25
25
  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, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
26
+ export { type AuthorityInformationAccess, type AuthorityInformationAccessInput, type BasicConstraints, type BuildCandidatePathInput, type BuildCandidatePathResult, type CandidatePath, type CategorizePemBlocksResult, type CategorizedPemBlocks, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CertificateRevocationListMaterial, type CertificateRevocationStatus, type CertificateSource, type ChainRevocationInput, type CheckCertificateRevocationAgainstCrlErrorCode, type CheckCertificateRevocationAgainstCrlFailure, type CheckCertificateRevocationAgainstCrlFailureDetails, type CheckCertificateRevocationAgainstCrlGoodValue, type CheckCertificateRevocationAgainstCrlInput, type CheckCertificateRevocationAgainstCrlResult, type CheckCertificateRevocationAgainstCrlRevokedValue, type CheckCertificateRevocationAgainstCrlValue, type CheckCertificateRevocationErrorCode, type CheckCertificateRevocationFailureDetails, type CheckCertificateRevocationInput, type CheckCertificateRevocationResult, type CheckCertificateRevocationValue, type CheckChainRevocationInput, type CheckChainRevocationResult, type CheckChainRevocationValue, type ConfiguredOcspResponder, type ConfiguredOcspResponderCertificate, type ConstrainedPolicy, type CreateCertificateErrorCode, type CreateCertificateInput, type CreateCertificateRevocationListInput, type CreateCsrInput, type CreateOcspCertStatusInput, type CreateOcspRequestInput, type CreateOcspRequestItemInput, type CreateOcspResponseInput, type CreateOcspSingleResponseInput, type CreatePfxErrorCode, type CreatePfxFailure, type CreatePfxInput, type CreatePfxResult, type 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 };
package/dist/index.js CHANGED
@@ -14,6 +14,6 @@ import { REVOCATION_INDETERMINATE_REASONS as Ot, checkChainRevocation as kt } fr
14
14
  import { REVOCATION_INDETERMINATE_REASON_CODES as At, checkCertificateRevocation as jt, getCertificateOcspResponderUris as Mt, resolveOcspResponderCandidates as Nt } from "./revocation/revocation.js";
15
15
  import { createCertificate as Pt, createSelfSignedCertificate as Ft } from "./x509/certificate.js";
16
16
  import { createCertificateSigningRequest as It } from "./x509/csr.js";
17
- import { certificateFingerprint as Lt } from "./x509/fingerprint.js";
18
- import { distinguishedNameToString as Rt, relativeDistinguishedNameToString as zt, subjectAltNameLabel as Bt, subjectAltNameToString as Vt } from "./x509/name-text.js";
19
- export { e as DECODE_REFUSAL_CODES, Ot as REVOCATION_INDETERMINATE_REASONS, At as REVOCATION_INDETERMINATE_REASON_CODES, it as VERIFY_ERROR_CODES, at as buildCandidatePath, i as categorizePemBlocks, a as categorizePemBlocksOrThrow, Lt as certificateFingerprint, fe as certificateMatchesPrivateKey, jt as checkCertificateRevocation, Ge as checkCertificateRevocationAgainstCrl, kt as checkChainRevocation, ot as checkExtendedKeyUsage, de as compareDistinguishedNames, Pt as createCertificate, Ke as createCertificateRevocationList, It as createCertificateSigningRequest, ht as createOcspRequest, gt as createOcspResponse, Fe as createPfx, Re as createPkcs7CertBag, ze as createPkcs7SignedData, Ft as createSelfSignedCertificate, pe as decodeExtension, me as decodeExtensionMap, he as decodeExtensions, d as decryptRsaOaep, f as decryptRsaOaepOrThrow, ge as defineExtensionDecoder, _e as defineExtensionDecoderMap, p as derivePublicKey, Rt as distinguishedNameToString, m as encryptRsaOaep, h as encryptRsaOaepOrThrow, g as exportBinaryBase64, _ as exportEncryptedPkcs1Pem, v as exportEncryptedPkcs8Der, y as exportEncryptedPkcs8Pem, b as exportEncryptedSec1Pem, x as exportPkcs1Der, S as exportPkcs1Pem, C as exportPkcs8Der, w as exportPkcs8Pem, T as exportPrivateJwk, E as exportPublicJwk, D as exportSec1Der, O as exportSec1Pem, k as exportSpkiDer, A as exportSpkiPem, ve as findExtension, j as generateKeyPair, Mt as getCertificateOcspResponderUris, ye as getSubjectPublicKey, be as getSubjectPublicKeyOrThrow, _t as hasOcspNoCheckExtension, M as importEncryptedPkcs1Pem, N as importEncryptedPkcs1PemOrThrow, P as importEncryptedPkcs8Der, F as importEncryptedPkcs8DerOrThrow, I as importEncryptedPkcs8Pem, L as importEncryptedPkcs8PemOrThrow, R as importEncryptedSec1Pem, z as importEncryptedSec1PemOrThrow, B as importPkcs1Der, V as importPkcs1DerOrThrow, H as importPkcs1Pem, U as importPkcs1PemOrThrow, W as importPkcs8Base64, G as importPkcs8Base64OrThrow, K as importPkcs8Der, q as importPkcs8DerOrThrow, J as importPkcs8Pem, Y as importPkcs8PemOrThrow, X as importPrivateJwk, Z as importPrivateJwkOrThrow, Q as importPublicJwk, $ as importPublicJwkOrThrow, ee as importSec1Der, te as importSec1DerOrThrow, ne as importSec1Pem, re as importSec1PemOrThrow, ie as importSpkiBase64, ae as importSpkiBase64OrThrow, oe as importSpkiDer, se as importSpkiDerOrThrow, ce as importSpkiPem, le as importSpkiPemOrThrow, ue as inspectEncryptedPkcs8Der, qe as isCertificateRevoked, t as isResultError, tt as isSelfIssuedCertificate, xe as matchCertificatePrivateKey, nt as matchCertificateServiceIdentity, rt as matchServiceIdentity, Se as parseCertificateChainPem, Ce as parseCertificateChainPemOrThrow, we as parseCertificateDer, Te as parseCertificateDerOrThrow, Ee as parseCertificateFromSource, De as parseCertificatePem, Oe as parseCertificatePemOrThrow, Je as parseCertificateRevocationListDer, Ye as parseCertificateRevocationListDerOrThrow, Xe as parseCertificateRevocationListPem, Ze as parseCertificateRevocationListPemOrThrow, ke as parseCertificateSigningRequestDer, Ae as parseCertificateSigningRequestDerOrThrow, je as parseCertificateSigningRequestPem, Me as parseCertificateSigningRequestPemOrThrow, Ne as parseCertificatesFromSource, Pe as parseDistinguishedNameDer, vt as parseOcspRequestDer, yt as parseOcspRequestDerOrThrow, bt as parseOcspRequestPem, xt as parseOcspRequestPemOrThrow, St as parseOcspResponseDer, Ct as parseOcspResponseDerOrThrow, wt as parseOcspResponsePem, Tt as parseOcspResponsePemOrThrow, Ie as parsePfxDer, Le as parsePfxPem, Be as parsePkcs7CertBagDer, Ve as parsePkcs7CertBagPem, He as parsePkcs7SignedDataDer, Ue as parsePkcs7SignedDataPem, o as pemDecode, s as pemDecodeOrThrow, c as pemEncode, zt as relativeDistinguishedNameToString, Nt as resolveOcspResponderCandidates, Qe as revocationReasonFromCode, l as splitPemBlocks, u as splitPemBlocksOrThrow, Bt as subjectAltNameLabel, Vt as subjectAltNameToString, st as trustAnchorFromCertificate, n as unwrap, r as unwrapOr, ct as validateCandidatePath, $e as validateCertificateRevocationList, lt as validateForCa, ut as validateForCodeSigning, dt as validateForTlsClient, ft as validateForTlsServer, Et as validateOcspResponse, pt as verifyCertificateChain, et as verifyCertificateRevocationListSignature, mt as verifyCertificateSigningRequest, Dt as verifyOcspResponseSignature, We as verifyPkcs7SignedData };
17
+ import { certificateFingerprint as Lt, subjectPublicKeyInfoFingerprint as Rt } from "./x509/fingerprint.js";
18
+ import { distinguishedNameToString as zt, relativeDistinguishedNameToString as Bt, subjectAltNameLabel as Vt, subjectAltNameToString as Ht } from "./x509/name-text.js";
19
+ export { e as DECODE_REFUSAL_CODES, Ot as REVOCATION_INDETERMINATE_REASONS, At as REVOCATION_INDETERMINATE_REASON_CODES, it as VERIFY_ERROR_CODES, at as buildCandidatePath, i as categorizePemBlocks, a as categorizePemBlocksOrThrow, Lt as certificateFingerprint, fe as certificateMatchesPrivateKey, jt as checkCertificateRevocation, Ge as checkCertificateRevocationAgainstCrl, kt as checkChainRevocation, ot as checkExtendedKeyUsage, de as compareDistinguishedNames, Pt as createCertificate, Ke as createCertificateRevocationList, It as createCertificateSigningRequest, ht as createOcspRequest, gt as createOcspResponse, Fe as createPfx, Re as createPkcs7CertBag, ze as createPkcs7SignedData, Ft as createSelfSignedCertificate, pe as decodeExtension, me as decodeExtensionMap, he as decodeExtensions, d as decryptRsaOaep, f as decryptRsaOaepOrThrow, ge as defineExtensionDecoder, _e as defineExtensionDecoderMap, p as derivePublicKey, zt as distinguishedNameToString, m as encryptRsaOaep, h as encryptRsaOaepOrThrow, g as exportBinaryBase64, _ as exportEncryptedPkcs1Pem, v as exportEncryptedPkcs8Der, y as exportEncryptedPkcs8Pem, b as exportEncryptedSec1Pem, x as exportPkcs1Der, S as exportPkcs1Pem, C as exportPkcs8Der, w as exportPkcs8Pem, T as exportPrivateJwk, E as exportPublicJwk, D as exportSec1Der, O as exportSec1Pem, k as exportSpkiDer, A as exportSpkiPem, ve as findExtension, j as generateKeyPair, Mt as getCertificateOcspResponderUris, ye as getSubjectPublicKey, be as getSubjectPublicKeyOrThrow, _t as hasOcspNoCheckExtension, M as importEncryptedPkcs1Pem, N as importEncryptedPkcs1PemOrThrow, P as importEncryptedPkcs8Der, F as importEncryptedPkcs8DerOrThrow, I as importEncryptedPkcs8Pem, L as importEncryptedPkcs8PemOrThrow, R as importEncryptedSec1Pem, z as importEncryptedSec1PemOrThrow, B as importPkcs1Der, V as importPkcs1DerOrThrow, H as importPkcs1Pem, U as importPkcs1PemOrThrow, W as importPkcs8Base64, G as importPkcs8Base64OrThrow, K as importPkcs8Der, q as importPkcs8DerOrThrow, J as importPkcs8Pem, Y as importPkcs8PemOrThrow, X as importPrivateJwk, Z as importPrivateJwkOrThrow, Q as importPublicJwk, $ as importPublicJwkOrThrow, ee as importSec1Der, te as importSec1DerOrThrow, ne as importSec1Pem, re as importSec1PemOrThrow, ie as importSpkiBase64, ae as importSpkiBase64OrThrow, oe as importSpkiDer, se as importSpkiDerOrThrow, ce as importSpkiPem, le as importSpkiPemOrThrow, ue as inspectEncryptedPkcs8Der, qe as isCertificateRevoked, t as isResultError, tt as isSelfIssuedCertificate, xe as matchCertificatePrivateKey, nt as matchCertificateServiceIdentity, rt as matchServiceIdentity, Se as parseCertificateChainPem, Ce as parseCertificateChainPemOrThrow, we as parseCertificateDer, Te as parseCertificateDerOrThrow, Ee as parseCertificateFromSource, De as parseCertificatePem, Oe as parseCertificatePemOrThrow, Je as parseCertificateRevocationListDer, Ye as parseCertificateRevocationListDerOrThrow, Xe as parseCertificateRevocationListPem, Ze as parseCertificateRevocationListPemOrThrow, ke as parseCertificateSigningRequestDer, Ae as parseCertificateSigningRequestDerOrThrow, je as parseCertificateSigningRequestPem, Me as parseCertificateSigningRequestPemOrThrow, Ne as parseCertificatesFromSource, Pe as parseDistinguishedNameDer, vt as parseOcspRequestDer, yt as parseOcspRequestDerOrThrow, bt as parseOcspRequestPem, xt as parseOcspRequestPemOrThrow, St as parseOcspResponseDer, Ct as parseOcspResponseDerOrThrow, wt as parseOcspResponsePem, Tt as parseOcspResponsePemOrThrow, Ie as parsePfxDer, Le as parsePfxPem, Be as parsePkcs7CertBagDer, Ve as parsePkcs7CertBagPem, He as parsePkcs7SignedDataDer, Ue as parsePkcs7SignedDataPem, o as pemDecode, s as pemDecodeOrThrow, c as pemEncode, Bt as relativeDistinguishedNameToString, Nt as resolveOcspResponderCandidates, Qe as revocationReasonFromCode, l as splitPemBlocks, u as splitPemBlocksOrThrow, Vt as subjectAltNameLabel, Ht as subjectAltNameToString, Rt as subjectPublicKeyInfoFingerprint, st as trustAnchorFromCertificate, n as unwrap, r as unwrapOr, ct as validateCandidatePath, $e as validateCertificateRevocationList, lt as validateForCa, ut as validateForCodeSigning, dt as validateForTlsClient, ft as validateForTlsServer, Et as validateOcspResponse, pt as verifyCertificateChain, et as verifyCertificateRevocationListSignature, mt as verifyCertificateSigningRequest, Dt as verifyOcspResponseSignature, We as verifyPkcs7SignedData };
@@ -0,0 +1,40 @@
1
+ // src/internal/jose/base64url.ts
2
+ const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", t = (() => {
3
+ let t = (/* @__PURE__ */ new Int8Array(128)).fill(-1);
4
+ for (let n = 0; n < 64; n++) t[e.charCodeAt(n)] = n;
5
+ return t;
6
+ })();
7
+ /** Encodes bytes as unpadded base64url (RFC 4648 §5, RFC 7515 §2). */
8
+ function base64UrlEncode(t) {
9
+ let n = "", r = 0;
10
+ for (; r + 2 < t.length; r += 3) {
11
+ let i = (t[r] ?? 0) * 65536 + (t[r + 1] ?? 0) * 256 + (t[r + 2] ?? 0);
12
+ n += e[i >> 18 & 63] ?? "", n += e[i >> 12 & 63] ?? "", n += e[i >> 6 & 63] ?? "", n += e[i & 63] ?? "";
13
+ }
14
+ let i = t.length - r;
15
+ if (i === 1) {
16
+ let i = (t[r] ?? 0) * 65536;
17
+ n += e[i >> 18 & 63] ?? "", n += e[i >> 12 & 63] ?? "";
18
+ } else if (i === 2) {
19
+ let i = (t[r] ?? 0) * 65536 + (t[r + 1] ?? 0) * 256;
20
+ n += e[i >> 18 & 63] ?? "", n += e[i >> 12 & 63] ?? "", n += e[i >> 6 & 63] ?? "";
21
+ }
22
+ return n;
23
+ }
24
+ /**
25
+ * Decodes canonical unpadded base64url. Returns `undefined` for any character outside the URL-safe
26
+ * alphabet, padding, whitespace, an impossible length, or non-zero trailing bits.
27
+ */
28
+ function base64UrlDecode(e) {
29
+ if (e.length % 4 == 1) return;
30
+ let n = new Uint8Array(Math.floor(e.length * 3 / 4)), r = 0, i = 0, a = 0;
31
+ for (let o = 0; o < e.length; o++) {
32
+ let s = e.charCodeAt(o), c = s < 128 ? t[s] ?? -1 : -1;
33
+ if (c < 0) return;
34
+ i = i << 6 | c, a += 6, a >= 8 && (a -= 8, n[r++] = i >> a & 255, i &= (1 << a) - 1);
35
+ }
36
+ if (i === 0) return n;
37
+ }
38
+ export { base64UrlDecode, base64UrlEncode };
39
+
40
+ //# sourceMappingURL=base64url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64url.js","names":["ALPHABET","DECODE_TABLE","table","index","out","bytes","chunk","remaining","value","written","buffer","bits","code","sextet"],"sources":["../../../src/internal/jose/base64url.ts"],"sourcesContent":["const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n\nconst DECODE_TABLE: Int8Array = (() => {\n\tconst table = new Int8Array(128).fill(-1);\n\tfor (let index = 0; index < ALPHABET.length; index++) {\n\t\ttable[ALPHABET.charCodeAt(index)] = index;\n\t}\n\treturn table;\n})();\n\n/** Encodes bytes as unpadded base64url (RFC 4648 §5, RFC 7515 §2). */\nexport function base64UrlEncode(bytes: Uint8Array): string {\n\tlet out = '';\n\tlet index = 0;\n\tfor (; index + 2 < bytes.length; index += 3) {\n\t\tconst chunk =\n\t\t\t(bytes[index] ?? 0) * 65536 + (bytes[index + 1] ?? 0) * 256 + (bytes[index + 2] ?? 0);\n\t\tout += ALPHABET[(chunk >> 18) & 63] ?? '';\n\t\tout += ALPHABET[(chunk >> 12) & 63] ?? '';\n\t\tout += ALPHABET[(chunk >> 6) & 63] ?? '';\n\t\tout += ALPHABET[chunk & 63] ?? '';\n\t}\n\tconst remaining = bytes.length - index;\n\tif (remaining === 1) {\n\t\tconst chunk = (bytes[index] ?? 0) * 65536;\n\t\tout += ALPHABET[(chunk >> 18) & 63] ?? '';\n\t\tout += ALPHABET[(chunk >> 12) & 63] ?? '';\n\t} else if (remaining === 2) {\n\t\tconst chunk = (bytes[index] ?? 0) * 65536 + (bytes[index + 1] ?? 0) * 256;\n\t\tout += ALPHABET[(chunk >> 18) & 63] ?? '';\n\t\tout += ALPHABET[(chunk >> 12) & 63] ?? '';\n\t\tout += ALPHABET[(chunk >> 6) & 63] ?? '';\n\t}\n\treturn out;\n}\n\n/**\n * Decodes canonical unpadded base64url. Returns `undefined` for any character outside the URL-safe\n * alphabet, padding, whitespace, an impossible length, or non-zero trailing bits.\n */\nexport function base64UrlDecode(value: string): Uint8Array | undefined {\n\tconst remainder = value.length % 4;\n\tif (remainder === 1) return undefined;\n\tconst bytes = new Uint8Array(Math.floor((value.length * 3) / 4));\n\tlet written = 0;\n\tlet buffer = 0;\n\tlet bits = 0;\n\tfor (let index = 0; index < value.length; index++) {\n\t\tconst code = value.charCodeAt(index);\n\t\tconst sextet = code < 128 ? (DECODE_TABLE[code] ?? -1) : -1;\n\t\tif (sextet < 0) return undefined;\n\t\tbuffer = (buffer << 6) | sextet;\n\t\tbits += 6;\n\t\tif (bits >= 8) {\n\t\t\tbits -= 8;\n\t\t\tbytes[written++] = (buffer >> bits) & 0xff;\n\t\t\tbuffer &= (1 << bits) - 1;\n\t\t}\n\t}\n\tif (buffer !== 0) return undefined;\n\treturn bytes;\n}\n"],"mappings":";AAAA,MAAMA,IAAW,oEAEXC,WAAiC;CACtC,IAAMC,qBAAQ,IAAI,UAAU,GAAG,EAAA,CAAE,KAAK,EAAE;CACxC,KAAK,IAAIC,IAAQ,GAAGA,IAAQ,IAAiB,KAC5C,EAAMH,EAAS,WAAWG,CAAK,KAAKA;CAErC,OAAOD;AACR,EAAA,CAAG;;AAGH,SAAgB,gBAAgB,GAA2B;CAC1D,IAAIE,IAAM,IACND,IAAQ;CACZ,OAAOA,IAAQ,IAAIE,EAAM,QAAQ,KAAS,GAAG;EAC5C,IAAMC,KACJD,EAAMF,MAAU,KAAK,SAASE,EAAMF,IAAQ,MAAM,KAAK,OAAOE,EAAMF,IAAQ,MAAM;EAIpF,AAHA,KAAOH,EAAUM,KAAS,KAAM,OAAO,IACvC,KAAON,EAAUM,KAAS,KAAM,OAAO,IACvC,KAAON,EAAUM,KAAS,IAAK,OAAO,IACtC,KAAON,EAASM,IAAQ,OAAO;CAChC;CACA,IAAMC,IAAYF,EAAM,SAASF;CACjC,IAAII,MAAc,GAAG;EACpB,IAAMD,KAASD,EAAMF,MAAU,KAAK;EAEpC,AADA,KAAOH,EAAUM,KAAS,KAAM,OAAO,IACvC,KAAON,EAAUM,KAAS,KAAM,OAAO;CACxC,OAAO,IAAIC,MAAc,GAAG;EAC3B,IAAMD,KAASD,EAAMF,MAAU,KAAK,SAASE,EAAMF,IAAQ,MAAM,KAAK;EAGtE,AAFA,KAAOH,EAAUM,KAAS,KAAM,OAAO,IACvC,KAAON,EAAUM,KAAS,KAAM,OAAO,IACvC,KAAON,EAAUM,KAAS,IAAK,OAAO;CACvC;CACA,OAAOF;AACR;;;;;AAMA,SAAgB,gBAAgB,GAAuC;CAEtE,IADkBI,EAAM,SAAS,KACf,GAAG;CACrB,IAAMH,IAAQ,IAAI,WAAW,KAAK,MAAOG,EAAM,SAAS,IAAK,CAAC,CAAC,GAC3DC,IAAU,GACVC,IAAS,GACTC,IAAO;CACX,KAAK,IAAIR,IAAQ,GAAGA,IAAQK,EAAM,QAAQ,KAAS;EAClD,IAAMI,IAAOJ,EAAM,WAAWL,CAAK,GAC7BU,IAASD,IAAO,MAAOX,EAAaW,MAAS,KAAM;EACzD,IAAIC,IAAS,GAAG;EAGhB,AAFA,IAAUH,KAAU,IAAKG,GACzB,KAAQ,GACJF,KAAQ,MACX,KAAQ,GACR,EAAM,OAAcD,KAAUC,IAAQ,KACtC,MAAW,KAAKA,KAAQ;CAE1B;CACA,IAAID,MAAW,GACf,OAAOL;AACR"}
@@ -0,0 +1,9 @@
1
+ /** A parsed JSON value. Objects are plain records whose members are all own data properties. */
2
+ export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
3
+ readonly [member: string]: JsonValue;
4
+ };
5
+ /** A parsed JSON object. */
6
+ export type JsonObject = {
7
+ readonly [member: string]: JsonValue;
8
+ };
9
+ //# sourceMappingURL=strict-json.d.ts.map
@@ -0,0 +1,155 @@
1
+ // src/internal/jose/strict-json.ts
2
+ const e = Symbol("micro509.jose.strictJsonFailure");
3
+ function refuse(t, n) {
4
+ throw {
5
+ [e]: !0,
6
+ code: t,
7
+ message: n
8
+ };
9
+ }
10
+ function isRefusal(t) {
11
+ return typeof t == "object" && !!t && e in t;
12
+ }
13
+ /**
14
+ * Parses RFC 8259 JSON text, refusing duplicate object member names, lone surrogate escapes,
15
+ * non-finite numbers, and documents beyond the given depth and node bounds.
16
+ */
17
+ function parseStrictJson(e, t) {
18
+ let n = {
19
+ text: e,
20
+ index: 0,
21
+ nodes: 0,
22
+ limits: t
23
+ };
24
+ try {
25
+ skipWhitespace(n);
26
+ let t = parseValue(n, 0);
27
+ return skipWhitespace(n), n.index !== e.length && refuse("invalid_json", "Trailing characters after JSON value"), {
28
+ ok: !0,
29
+ value: t
30
+ };
31
+ } catch (e) {
32
+ if (isRefusal(e)) return {
33
+ ok: !1,
34
+ code: e.code,
35
+ message: e.message
36
+ };
37
+ throw e;
38
+ }
39
+ }
40
+ function skipWhitespace(e) {
41
+ for (; e.index < e.text.length;) {
42
+ let t = e.text.charCodeAt(e.index);
43
+ if (t !== 32 && t !== 9 && t !== 10 && t !== 13) return;
44
+ e.index++;
45
+ }
46
+ }
47
+ function countNode(e) {
48
+ e.nodes++, e.nodes > e.limits.maxNodes && refuse("limit_exceeded", "JSON document exceeds the node limit");
49
+ }
50
+ function parseValue(e, t) {
51
+ switch (countNode(e), e.text[e.index]) {
52
+ case "{": return parseObject(e, t + 1);
53
+ case "[": return parseArray(e, t + 1);
54
+ case "\"": return parseString(e);
55
+ case "t": return parseLiteral(e, "true", !0);
56
+ case "f": return parseLiteral(e, "false", !1);
57
+ case "n": return parseLiteral(e, "null", null);
58
+ default: return parseNumber(e);
59
+ }
60
+ }
61
+ function parseLiteral(e, t, n) {
62
+ return e.text.startsWith(t, e.index) || refuse("invalid_json", "Unexpected token in JSON"), e.index += t.length, n;
63
+ }
64
+ const t = /-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/y;
65
+ function parseNumber(e) {
66
+ t.lastIndex = e.index;
67
+ let n = t.exec(e.text);
68
+ n === null && refuse("invalid_json", "Unexpected token in JSON"), e.index += n[0].length;
69
+ let r = Number(n[0]);
70
+ return Number.isFinite(r) || refuse("invalid_json", "JSON number is not finite"), r;
71
+ }
72
+ function enter(e, t) {
73
+ t > e.limits.maxDepth && refuse("limit_exceeded", "JSON document exceeds the nesting limit");
74
+ }
75
+ function parseArray(e, t) {
76
+ enter(e, t), e.index++;
77
+ let n = [];
78
+ if (skipWhitespace(e), e.text[e.index] === "]") return e.index++, n;
79
+ for (;;) {
80
+ skipWhitespace(e), n.push(parseValue(e, t)), skipWhitespace(e);
81
+ let r = e.text[e.index++];
82
+ if (r === "]") return n;
83
+ r !== "," && refuse("invalid_json", "Expected \",\" or \"]\" in JSON array");
84
+ }
85
+ }
86
+ function parseObject(e, t) {
87
+ enter(e, t), e.index++;
88
+ let n = /* @__PURE__ */ new Map();
89
+ if (skipWhitespace(e), e.text[e.index] === "}") return e.index++, {};
90
+ for (;;) {
91
+ skipWhitespace(e), e.text[e.index] !== "\"" && refuse("invalid_json", "Expected member name in JSON object"), countNode(e);
92
+ let r = parseString(e);
93
+ n.has(r) && refuse("duplicate_member", "JSON object repeats a member name"), skipWhitespace(e), e.text[e.index++] !== ":" && refuse("invalid_json", "Expected \":\" in JSON object"), skipWhitespace(e), n.set(r, parseValue(e, t)), skipWhitespace(e);
94
+ let i = e.text[e.index++];
95
+ if (i === "}") break;
96
+ i !== "," && refuse("invalid_json", "Expected \",\" or \"}\" in JSON object");
97
+ }
98
+ let r = {};
99
+ for (let [e, t] of n) Object.defineProperty(r, e, {
100
+ value: t,
101
+ enumerable: !0,
102
+ writable: !0,
103
+ configurable: !0
104
+ });
105
+ return r;
106
+ }
107
+ const n = /[0-9a-fA-F]{4}/y;
108
+ function readEscapedUnit(e) {
109
+ n.lastIndex = e.index;
110
+ let t = n.exec(e.text);
111
+ return t === null && refuse("invalid_json", "Invalid unicode escape in JSON string"), e.index += 4, Number.parseInt(t[0], 16);
112
+ }
113
+ function parseString(e) {
114
+ e.index++;
115
+ let t = "", n = e.index;
116
+ for (;;) {
117
+ e.index >= e.text.length && refuse("invalid_json", "Unterminated JSON string");
118
+ let r = e.text.charCodeAt(e.index);
119
+ if (r === 34) return t += e.text.slice(n, e.index), e.index++, t;
120
+ r < 32 && refuse("invalid_json", "Control character in JSON string"), r === 92 ? (t += e.text.slice(n, e.index), e.index++, t += parseEscape(e), n = e.index) : e.index++;
121
+ }
122
+ }
123
+ const r = {
124
+ "\"": "\"",
125
+ "\\": "\\",
126
+ "/": "/",
127
+ b: "\b",
128
+ f: "\f",
129
+ n: "\n",
130
+ r: "\r",
131
+ t: " "
132
+ };
133
+ function parseEscape(e) {
134
+ let t = e.text[e.index++];
135
+ if (t === void 0 && refuse("invalid_json", "Unterminated JSON string"), t !== "u") {
136
+ let e = Object.hasOwn(r, t) ? r[t] : void 0;
137
+ return e === void 0 && refuse("invalid_json", "Invalid escape in JSON string"), e;
138
+ }
139
+ let n = readEscapedUnit(e);
140
+ if (n >= 56320 && n <= 57343 && refuse("invalid_json", "Lone low surrogate escape in JSON string"), n < 55296 || n > 56319) return String.fromCharCode(n);
141
+ e.text.startsWith("\\u", e.index) || refuse("invalid_json", "Lone high surrogate escape in JSON string"), e.index += 2;
142
+ let i = readEscapedUnit(e);
143
+ return (i < 56320 || i > 57343) && refuse("invalid_json", "High surrogate escape without a low surrogate"), String.fromCharCode(n, i);
144
+ }
145
+ /** Narrows a parsed value to a JSON object. */
146
+ function isJsonObject(e) {
147
+ return typeof e == "object" && !!e && !Array.isArray(e);
148
+ }
149
+ /** Narrows a parsed value to a JSON array. */
150
+ function isJsonArray(e) {
151
+ return Array.isArray(e);
152
+ }
153
+ export { isJsonArray, isJsonObject, parseStrictJson };
154
+
155
+ //# sourceMappingURL=strict-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strict-json.js","names":["failureBrand","value","cursor","text","error","char","depth","literal","NUMBER_PATTERN","match","items","members","name","object","HEX4","out","runStart","code","SIMPLE_ESCAPES","marker","simple","unit","low"],"sources":["../../../src/internal/jose/strict-json.ts"],"sourcesContent":["/** A parsed JSON value. Objects are plain records whose members are all own data properties. */\nexport type JsonValue =\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| readonly JsonValue[]\n\t| { readonly [member: string]: JsonValue };\n\n/** A parsed JSON object. */\nexport type JsonObject = { readonly [member: string]: JsonValue };\n\n/** Reason strict JSON parsing refused its input. */\nexport type StrictJsonFailureCode = 'invalid_json' | 'duplicate_member' | 'limit_exceeded';\n\n/** Failure of {@linkcode parseStrictJson}. */\nexport interface StrictJsonFailure {\n\treadonly ok: false;\n\treadonly code: StrictJsonFailureCode;\n\treadonly message: string;\n}\n\n/** Result of {@linkcode parseStrictJson}. */\nexport type StrictJsonResult = { readonly ok: true; readonly value: JsonValue } | StrictJsonFailure;\n\n/** Bounds applied while parsing. */\nexport interface StrictJsonLimits {\n\t/** Maximum array and object nesting. */\n\treadonly maxDepth: number;\n\t/** Maximum number of values (scalars, arrays, objects and members) in the document. */\n\treadonly maxNodes: number;\n}\n\ninterface Cursor {\n\treadonly text: string;\n\tindex: number;\n\tnodes: number;\n\treadonly limits: StrictJsonLimits;\n}\n\nconst failureBrand = Symbol('micro509.jose.strictJsonFailure');\n\ninterface Refusal {\n\treadonly [failureBrand]: true;\n\treadonly code: StrictJsonFailureCode;\n\treadonly message: string;\n}\n\nfunction refuse(code: StrictJsonFailureCode, message: string): never {\n\tconst refusal: Refusal = { [failureBrand]: true, code, message };\n\tthrow refusal;\n}\n\nfunction isRefusal(value: unknown): value is Refusal {\n\treturn typeof value === 'object' && value !== null && failureBrand in value;\n}\n\n/**\n * Parses RFC 8259 JSON text, refusing duplicate object member names, lone surrogate escapes,\n * non-finite numbers, and documents beyond the given depth and node bounds.\n */\nexport function parseStrictJson(text: string, limits: StrictJsonLimits): StrictJsonResult {\n\tconst cursor: Cursor = { text, index: 0, nodes: 0, limits };\n\ttry {\n\t\tskipWhitespace(cursor);\n\t\tconst value = parseValue(cursor, 0);\n\t\tskipWhitespace(cursor);\n\t\tif (cursor.index !== text.length)\n\t\t\trefuse('invalid_json', 'Trailing characters after JSON value');\n\t\treturn { ok: true, value };\n\t} catch (error) {\n\t\tif (isRefusal(error)) return { ok: false, code: error.code, message: error.message };\n\t\tthrow error;\n\t}\n}\n\nfunction skipWhitespace(cursor: Cursor): void {\n\twhile (cursor.index < cursor.text.length) {\n\t\tconst char = cursor.text.charCodeAt(cursor.index);\n\t\tif (char !== 0x20 && char !== 0x09 && char !== 0x0a && char !== 0x0d) return;\n\t\tcursor.index++;\n\t}\n}\n\nfunction countNode(cursor: Cursor): void {\n\tcursor.nodes++;\n\tif (cursor.nodes > cursor.limits.maxNodes) {\n\t\trefuse('limit_exceeded', 'JSON document exceeds the node limit');\n\t}\n}\n\nfunction parseValue(cursor: Cursor, depth: number): JsonValue {\n\tcountNode(cursor);\n\tconst char = cursor.text[cursor.index];\n\tswitch (char) {\n\t\tcase '{':\n\t\t\treturn parseObject(cursor, depth + 1);\n\t\tcase '[':\n\t\t\treturn parseArray(cursor, depth + 1);\n\t\tcase '\"':\n\t\t\treturn parseString(cursor);\n\t\tcase 't':\n\t\t\treturn parseLiteral(cursor, 'true', true);\n\t\tcase 'f':\n\t\t\treturn parseLiteral(cursor, 'false', false);\n\t\tcase 'n':\n\t\t\treturn parseLiteral(cursor, 'null', null);\n\t\tdefault:\n\t\t\treturn parseNumber(cursor);\n\t}\n}\n\nfunction parseLiteral<TValue extends boolean | null>(\n\tcursor: Cursor,\n\tliteral: string,\n\tvalue: TValue,\n): TValue {\n\tif (!cursor.text.startsWith(literal, cursor.index)) {\n\t\trefuse('invalid_json', 'Unexpected token in JSON');\n\t}\n\tcursor.index += literal.length;\n\treturn value;\n}\n\nconst NUMBER_PATTERN = /-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/y;\n\nfunction parseNumber(cursor: Cursor): number {\n\tNUMBER_PATTERN.lastIndex = cursor.index;\n\tconst match = NUMBER_PATTERN.exec(cursor.text);\n\tif (match === null) refuse('invalid_json', 'Unexpected token in JSON');\n\tcursor.index += match[0].length;\n\tconst value = Number(match[0]);\n\tif (!Number.isFinite(value)) refuse('invalid_json', 'JSON number is not finite');\n\treturn value;\n}\n\nfunction enter(cursor: Cursor, depth: number): void {\n\tif (depth > cursor.limits.maxDepth) {\n\t\trefuse('limit_exceeded', 'JSON document exceeds the nesting limit');\n\t}\n}\n\nfunction parseArray(cursor: Cursor, depth: number): readonly JsonValue[] {\n\tenter(cursor, depth);\n\tcursor.index++;\n\tconst items: JsonValue[] = [];\n\tskipWhitespace(cursor);\n\tif (cursor.text[cursor.index] === ']') {\n\t\tcursor.index++;\n\t\treturn items;\n\t}\n\tfor (;;) {\n\t\tskipWhitespace(cursor);\n\t\titems.push(parseValue(cursor, depth));\n\t\tskipWhitespace(cursor);\n\t\tconst char = cursor.text[cursor.index++];\n\t\tif (char === ']') return items;\n\t\tif (char !== ',') refuse('invalid_json', 'Expected \",\" or \"]\" in JSON array');\n\t}\n}\n\nfunction parseObject(cursor: Cursor, depth: number): JsonObject {\n\tenter(cursor, depth);\n\tcursor.index++;\n\tconst members = new Map<string, JsonValue>();\n\tskipWhitespace(cursor);\n\tif (cursor.text[cursor.index] === '}') {\n\t\tcursor.index++;\n\t\treturn {};\n\t}\n\tfor (;;) {\n\t\tskipWhitespace(cursor);\n\t\tif (cursor.text[cursor.index] !== '\"')\n\t\t\trefuse('invalid_json', 'Expected member name in JSON object');\n\t\tcountNode(cursor);\n\t\tconst name = parseString(cursor);\n\t\tif (members.has(name)) refuse('duplicate_member', 'JSON object repeats a member name');\n\t\tskipWhitespace(cursor);\n\t\tif (cursor.text[cursor.index++] !== ':') refuse('invalid_json', 'Expected \":\" in JSON object');\n\t\tskipWhitespace(cursor);\n\t\tmembers.set(name, parseValue(cursor, depth));\n\t\tskipWhitespace(cursor);\n\t\tconst char = cursor.text[cursor.index++];\n\t\tif (char === '}') break;\n\t\tif (char !== ',') refuse('invalid_json', 'Expected \",\" or \"}\" in JSON object');\n\t}\n\tconst object: Record<string, JsonValue> = {};\n\tfor (const [name, value] of members) {\n\t\tObject.defineProperty(object, name, {\n\t\t\tvalue,\n\t\t\tenumerable: true,\n\t\t\twritable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\treturn object;\n}\n\nconst HEX4 = /[0-9a-fA-F]{4}/y;\n\nfunction readEscapedUnit(cursor: Cursor): number {\n\tHEX4.lastIndex = cursor.index;\n\tconst match = HEX4.exec(cursor.text);\n\tif (match === null) refuse('invalid_json', 'Invalid unicode escape in JSON string');\n\tcursor.index += 4;\n\treturn Number.parseInt(match[0], 16);\n}\n\nfunction parseString(cursor: Cursor): string {\n\tcursor.index++;\n\tlet out = '';\n\tlet runStart = cursor.index;\n\tfor (;;) {\n\t\tif (cursor.index >= cursor.text.length) refuse('invalid_json', 'Unterminated JSON string');\n\t\tconst code = cursor.text.charCodeAt(cursor.index);\n\t\tif (code === 0x22) {\n\t\t\tout += cursor.text.slice(runStart, cursor.index);\n\t\t\tcursor.index++;\n\t\t\treturn out;\n\t\t}\n\t\tif (code < 0x20) refuse('invalid_json', 'Control character in JSON string');\n\t\tif (code !== 0x5c) {\n\t\t\tcursor.index++;\n\t\t\tcontinue;\n\t\t}\n\t\tout += cursor.text.slice(runStart, cursor.index);\n\t\tcursor.index++;\n\t\tout += parseEscape(cursor);\n\t\trunStart = cursor.index;\n\t}\n}\n\nconst SIMPLE_ESCAPES: Readonly<Record<string, string>> = {\n\t'\"': '\"',\n\t'\\\\': '\\\\',\n\t'/': '/',\n\tb: '\\b',\n\tf: '\\f',\n\tn: '\\n',\n\tr: '\\r',\n\tt: '\\t',\n};\n\nfunction parseEscape(cursor: Cursor): string {\n\tconst marker = cursor.text[cursor.index++];\n\tif (marker === undefined) refuse('invalid_json', 'Unterminated JSON string');\n\tif (marker !== 'u') {\n\t\tconst simple = Object.hasOwn(SIMPLE_ESCAPES, marker) ? SIMPLE_ESCAPES[marker] : undefined;\n\t\tif (simple === undefined) refuse('invalid_json', 'Invalid escape in JSON string');\n\t\treturn simple;\n\t}\n\tconst unit = readEscapedUnit(cursor);\n\tif (unit >= 0xdc00 && unit <= 0xdfff) {\n\t\trefuse('invalid_json', 'Lone low surrogate escape in JSON string');\n\t}\n\tif (unit < 0xd800 || unit > 0xdbff) return String.fromCharCode(unit);\n\tif (!cursor.text.startsWith('\\\\u', cursor.index)) {\n\t\trefuse('invalid_json', 'Lone high surrogate escape in JSON string');\n\t}\n\tcursor.index += 2;\n\tconst low = readEscapedUnit(cursor);\n\tif (low < 0xdc00 || low > 0xdfff) {\n\t\trefuse('invalid_json', 'High surrogate escape without a low surrogate');\n\t}\n\treturn String.fromCharCode(unit, low);\n}\n\n/** Narrows a parsed value to a JSON object. */\nexport function isJsonObject(value: JsonValue | undefined): value is JsonObject {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Narrows a parsed value to a JSON array. */\nexport function isJsonArray(value: JsonValue | undefined): value is readonly JsonValue[] {\n\treturn Array.isArray(value);\n}\n"],"mappings":"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"}
@@ -0,0 +1,23 @@
1
+ import { toArrayBuffer as e, toHex as t } from "../asn1/asn1.js";
2
+ import { getCrypto as n } from "../crypto/webcrypto.js";
3
+ // src/internal/verify/spki-distrust.ts
4
+ /** Caller-supplied SHA-256 SPKI distrust, scoped to one verification operation. */
5
+ /** Validates and snapshots the caller's hashes before any asynchronous work. */
6
+ function createSpkiDistrustCheck(r) {
7
+ let i = /* @__PURE__ */ new Set();
8
+ for (let e of r ?? []) {
9
+ if (typeof e != "string" || !/^[0-9a-fA-F]{64}$/.test(e)) throw RangeError("distrustedSpkiSha256 entries must be 64 hexadecimal characters");
10
+ i.add(e.toLowerCase());
11
+ }
12
+ let a = /* @__PURE__ */ new Map();
13
+ return async (r) => {
14
+ if (i.size === 0) return;
15
+ let o = t(r), s = a.get(o);
16
+ s === void 0 && (s = n().subtle.digest("SHA-256", e(r)).then((e) => t(new Uint8Array(e))), a.set(o, s));
17
+ let c = await s;
18
+ return i.has(c) ? c : void 0;
19
+ };
20
+ }
21
+ export { createSpkiDistrustCheck };
22
+
23
+ //# sourceMappingURL=spki-distrust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spki-distrust.js","names":["blocked","hash","hashes","digests","key","toHex","spki","digest","getCrypto","toArrayBuffer","bytes"],"sources":["../../../src/internal/verify/spki-distrust.ts"],"sourcesContent":["/** Caller-supplied SHA-256 SPKI distrust, scoped to one verification operation. */\nimport { toArrayBuffer, toHex } from '#micro509/internal/asn1/asn1';\nimport { getCrypto } from '#micro509/internal/crypto/webcrypto';\n\n/** Validates and snapshots the caller's hashes before any asynchronous work. */\nexport function createSpkiDistrustCheck(\n\thashes: readonly string[] | undefined,\n): (spki: Uint8Array) => Promise<string | undefined> {\n\tconst blocked = new Set<string>();\n\tfor (const hash of hashes ?? []) {\n\t\tif (typeof hash !== 'string' || !/^[0-9a-fA-F]{64}$/.test(hash)) {\n\t\t\tthrow new RangeError('distrustedSpkiSha256 entries must be 64 hexadecimal characters');\n\t\t}\n\t\tblocked.add(hash.toLowerCase());\n\t}\n\tconst digests = new Map<string, Promise<string>>();\n\treturn async (spki) => {\n\t\tif (blocked.size === 0) return undefined;\n\t\tconst key = toHex(spki);\n\t\tlet digest = digests.get(key);\n\t\tif (digest === undefined) {\n\t\t\tdigest = getCrypto()\n\t\t\t\t.subtle.digest('SHA-256', toArrayBuffer(spki))\n\t\t\t\t.then((bytes) => toHex(new Uint8Array(bytes)));\n\t\t\tdigests.set(key, digest);\n\t\t}\n\t\tconst hash = await digest;\n\t\treturn blocked.has(hash) ? hash : undefined;\n\t};\n}\n"],"mappings":";;;;;AAKA,SAAgB,wBACf,GACoD;CACpD,IAAMA,oBAAU,IAAI,IAAY;CAChC,KAAK,IAAMC,KAAQC,KAAU,CAAC,GAAG;EAChC,IAAI,OAAOD,KAAS,YAAY,CAAC,oBAAoB,KAAKA,CAAI,GAC7D,MAAU,WAAW,gEAAgE;EAEtF,EAAQ,IAAIA,EAAK,YAAY,CAAC;CAC/B;CACA,IAAME,oBAAU,IAAI,IAA6B;CACjD,OAAO,OAAO,MAAS;EACtB,IAAIH,EAAQ,SAAS,GAAG;EACxB,IAAMI,IAAMC,EAAMC,CAAI,GAClBC,IAASJ,EAAQ,IAAIC,CAAG;EAC5B,AAAIG,MAAW,KAAA,MACd,IAASC,EAAU,CAAC,CAClB,OAAO,OAAO,WAAWC,EAAcH,CAAI,CAAC,CAAC,CAC7C,MAAM,MAAUD,EAAM,IAAI,WAAWK,CAAK,CAAC,CAAC,GAC9CP,EAAQ,IAAIC,GAAKG,CAAM;EAExB,IAAMN,IAAO,MAAMM;EACnB,OAAOP,EAAQ,IAAIC,CAAI,IAAIA,IAAO,KAAA;CACnC;AACD"}