micro509 0.19.0 → 0.19.1
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 +22 -1
- package/dist/index.d.ts +2 -2
- package/dist/internal/crypto/hash.js +64 -64
- package/dist/internal/crypto/pbes2.js +3 -3
- package/dist/internal/shared/dn.js +1 -1
- package/dist/internal/shared/idna-tables.js +3 -3
- package/dist/internal/shared/punycode.js +1 -1
- package/dist/kdf/argon2-portable.js +1 -1
- package/dist/kdf/argon2.js +2 -2
- package/dist/keys/keys.d.ts +7 -2
- package/dist/keys/keys.js +10 -6
- package/dist/keys/keys.js.map +1 -1
- package/dist/pem/pem.d.ts +20 -7
- package/dist/pem/pem.js +24 -20
- package/dist/pem/pem.js.map +1 -1
- package/dist/pem.d.ts +2 -2
- package/dist/pkcs/pkcs12-mac.js +2 -2
- package/dist/revocation/crl.js +46 -46
- package/dist/revocation/crl.js.map +1 -1
- package/dist/verify/verify.js +0 -4
- package/dist/verify/verify.js.map +1 -1
- package/dist/x509/extensions.js +1 -1
- package/dist/x509/name-text.js +1 -1
- package/dist/x509/name-text.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [0.19.1] - 2026-12-01
|
|
22
|
+
|
|
23
|
+
Decode a dedicated key file as exactly one PEM block with the opt-in
|
|
24
|
+
`wholeInput` policy.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `pemDecode`, `pemDecodeOrThrow`, `importPkcs8Pem` and `importPkcs8PemOrThrow`
|
|
29
|
+
take `{ wholeInput: true }` (`PemDecodeOptions`). The whole input must then
|
|
30
|
+
be one PEM block of the requested label with exact boundary lines and
|
|
31
|
+
nonempty base64 lines. Line breaks may be LF or CRLF, and the final line
|
|
32
|
+
break is optional. A BOM, surrounding whitespace, extra text or a second
|
|
33
|
+
block fails the decode. The default decoder still skips text ahead of the
|
|
34
|
+
`BEGIN` line. [#281](https://github.com/kjanat/micro509/issues/281)
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Malformed PEM now rejects the promise `importPkcs8PemOrThrow` returns.
|
|
39
|
+
Callers that caught a synchronous throw must await the call.
|
|
40
|
+
|
|
21
41
|
## [0.19.0] - 2026-11-16
|
|
22
42
|
|
|
23
43
|
Verify signatures WebCrypto cannot run, such as DSA, with caller verifiers
|
|
@@ -2228,7 +2248,8 @@ Initial prerelease. API may change before 1.0.
|
|
|
2228
2248
|
- Zero runtime dependencies, WebCrypto-native, tree-shakeable subpath exports;
|
|
2229
2249
|
runs on Node, Bun, Deno, browsers, and Cloudflare Workers.
|
|
2230
2250
|
|
|
2231
|
-
[Unreleased]: https://github.com/kjanat/micro509/compare/v0.19.
|
|
2251
|
+
[Unreleased]: https://github.com/kjanat/micro509/compare/v0.19.1...HEAD
|
|
2252
|
+
[0.19.1]: https://github.com/kjanat/micro509/compare/v0.19.0...v0.19.1
|
|
2232
2253
|
[0.19.0]: https://github.com/kjanat/micro509/compare/v0.18.0...v0.19.0
|
|
2233
2254
|
[0.18.0]: https://github.com/kjanat/micro509/compare/v0.17.1...v0.18.0
|
|
2234
2255
|
[0.17.1]: https://github.com/kjanat/micro509/compare/v0.17.0...v0.17.1
|
package/dist/index.d.ts
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
*/
|
|
68
68
|
import { DecryptRsaOaepErrorCode, DecryptRsaOaepFailure, DecryptRsaOaepResult, EcKeyAlgorithmInput, EcNamedCurve, Ed25519KeyAlgorithmInput, EncryptRsaOaepErrorCode, EncryptRsaOaepFailure, EncryptRsaOaepResult, EncryptedPkcs8Options, ImportEcKeyInput, ImportEd25519KeyInput, ImportEncryptedKeyErrorCode, ImportEncryptedKeyFailure, ImportEncryptedKeyOptions, ImportEncryptedKeyResult, ImportKeyErrorCode, ImportKeyErrorDetails, ImportKeyFailure, ImportKeyReason, ImportKeyResult, ImportKeyStage, ImportRsaKeyInput, KeyAlgorithmInput, KeyPairMaterial, LegacyPemEncryptionOptions, PrivateKeyImportInput, PublicKeyImportInput, RsaHash, RsaKeyAlgorithmInput, RsaOaepOptions, RsaScheme, RsaSignatureScheme, decryptRsaOaep, decryptRsaOaepOrThrow, derivePublicKey, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, generateKeyPair, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPrivateKeyPem, importPrivateKeyPemOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, inspectEncryptedPkcs8Der } from "./keys/keys.js";
|
|
69
69
|
import { KdfLimitOptions, Pbes2Parameters } from "./internal/crypto/pbes2.js";
|
|
70
|
-
import { CategorizePemBlocksResult, CategorizedPemBlocks, PemBlock, PemDecodeResult, PemErrorCode, PemFailure, SplitPemBlocksResult, categorizePemBlocks, categorizePemBlocksOrThrow, pemDecode, pemDecodeOrThrow, pemEncode, splitPemBlocks, splitPemBlocksOrThrow } from "./pem/pem.js";
|
|
70
|
+
import { CategorizePemBlocksResult, CategorizedPemBlocks, PemBlock, PemDecodeOptions, PemDecodeResult, PemErrorCode, PemFailure, SplitPemBlocksResult, categorizePemBlocks, categorizePemBlocksOrThrow, pemDecode, pemDecodeOrThrow, pemEncode, splitPemBlocks, splitPemBlocksOrThrow } from "./pem/pem.js";
|
|
71
71
|
import { CreatePfxErrorCode, CreatePfxFailure, CreatePfxInput, CreatePfxResult, ParsePfxErrorCode, ParsePfxFailure, ParsePfxOptions, ParsePfxResult, ParsedPfx, ParsedPfxAttribute, ParsedPfxBag, ParsedPfxBagAttributes, PfxBagAttributesInput, PfxCertificateBagInput, PfxCertificateSource, PfxEncoderErrorCode, PfxEncryptionOptions, PfxMaterial, PfxPrivateKeyBagInput, PfxPrivateKeySource, createPfx, parsePfxDer, parsePfxPem } from "./pkcs/pfx.js";
|
|
72
72
|
import { CreatePkcs7CertBagErrorCode, CreatePkcs7CertBagFailure, CreatePkcs7CertBagResult, CreatePkcs7SignedDataErrorCode, CreatePkcs7SignedDataFailure, CreatePkcs7SignedDataInput, CreatePkcs7SignedDataResult, ParsePkcs7CertBagResult, ParsePkcs7ErrorCode, ParsePkcs7Failure, ParsePkcs7SignedDataResult, ParsedCertificateChoice, ParsedPkcs7SignedData, ParsedPkcs7SignerInfo, ParsedPkcs7SignerInfoBase, ParsedSignerIdentifier, Pkcs7CertBagMaterial, Pkcs7CertificateSource, Pkcs7SignedDataMaterial, Pkcs7Signer, VerifiedPkcs7Signer, VerifyPkcs7SignedDataErrorCode, VerifyPkcs7SignedDataFailure, VerifyPkcs7SignedDataOptions, VerifyPkcs7SignedDataResult, createPkcs7CertBag, createPkcs7SignedData, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, verifyPkcs7SignedData } from "./pkcs/pkcs7.js";
|
|
73
73
|
import { CreatePkcs12MacDataErrorCode, ParsePkcs12MacDataErrorCode, ParsePkcs12MacDataFailure, ParsePkcs12MacDataOptions, ParsePkcs12MacDataResult, ParsedPkcs12MacData, Pkcs12MacOptions } from "./pkcs/pkcs12-mac.js";
|
|
@@ -91,4 +91,4 @@ import { ExtensionEncoderErrorCode } from "./internal/x509/extension-errors.js";
|
|
|
91
91
|
import { NameAttribute, NameEncoderErrorCode, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput } from "./x509/name.js";
|
|
92
92
|
import { SubjectAltNameTextOptions, distinguishedNameToString, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString } from "./x509/name-text.js";
|
|
93
93
|
import { compareDistinguishedNames } from "./internal/shared/dn.js";
|
|
94
|
-
export { type AuthorityInformationAccess, type AuthorityInformationAccessInput, type BasicConstraints, type BuildCandidatePathInput, type BuildCandidatePathResult, type CandidatePath, type CandidatePathAnchor, type CandidatePathCertificates, type CategorizePemBlocksResult, type CategorizedPemBlocks, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CertificateRevocationListMaterial, type CertificateRevocationStatus, type CertificateSource, type ChainRevocationInput, type CheckCertificateRevocationAgainstCrlErrorCode, type CheckCertificateRevocationAgainstCrlFailure, type CheckCertificateRevocationAgainstCrlFailureDetails, type CheckCertificateRevocationAgainstCrlGoodValue, type CheckCertificateRevocationAgainstCrlInput, type CheckCertificateRevocationAgainstCrlResult, type CheckCertificateRevocationAgainstCrlRevokedValue, type CheckCertificateRevocationAgainstCrlValue, type CheckCertificateRevocationErrorCode, type CheckCertificateRevocationFailureDetails, type CheckCertificateRevocationInput, type CheckCertificateRevocationResult, type CheckCertificateRevocationValue, type CheckChainRevocationInput, type CheckChainRevocationResult, type CheckChainRevocationValue, type ConfiguredOcspResponder, type ConfiguredOcspResponderCertificate, type ConstrainedPolicy, type CreateCertificateErrorCode, type CreateCertificateInput, type CreateCertificateRevocationListInput, type CreateCsrInput, type CreateOcspCertStatusInput, type CreateOcspRequestInput, type CreateOcspRequestItemInput, type CreateOcspResponseInput, type CreateOcspSingleResponseInput, type CreatePfxErrorCode, type CreatePfxFailure, type CreatePfxInput, type CreatePfxResult, type CreatePkcs12MacDataErrorCode, type CreatePkcs7CertBagErrorCode, type CreatePkcs7CertBagFailure, type CreatePkcs7CertBagResult, type CreatePkcs7SignedDataErrorCode, type CreatePkcs7SignedDataFailure, type CreatePkcs7SignedDataInput, type CreatePkcs7SignedDataResult, type CreateSelfSignedCertificateBase, type CreateSelfSignedCertificateInput, type CrlApplicabilityFailureReason, type CrlCertificateSource, type CrlEncoderErrorCode, type CrlSource, type CsrMaterial, type CsrSource, DECODE_REFUSAL_CODES, type DecodeFailureCode, type DecodeRefusalCode, type DecodedExtensionMap, type DecodedExtensionValue, type DecryptRsaOaepErrorCode, type DecryptRsaOaepFailure, type DecryptRsaOaepResult, type DisplayTextType, type DistributionPoint, type DistributionPointName, type DnsServiceIdentityInput, type EcKeyAlgorithmInput, type EcNamedCurve, type Ed25519KeyAlgorithmInput, type EkuCheckFailure, type EkuCheckPurpose, type EkuCheckResult, type EncryptRsaOaepErrorCode, type EncryptRsaOaepFailure, type EncryptRsaOaepResult, type EncryptedPkcs8Options, type ErrorResult, type ExtendedKeyUsage, type ExtensionDecoder, type ExtensionDecoderMap, type ExtensionEncoderErrorCode, type GeneralName, type GeneralSubtree, type ImportEcKeyInput, type ImportEd25519KeyInput, type ImportEncryptedKeyErrorCode, type ImportEncryptedKeyFailure, type ImportEncryptedKeyOptions, type ImportEncryptedKeyResult, type ImportKeyErrorCode, type ImportKeyErrorDetails, type ImportKeyFailure, type ImportKeyReason, type ImportKeyResult, type ImportKeyStage, type ImportRsaKeyInput, type IndexedErrorResult, type IndexedMicro509Error, type InhibitAnyPolicy, type InitialNameConstraintsInput, type IpServiceIdentityInput, type IssuingDistributionPoint, type IssuingDistributionPointBase, type IssuingDistributionPointForAttributeCerts, type IssuingDistributionPointForCaCerts, type IssuingDistributionPointForUserCerts, type KdfLimitOptions, type KeyAlgorithmInput, type KeyPairMaterial, type KeyUsage, type LegacyPemEncryptionOptions, type MatchCertificatePrivateKeyErrorCode, type MatchCertificatePrivateKeyFailure, type MatchCertificatePrivateKeyFailureResult, type MatchCertificatePrivateKeyResult, type MatchCertificatePrivateKeySuccess, type MatchServiceIdentityErrorCode, type MatchServiceIdentityFailure, type MatchServiceIdentityFailureDetails, type MatchServiceIdentityFailureResult, type MatchServiceIdentityInput, type MatchServiceIdentityResult, type MatchServiceIdentitySuccess, type Micro509Error, type NameAttribute, type NameConstraintForm, type NameConstraints, type NameEncoderErrorCode, type NameFieldKey, type NameInput, type NameObject, type OcspCertStatus, type OcspCertificateSource, type OcspEncoderErrorCode, type OcspHashAlgorithm, type OcspRequestMaterial, type OcspRequestSource, type OcspResponderCandidate, type OcspResponderRevocationPolicy, type OcspResponderSource, type OcspResponseMaterial, type OcspResponseSource, type OcspResponseStatus, type OversizedDisplayText, type ParseCertificateChainResult, type ParseCertificateErrorCode, type ParseCertificateFailure, type ParseCertificateResult, type ParseCertificateRevocationListErrorCode, type ParseCertificateRevocationListFailure, type ParseCertificateRevocationListResult, type ParseCertificateSigningRequestErrorCode, type ParseCertificateSigningRequestFailure, type ParseCertificateSigningRequestResult, type ParseOcspRequestErrorCode, type ParseOcspRequestFailure, type ParseOcspRequestResult, type ParseOcspResponseErrorCode, type ParseOcspResponseFailure, type ParseOcspResponseResult, type ParseOptions, type ParsePfxErrorCode, type ParsePfxFailure, type ParsePfxOptions, type ParsePfxResult, type ParsePkcs12MacDataErrorCode, type ParsePkcs12MacDataFailure, type ParsePkcs12MacDataOptions, type ParsePkcs12MacDataResult, type ParsePkcs7CertBagResult, type ParsePkcs7ErrorCode, type ParsePkcs7Failure, type ParsePkcs7SignedDataResult, type ParsedBitFlags, type ParsedCertificate, type ParsedCertificateChoice, type ParsedCertificateRevocationList, type ParsedCertificateSigningRequest, type ParsedDistributionPoint, type ParsedDistributionPointName, type ParsedExtension, type ParsedIssuingDistributionPoint, type ParsedIssuingDistributionPointBase, type ParsedIssuingDistributionPointScope, type ParsedName, type ParsedNameAttribute, type ParsedNameConstraintForm, type ParsedOcspCertId, type ParsedOcspCertStatus, type ParsedOcspRequest, type ParsedOcspResponderId, type ParsedOcspResponse, type ParsedOcspSingleResponse, type ParsedPfx, type ParsedPfxAttribute, type ParsedPfxBag, type ParsedPfxBagAttributes, type ParsedPkcs12MacData, type ParsedPkcs7SignedData, type ParsedPkcs7SignerInfo, type ParsedPkcs7SignerInfoBase, type ParsedRelativeDistinguishedName, type ParsedRevocationReason, type ParsedRevokedCertificate, type ParsedSignerIdentifier, type Pbes2Parameters, type PemBlock, type PemDecodeResult, type PemErrorCode, type PemFailure, type PfxBagAttributesInput, type PfxCertificateBagInput, type PfxCertificateSource, type PfxEncoderErrorCode, type PfxEncryptionOptions, type PfxMaterial, type PfxPrivateKeyBagInput, type PfxPrivateKeySource, type Pkcs12MacOptions, type Pkcs7CertBagMaterial, type Pkcs7CertificateSource, type Pkcs7SignedDataMaterial, type Pkcs7Signer, type PolicyConstraints, type PolicyInformation, type PolicyMapping, type PolicyMappings, type PolicyQualifierInfo, type PolicyValidationInput, type PolicyValidationOutcome, type PrivateKeyImportInput, type PublicKeyImportInput, REVOCATION_INDETERMINATE_REASONS, REVOCATION_INDETERMINATE_REASON_CODES, type RelativeDistinguishedNameInput, type ResolveOcspResponderCandidatesInput, type Result, type ResultError, type RevocationCertificateSource, type RevocationCheckGoodValue, type RevocationCheckIndeterminateValue, type RevocationCheckRevokedValue, type RevocationCheckSkippedValue, 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 RevocationSkipReason, 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 SignatureVerifier, type SignatureVerifierInput, type SignatureVerifiers, type SplitPemBlocksResult, type SrvServiceIdentityInput, type SubjectAltName, type SubjectAltNameTextOptions, type SupersededDeltaCrlPolicy, 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 VerifiedPolicyOutcome, type VerifyCertificateChainInput, type VerifyCertificateRevocationListSignatureFailure, type VerifyCertificateRevocationListSignatureOptions, type VerifyCertificateRevocationListSignatureResult, type VerifyCertificateSigningRequestOptions, type VerifyChainFailure, type VerifyChainResult, type VerifyErrorCode, type VerifyFailureDetails, type VerifyFailureSource, type VerifyOcspResponseSignatureFailure, type VerifyOcspResponseSignatureOptions, type VerifyOcspResponseSignatureResult, type VerifyPkcs7SignedDataErrorCode, type VerifyPkcs7SignedDataFailure, type VerifyPkcs7SignedDataOptions, type VerifyPkcs7SignedDataResult, type VerifyPurpose, type VerifyRequestFailure, type VerifyRequestResult, buildCandidatePath, categorizePemBlocks, categorizePemBlocksOrThrow, certificateFingerprint, certificateMatchesPrivateKey, checkCertificateRevocation, checkCertificateRevocationAgainstCrl, checkChainRevocation, checkExtendedKeyUsage, compareDistinguishedNames, createCertificate, createCertificateRevocationList, createCertificateSigningRequest, createOcspRequest, createOcspResponse, createPfx, createPkcs7CertBag, createPkcs7SignedData, createSelfSignedCertificate, decodeExtension, decodeExtensionMap, decodeExtensions, decryptRsaOaep, decryptRsaOaepOrThrow, defineExtensionDecoder, defineExtensionDecoderMap, derivePublicKey, distinguishedNameToString, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, findExtension, generateKeyPair, getCertificateOcspResponderUris, getSubjectPublicKey, getSubjectPublicKeyOrThrow, hasOcspNoCheckExtension, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPrivateKeyPem, importPrivateKeyPemOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, inspectEncryptedPkcs8Der, isCertificateRevoked, isResultError, isSelfIssued as isSelfIssuedCertificate, matchCertificatePrivateKey, matchCertificateServiceIdentity, matchServiceIdentity, parseCertificateChainPem, parseCertificateChainPemOrThrow, parseCertificateDer, parseCertificateDerOrThrow, parseCertificateFromSource, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseCertificatesFromSource, parseDistinguishedNameDer, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, parsePfxDer, parsePfxPem, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, pemDecode, pemDecodeOrThrow, pemEncode, relativeDistinguishedNameToString, resolveOcspResponderCandidates, revocationReasonFromCode, splitPemBlocks, splitPemBlocksOrThrow, subjectAltNameLabel, subjectAltNameToString, subjectPublicKeyInfoFingerprint, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
|
|
94
|
+
export { type AuthorityInformationAccess, type AuthorityInformationAccessInput, type BasicConstraints, type BuildCandidatePathInput, type BuildCandidatePathResult, type CandidatePath, type CandidatePathAnchor, type CandidatePathCertificates, type CategorizePemBlocksResult, type CategorizedPemBlocks, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CertificateRevocationListMaterial, type CertificateRevocationStatus, type CertificateSource, type ChainRevocationInput, type CheckCertificateRevocationAgainstCrlErrorCode, type CheckCertificateRevocationAgainstCrlFailure, type CheckCertificateRevocationAgainstCrlFailureDetails, type CheckCertificateRevocationAgainstCrlGoodValue, type CheckCertificateRevocationAgainstCrlInput, type CheckCertificateRevocationAgainstCrlResult, type CheckCertificateRevocationAgainstCrlRevokedValue, type CheckCertificateRevocationAgainstCrlValue, type CheckCertificateRevocationErrorCode, type CheckCertificateRevocationFailureDetails, type CheckCertificateRevocationInput, type CheckCertificateRevocationResult, type CheckCertificateRevocationValue, type CheckChainRevocationInput, type CheckChainRevocationResult, type CheckChainRevocationValue, type ConfiguredOcspResponder, type ConfiguredOcspResponderCertificate, type ConstrainedPolicy, type CreateCertificateErrorCode, type CreateCertificateInput, type CreateCertificateRevocationListInput, type CreateCsrInput, type CreateOcspCertStatusInput, type CreateOcspRequestInput, type CreateOcspRequestItemInput, type CreateOcspResponseInput, type CreateOcspSingleResponseInput, type CreatePfxErrorCode, type CreatePfxFailure, type CreatePfxInput, type CreatePfxResult, type CreatePkcs12MacDataErrorCode, type CreatePkcs7CertBagErrorCode, type CreatePkcs7CertBagFailure, type CreatePkcs7CertBagResult, type CreatePkcs7SignedDataErrorCode, type CreatePkcs7SignedDataFailure, type CreatePkcs7SignedDataInput, type CreatePkcs7SignedDataResult, type CreateSelfSignedCertificateBase, type CreateSelfSignedCertificateInput, type CrlApplicabilityFailureReason, type CrlCertificateSource, type CrlEncoderErrorCode, type CrlSource, type CsrMaterial, type CsrSource, DECODE_REFUSAL_CODES, type DecodeFailureCode, type DecodeRefusalCode, type DecodedExtensionMap, type DecodedExtensionValue, type DecryptRsaOaepErrorCode, type DecryptRsaOaepFailure, type DecryptRsaOaepResult, type DisplayTextType, type DistributionPoint, type DistributionPointName, type DnsServiceIdentityInput, type EcKeyAlgorithmInput, type EcNamedCurve, type Ed25519KeyAlgorithmInput, type EkuCheckFailure, type EkuCheckPurpose, type EkuCheckResult, type EncryptRsaOaepErrorCode, type EncryptRsaOaepFailure, type EncryptRsaOaepResult, type EncryptedPkcs8Options, type ErrorResult, type ExtendedKeyUsage, type ExtensionDecoder, type ExtensionDecoderMap, type ExtensionEncoderErrorCode, type GeneralName, type GeneralSubtree, type ImportEcKeyInput, type ImportEd25519KeyInput, type ImportEncryptedKeyErrorCode, type ImportEncryptedKeyFailure, type ImportEncryptedKeyOptions, type ImportEncryptedKeyResult, type ImportKeyErrorCode, type ImportKeyErrorDetails, type ImportKeyFailure, type ImportKeyReason, type ImportKeyResult, type ImportKeyStage, type ImportRsaKeyInput, type IndexedErrorResult, type IndexedMicro509Error, type InhibitAnyPolicy, type InitialNameConstraintsInput, type IpServiceIdentityInput, type IssuingDistributionPoint, type IssuingDistributionPointBase, type IssuingDistributionPointForAttributeCerts, type IssuingDistributionPointForCaCerts, type IssuingDistributionPointForUserCerts, type KdfLimitOptions, type KeyAlgorithmInput, type KeyPairMaterial, type KeyUsage, type LegacyPemEncryptionOptions, type MatchCertificatePrivateKeyErrorCode, type MatchCertificatePrivateKeyFailure, type MatchCertificatePrivateKeyFailureResult, type MatchCertificatePrivateKeyResult, type MatchCertificatePrivateKeySuccess, type MatchServiceIdentityErrorCode, type MatchServiceIdentityFailure, type MatchServiceIdentityFailureDetails, type MatchServiceIdentityFailureResult, type MatchServiceIdentityInput, type MatchServiceIdentityResult, type MatchServiceIdentitySuccess, type Micro509Error, type NameAttribute, type NameConstraintForm, type NameConstraints, type NameEncoderErrorCode, type NameFieldKey, type NameInput, type NameObject, type OcspCertStatus, type OcspCertificateSource, type OcspEncoderErrorCode, type OcspHashAlgorithm, type OcspRequestMaterial, type OcspRequestSource, type OcspResponderCandidate, type OcspResponderRevocationPolicy, type OcspResponderSource, type OcspResponseMaterial, type OcspResponseSource, type OcspResponseStatus, type OversizedDisplayText, type ParseCertificateChainResult, type ParseCertificateErrorCode, type ParseCertificateFailure, type ParseCertificateResult, type ParseCertificateRevocationListErrorCode, type ParseCertificateRevocationListFailure, type ParseCertificateRevocationListResult, type ParseCertificateSigningRequestErrorCode, type ParseCertificateSigningRequestFailure, type ParseCertificateSigningRequestResult, type ParseOcspRequestErrorCode, type ParseOcspRequestFailure, type ParseOcspRequestResult, type ParseOcspResponseErrorCode, type ParseOcspResponseFailure, type ParseOcspResponseResult, type ParseOptions, type ParsePfxErrorCode, type ParsePfxFailure, type ParsePfxOptions, type ParsePfxResult, type ParsePkcs12MacDataErrorCode, type ParsePkcs12MacDataFailure, type ParsePkcs12MacDataOptions, type ParsePkcs12MacDataResult, type ParsePkcs7CertBagResult, type ParsePkcs7ErrorCode, type ParsePkcs7Failure, type ParsePkcs7SignedDataResult, type ParsedBitFlags, type ParsedCertificate, type ParsedCertificateChoice, type ParsedCertificateRevocationList, type ParsedCertificateSigningRequest, type ParsedDistributionPoint, type ParsedDistributionPointName, type ParsedExtension, type ParsedIssuingDistributionPoint, type ParsedIssuingDistributionPointBase, type ParsedIssuingDistributionPointScope, type ParsedName, type ParsedNameAttribute, type ParsedNameConstraintForm, type ParsedOcspCertId, type ParsedOcspCertStatus, type ParsedOcspRequest, type ParsedOcspResponderId, type ParsedOcspResponse, type ParsedOcspSingleResponse, type ParsedPfx, type ParsedPfxAttribute, type ParsedPfxBag, type ParsedPfxBagAttributes, type ParsedPkcs12MacData, type ParsedPkcs7SignedData, type ParsedPkcs7SignerInfo, type ParsedPkcs7SignerInfoBase, type ParsedRelativeDistinguishedName, type ParsedRevocationReason, type ParsedRevokedCertificate, type ParsedSignerIdentifier, type Pbes2Parameters, type PemBlock, type PemDecodeOptions, 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 RevocationCheckSkippedValue, 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 RevocationSkipReason, 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 SignatureVerifier, type SignatureVerifierInput, type SignatureVerifiers, type SplitPemBlocksResult, type SrvServiceIdentityInput, type SubjectAltName, type SubjectAltNameTextOptions, type SupersededDeltaCrlPolicy, 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 VerifiedPolicyOutcome, type VerifyCertificateChainInput, type VerifyCertificateRevocationListSignatureFailure, type VerifyCertificateRevocationListSignatureOptions, type VerifyCertificateRevocationListSignatureResult, type VerifyCertificateSigningRequestOptions, type VerifyChainFailure, type VerifyChainResult, type VerifyErrorCode, type VerifyFailureDetails, type VerifyFailureSource, type VerifyOcspResponseSignatureFailure, type VerifyOcspResponseSignatureOptions, type VerifyOcspResponseSignatureResult, type VerifyPkcs7SignedDataErrorCode, type VerifyPkcs7SignedDataFailure, type VerifyPkcs7SignedDataOptions, type VerifyPkcs7SignedDataResult, type VerifyPurpose, type VerifyRequestFailure, type VerifyRequestResult, buildCandidatePath, categorizePemBlocks, categorizePemBlocksOrThrow, certificateFingerprint, certificateMatchesPrivateKey, checkCertificateRevocation, checkCertificateRevocationAgainstCrl, checkChainRevocation, checkExtendedKeyUsage, compareDistinguishedNames, createCertificate, createCertificateRevocationList, createCertificateSigningRequest, createOcspRequest, createOcspResponse, createPfx, createPkcs7CertBag, createPkcs7SignedData, createSelfSignedCertificate, decodeExtension, decodeExtensionMap, decodeExtensions, decryptRsaOaep, decryptRsaOaepOrThrow, defineExtensionDecoder, defineExtensionDecoderMap, derivePublicKey, distinguishedNameToString, encryptRsaOaep, encryptRsaOaepOrThrow, exportBinaryBase64, exportEncryptedPkcs1Pem, exportEncryptedPkcs8Der, exportEncryptedPkcs8Pem, exportEncryptedSec1Pem, exportPkcs1Der, exportPkcs1Pem, exportPkcs8Der, exportPkcs8Pem, exportPrivateJwk, exportPublicJwk, exportSec1Der, exportSec1Pem, exportSpkiDer, exportSpkiPem, findExtension, generateKeyPair, getCertificateOcspResponderUris, getSubjectPublicKey, getSubjectPublicKeyOrThrow, hasOcspNoCheckExtension, importEncryptedPkcs1Pem, importEncryptedPkcs1PemOrThrow, importEncryptedPkcs8Der, importEncryptedPkcs8DerOrThrow, importEncryptedPkcs8Pem, importEncryptedPkcs8PemOrThrow, importEncryptedSec1Pem, importEncryptedSec1PemOrThrow, importPkcs1Der, importPkcs1DerOrThrow, importPkcs1Pem, importPkcs1PemOrThrow, importPkcs8Base64, importPkcs8Base64OrThrow, importPkcs8Der, importPkcs8DerOrThrow, importPkcs8Pem, importPkcs8PemOrThrow, importPrivateJwk, importPrivateJwkOrThrow, importPrivateKeyPem, importPrivateKeyPemOrThrow, importPublicJwk, importPublicJwkOrThrow, importSec1Der, importSec1DerOrThrow, importSec1Pem, importSec1PemOrThrow, importSpkiBase64, importSpkiBase64OrThrow, importSpkiDer, importSpkiDerOrThrow, importSpkiPem, importSpkiPemOrThrow, inspectEncryptedPkcs8Der, isCertificateRevoked, isResultError, isSelfIssued as isSelfIssuedCertificate, matchCertificatePrivateKey, matchCertificateServiceIdentity, matchServiceIdentity, parseCertificateChainPem, parseCertificateChainPemOrThrow, parseCertificateDer, parseCertificateDerOrThrow, parseCertificateFromSource, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateRevocationListDer, parseCertificateRevocationListDerOrThrow, parseCertificateRevocationListPem, parseCertificateRevocationListPemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseCertificatesFromSource, parseDistinguishedNameDer, parseOcspRequestDer, parseOcspRequestDerOrThrow, parseOcspRequestPem, parseOcspRequestPemOrThrow, parseOcspResponseDer, parseOcspResponseDerOrThrow, parseOcspResponsePem, parseOcspResponsePemOrThrow, parsePfxDer, parsePfxPem, parsePkcs7CertBagDer, parsePkcs7CertBagPem, parsePkcs7SignedDataDer, parsePkcs7SignedDataPem, pemDecode, pemDecodeOrThrow, pemEncode, relativeDistinguishedNameToString, resolveOcspResponderCandidates, revocationReasonFromCode, splitPemBlocks, splitPemBlocksOrThrow, subjectAltNameLabel, subjectAltNameToString, subjectPublicKeyInfoFingerprint, trustAnchorFromCertificate, unwrap, unwrapOr, validateCandidatePath, validateCertificateRevocationList, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, validateOcspResponse, verifyCertificateChain, verifyCertificateRevocationListSignature, verifyCertificateSigningRequest, verifyOcspResponseSignature, verifyPkcs7SignedData };
|
|
@@ -96,77 +96,77 @@ const e = [
|
|
|
96
96
|
15,
|
|
97
97
|
21
|
|
98
98
|
], t = [
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
0xd76aa478,
|
|
100
|
+
0xe8c7b756,
|
|
101
101
|
606105819,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
0xc1bdceee,
|
|
103
|
+
0xf57c0faf,
|
|
104
|
+
0x4787c62a,
|
|
105
|
+
0xa8304613,
|
|
106
|
+
0xfd469501,
|
|
107
|
+
0x698098d8,
|
|
108
|
+
0x8b44f7af,
|
|
109
|
+
0xffff5bb1,
|
|
110
|
+
0x895cd7be,
|
|
111
|
+
0x6b901122,
|
|
112
|
+
0xfd987193,
|
|
113
|
+
0xa679438e,
|
|
114
|
+
0x49b40821,
|
|
115
|
+
0xf61e2562,
|
|
116
|
+
0xc040b340,
|
|
117
117
|
643717713,
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
0xe9b6c7aa,
|
|
119
|
+
0xd62f105d,
|
|
120
120
|
38016083,
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
0xd8a1e681,
|
|
122
|
+
0xe7d3fbc8,
|
|
123
123
|
568446438,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
0xc33707d6,
|
|
125
|
+
0xf4d50d87,
|
|
126
|
+
0x455a14ed,
|
|
127
|
+
0xa9e3e905,
|
|
128
|
+
0xfcefa3f8,
|
|
129
|
+
0x676f02d9,
|
|
130
|
+
0x8d2a4c8a,
|
|
131
|
+
0xfffa3942,
|
|
132
|
+
0x8771f681,
|
|
133
|
+
0x6d9d6122,
|
|
134
|
+
0xfde5380c,
|
|
135
|
+
0xa4beea44,
|
|
136
|
+
0x4bdecfa9,
|
|
137
|
+
0xf6bb4b60,
|
|
138
|
+
0xbebfbc70,
|
|
139
139
|
681279174,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
0xeaa127fa,
|
|
141
|
+
0xd4ef3085,
|
|
142
142
|
76029189,
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
0xd9d4d039,
|
|
144
|
+
0xe6db99e5,
|
|
145
145
|
530742520,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
146
|
+
0xc4ac5665,
|
|
147
|
+
0xf4292244,
|
|
148
|
+
0x432aff97,
|
|
149
|
+
0xab9423a7,
|
|
150
|
+
0xfc93a039,
|
|
151
|
+
0x655b59c3,
|
|
152
|
+
0x8f0ccc92,
|
|
153
|
+
0xffeff47d,
|
|
154
|
+
0x85845dd1,
|
|
155
|
+
0x6fa87e4f,
|
|
156
|
+
0xfe2ce6e0,
|
|
157
|
+
0xa3014314,
|
|
158
|
+
0x4e0811a1,
|
|
159
|
+
0xf7537e82,
|
|
160
|
+
0xbd3af235,
|
|
161
161
|
718787259,
|
|
162
|
-
|
|
162
|
+
0xeb86d391
|
|
163
163
|
];
|
|
164
164
|
/** Compute a 16-byte MD5 digest (RFC 1321). Used by `EVP_BytesToKey` key derivation. */
|
|
165
165
|
function md5(n) {
|
|
166
166
|
let r = mdPad(n, !0), [i, a, o, s] = [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
0x67452301,
|
|
168
|
+
0xefcdab89,
|
|
169
|
+
0x98badcfe,
|
|
170
170
|
271733878
|
|
171
171
|
], c = /* @__PURE__ */ new Uint32Array(16);
|
|
172
172
|
for (let n = 0; n < r.length; n += 64) {
|
|
@@ -192,11 +192,11 @@ function md5(n) {
|
|
|
192
192
|
/** Compute a 20-byte SHA-1 digest (RFC 3174). Used by PKCS#12 MAC verification. */
|
|
193
193
|
function sha1(e) {
|
|
194
194
|
let t = mdPad(e, !1), [n, r, i, a, o] = [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
0x67452301,
|
|
196
|
+
0xefcdab89,
|
|
197
|
+
0x98badcfe,
|
|
198
198
|
271733878,
|
|
199
|
-
|
|
199
|
+
0xc3d2e1f0
|
|
200
200
|
], s = /* @__PURE__ */ new Uint32Array(80), c = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
201
201
|
for (let e = 0; e < t.length; e += 64) {
|
|
202
202
|
for (let t = 0; t < 16; t++) s[t] = c.getUint32(e + t * 4, !1);
|
|
@@ -210,7 +210,7 @@ function sha1(e) {
|
|
|
210
210
|
];
|
|
211
211
|
for (let e = 0; e < 80; e++) {
|
|
212
212
|
let n, r;
|
|
213
|
-
e <= 19 ? (n = (l & u | ~l & d) >>> 0, r =
|
|
213
|
+
e <= 19 ? (n = (l & u | ~l & d) >>> 0, r = 0x5a827999) : e <= 39 ? (n = (l ^ u ^ d) >>> 0, r = 0x6ed9eba1) : e <= 59 ? (n = (l & u | l & d | u & d) >>> 0, r = 0x8f1bbcdc) : (n = (l ^ u ^ d) >>> 0, r = 0xca62c1d6);
|
|
214
214
|
let i = rotl(t, 5) + n + f + r + w32(s, e) >>> 0;
|
|
215
215
|
f = d, d = u, u = rotl(l, 30), l = t, t = i;
|
|
216
216
|
}
|
|
@@ -52,7 +52,7 @@ function chargeKdfBudget(e, t) {
|
|
|
52
52
|
if (t > e.remaining) throw kdfIterationLimitError(t, e.remaining);
|
|
53
53
|
e.remaining -= t;
|
|
54
54
|
}
|
|
55
|
-
const h =
|
|
55
|
+
const h = 0xffffffff;
|
|
56
56
|
async function derivePbkdf2Bytes(e, t, r, i, a) {
|
|
57
57
|
assertPbkdf2IterationCount(r);
|
|
58
58
|
let o = await u().subtle.importKey("raw", n(e), "PBKDF2", !1, ["deriveBits"]);
|
|
@@ -140,7 +140,7 @@ function parsePbes2AlgorithmIdentifier(n) {
|
|
|
140
140
|
if (f && e(d.value) !== y.keyLengthBytes) throw Error("Unsupported PBKDF2 key length");
|
|
141
141
|
let b = parsePbkdf2Prf(o, p), x = e(u.value), S = new Uint8Array(l.value), C = new Uint8Array(v.value);
|
|
142
142
|
if (x < 1) throw Error(`Invalid PBES2 iterations: must be >= 1, got ${x}`);
|
|
143
|
-
if (x >
|
|
143
|
+
if (x > 0xffffffff) throw Error(`Invalid PBES2 iterations: must be <= ${h}, got ${x}`);
|
|
144
144
|
if (C.length !== 16) throw Error(`Invalid PBES2 IV: must be exactly 16 bytes, got ${C.length}`);
|
|
145
145
|
return {
|
|
146
146
|
salt: S,
|
|
@@ -151,7 +151,7 @@ function parsePbes2AlgorithmIdentifier(n) {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
function assertPbkdf2IterationCount(e) {
|
|
154
|
-
if (!Number.isInteger(e) || e < 1 || e >
|
|
154
|
+
if (!Number.isInteger(e) || e < 1 || e > 0xffffffff) throw RangeError(`Invalid iterations: must be an integer from 1 to ${h}, got ${e}`);
|
|
155
155
|
}
|
|
156
156
|
/** Extracts the KDF and encryption-scheme fields from a PBES2 AlgorithmIdentifier. */
|
|
157
157
|
function parsePbes2OuterFields(e) {
|
|
@@ -175,7 +175,7 @@ function isAscii(e) {
|
|
|
175
175
|
* running Unicode version rather than 3.2.
|
|
176
176
|
*/
|
|
177
177
|
function isProhibited(e) {
|
|
178
|
-
return inRanges(e, t) || e >= 57344 && e <= 63743 || e >= 983040 && e <=
|
|
178
|
+
return inRanges(e, t) || e >= 57344 && e <= 63743 || e >= 983040 && e <= 0xffffd || e >= 1048576 && e <= 1114109 || e >= 55296 && e <= 57343 || e >= 64976 && e <= 65007 || (e & 65535) >= 65534 || e === 65533;
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
181
|
* RFC 4518 §2.2 Map against the Unicode 3.2 repertoire: delete ignorable code
|
|
@@ -3688,7 +3688,7 @@ const e = [
|
|
|
3688
3688
|
194560,
|
|
3689
3689
|
195101,
|
|
3690
3690
|
983040,
|
|
3691
|
-
|
|
3691
|
+
0xffffd,
|
|
3692
3692
|
1048576,
|
|
3693
3693
|
1114109
|
|
3694
3694
|
], i = [
|
|
@@ -4390,8 +4390,8 @@ const e = [
|
|
|
4390
4390
|
921599,
|
|
4391
4391
|
983038,
|
|
4392
4392
|
983039,
|
|
4393
|
-
|
|
4394
|
-
|
|
4393
|
+
0xffffe,
|
|
4394
|
+
0xfffff,
|
|
4395
4395
|
1114110,
|
|
4396
4396
|
1114111
|
|
4397
4397
|
], p = [
|
|
@@ -2,7 +2,7 @@ import { deriveArgon2TypeScript as e } from "./argon2-core.js";
|
|
|
2
2
|
// src/kdf/argon2-portable.ts
|
|
3
3
|
/** Internal TypeScript backend; the public boundary validates inputs and limits. */
|
|
4
4
|
async function portableArgon2(t) {
|
|
5
|
-
return t.memoryKiB * 1024 + t.outputBytes + t.password.byteLength + t.salt.byteLength + (t.secret?.byteLength ?? 0) + (t.associatedData?.byteLength ?? 0) >=
|
|
5
|
+
return t.memoryKiB * 1024 + t.outputBytes + t.password.byteLength + t.salt.byteLength + (t.secret?.byteLength ?? 0) + (t.associatedData?.byteLength ?? 0) >= 0x80000000 ? {
|
|
6
6
|
ok: !1,
|
|
7
7
|
error: {
|
|
8
8
|
code: "unsupported",
|
package/dist/kdf/argon2.js
CHANGED
|
@@ -14,7 +14,7 @@ function uintInRange(e, t, n) {
|
|
|
14
14
|
function validate(e, t) {
|
|
15
15
|
if (e.algorithm !== "argon2id" && e.algorithm !== "argon2d" && e.algorithm !== "argon2i") return failure("unsupported", "Unsupported Argon2 variant");
|
|
16
16
|
if (e.version !== 16 && e.version !== 19) return failure("unsupported", "Unsupported Argon2 version");
|
|
17
|
-
if (!uintInRange(e.parallelism, 1,
|
|
17
|
+
if (!uintInRange(e.parallelism, 1, 0xffffff) || !uintInRange(e.memoryKiB, 8 * e.parallelism, 0xffffffff) || !uintInRange(e.passes, 1, 0xffffffff) || !uintInRange(e.outputBytes, 4, 0xffffffff)) return failure("invalid_parameters", "Invalid Argon2 numeric parameters");
|
|
18
18
|
let n = [
|
|
19
19
|
e.password,
|
|
20
20
|
e.salt,
|
|
@@ -34,7 +34,7 @@ function validate(e, t) {
|
|
|
34
34
|
[e.outputBytes, t.maxOutputBytes ?? 1024],
|
|
35
35
|
[n.reduce((e, t) => e + (t?.byteLength ?? 0), 0), t.maxInputBytes ?? 1048576]
|
|
36
36
|
];
|
|
37
|
-
if (r.some(([, e]) => !uintInRange(e, 1,
|
|
37
|
+
if (r.some(([, e]) => !uintInRange(e, 1, 0xffffffff))) return failure("invalid_parameters", "Argon2 resource limits must be positive uint32 values");
|
|
38
38
|
if (r.some(([e, t]) => e > t)) return failure("limit_exceeded", "Argon2 request exceeds resource limits");
|
|
39
39
|
}
|
|
40
40
|
function snapshotInput(e) {
|
package/dist/keys/keys.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KdfLimitOptions, Pbes2EncryptionOptions, Pbes2EncryptionScheme, Pbes2Parameters, Pbes2Prf, parsePbes2AlgorithmIdentifier } from "../internal/crypto/pbes2.js";
|
|
2
|
+
import { PemDecodeOptions } from "../pem/pem.js";
|
|
2
3
|
import { DecodeFailureCode, ErrorResult, Micro509Error } from "../result/result.js";
|
|
3
4
|
/** Hash algorithm paired with an RSA key. */
|
|
4
5
|
export type RsaHash = "SHA-256" | "SHA-384" | "SHA-512";
|
|
@@ -544,6 +545,9 @@ export declare function importPkcs8Der(der: Uint8Array, algorithm?: PrivateKeyIm
|
|
|
544
545
|
*
|
|
545
546
|
* When `algorithm` is omitted, it is inferred from the key's own
|
|
546
547
|
* `privateKeyAlgorithm` (see {@linkcode importPkcs8DerOrThrow}).
|
|
548
|
+
* Set `options.wholeInput` to require that the input consists of one
|
|
549
|
+
* unencrypted `PRIVATE KEY` block. PEM decoding and key import failures
|
|
550
|
+
* reject the returned promise in either mode.
|
|
547
551
|
*
|
|
548
552
|
* @example
|
|
549
553
|
* ```ts
|
|
@@ -551,13 +555,14 @@ export declare function importPkcs8Der(der: Uint8Array, algorithm?: PrivateKeyIm
|
|
|
551
555
|
* const inferred = await importPkcs8PemOrThrow(pemString);
|
|
552
556
|
* ```
|
|
553
557
|
*/
|
|
554
|
-
export declare function importPkcs8PemOrThrow(pem: string, algorithm?: PrivateKeyImportInput): Promise<CryptoKey>;
|
|
558
|
+
export declare function importPkcs8PemOrThrow(pem: string, algorithm?: PrivateKeyImportInput, options?: PemDecodeOptions): Promise<CryptoKey>;
|
|
555
559
|
/**
|
|
556
560
|
* Import a private key from PEM-encoded PKCS#8 PrivateKeyInfo.
|
|
561
|
+
* Set `options.wholeInput` to require one complete `PRIVATE KEY` block.
|
|
557
562
|
*
|
|
558
563
|
* @see `importPkcs8PemOrThrow` for the throwing variant
|
|
559
564
|
*/
|
|
560
|
-
export declare function importPkcs8Pem(pem: string, algorithm?: PrivateKeyImportInput): Promise<ImportKeyResult<CryptoKey>>;
|
|
565
|
+
export declare function importPkcs8Pem(pem: string, algorithm?: PrivateKeyImportInput, options?: PemDecodeOptions): Promise<ImportKeyResult<CryptoKey>>;
|
|
561
566
|
/**
|
|
562
567
|
* Import a private key from DER-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.
|
|
563
568
|
*
|
package/dist/keys/keys.js
CHANGED
|
@@ -417,8 +417,8 @@ async function importBackendStage(e, t) {
|
|
|
417
417
|
return t instanceof TypeError && throwImportFailure(e, "backend", "backend_rejected"), refuseImportStage(t, e, "backend", "backend_rejected");
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function importPemBytes(e, t, n) {
|
|
421
|
-
return importStage(e, "pem", "invalid_armor", () => j(t, n));
|
|
420
|
+
function importPemBytes(e, t, n, r) {
|
|
421
|
+
return importStage(e, "pem", "invalid_armor", () => j(t, n, r));
|
|
422
422
|
}
|
|
423
423
|
function importBase64Bytes(e, t) {
|
|
424
424
|
return importStage(e, "base64", "invalid_base64", () => O(t));
|
|
@@ -579,6 +579,9 @@ function importPkcs8Der(e, t) {
|
|
|
579
579
|
*
|
|
580
580
|
* When `algorithm` is omitted, it is inferred from the key's own
|
|
581
581
|
* `privateKeyAlgorithm` (see {@linkcode importPkcs8DerOrThrow}).
|
|
582
|
+
* Set `options.wholeInput` to require that the input consists of one
|
|
583
|
+
* unencrypted `PRIVATE KEY` block. PEM decoding and key import failures
|
|
584
|
+
* reject the returned promise in either mode.
|
|
582
585
|
*
|
|
583
586
|
* @example
|
|
584
587
|
* ```ts
|
|
@@ -586,16 +589,17 @@ function importPkcs8Der(e, t) {
|
|
|
586
589
|
* const inferred = await importPkcs8PemOrThrow(pemString);
|
|
587
590
|
* ```
|
|
588
591
|
*/
|
|
589
|
-
function importPkcs8PemOrThrow(e, t) {
|
|
590
|
-
return importPkcs8DerOrThrow(importPemBytes("pkcs8", "PRIVATE KEY", e), t);
|
|
592
|
+
async function importPkcs8PemOrThrow(e, t, n) {
|
|
593
|
+
return await importPkcs8DerOrThrow(importPemBytes("pkcs8", "PRIVATE KEY", e, n), t);
|
|
591
594
|
}
|
|
592
595
|
/**
|
|
593
596
|
* Import a private key from PEM-encoded PKCS#8 PrivateKeyInfo.
|
|
597
|
+
* Set `options.wholeInput` to require one complete `PRIVATE KEY` block.
|
|
594
598
|
*
|
|
595
599
|
* @see `importPkcs8PemOrThrow` for the throwing variant
|
|
596
600
|
*/
|
|
597
|
-
function importPkcs8Pem(e, t) {
|
|
598
|
-
return importResult(() => importPkcs8PemOrThrow(e, t));
|
|
601
|
+
function importPkcs8Pem(e, t, n) {
|
|
602
|
+
return importResult(() => importPkcs8PemOrThrow(e, t, n));
|
|
599
603
|
}
|
|
600
604
|
/**
|
|
601
605
|
* Import a private key from DER-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.
|