micro509
Stable root import for micro509.
Re-exports the common certificate, parsing, verification, revocation, key, and PKCS workflows from one package entrypoint.
Reach for this module when you want the default workflow-first package surface. Use domain entrypoints such as micro509/x509, micro509/verify, and micro509/revocation when you need exhaustive advanced types.
The root export is organized around common PKI flows:
- create certificates, CSRs, CRLs, OCSP responses, PKCS#7, and PFX artifacts
- parse DER or PEM inputs into typed certificate and request shapes
- verify certificate chains, service identities, CRLs, OCSP, and signed data
- import, export, generate, and encrypt key material with WebCrypto-safe algorithms
- work with the common extension inputs, revocation evidence, and validation results
Advanced PKCS#12 MAC plumbing, signature profile tuning, and other domain-specific helper types stay in their owner domains instead of being headlined here.
Examples
ts
import {
createSelfSignedCertificate,
parseCertificatePem,
unwrap,
verifyCertificateChain,
} from 'micro509';
const { certificate } = await createSelfSignedCertificate({
subject: { commonName: 'example.com' },
algorithm: { kind: 'ecdsa', curve: 'P-256' },
});
const parsed = unwrap(parseCertificatePem(certificate.pem));
// parsed.subject.values.commonName === 'example.com'
const result = await verifyCertificateChain({
leaf: certificate.pem,
roots: [certificate.pem],
allowSelfSignedLeaf: true,
});
// result.ok === truets
import {
generateKeyPair,
parseCertificateSigningRequestPem,
createCertificateSigningRequest,
unwrap,
} from 'micro509';
const keyPair = await generateKeyPair({ kind: 'ecdsa', curve: 'P-256' });
const csr = await createCertificateSigningRequest({
subject: { commonName: 'example.com' },
publicKey: keyPair.publicKey,
signerPrivateKey: keyPair.privateKey,
});
const parsed = unwrap(parseCertificateSigningRequestPem(csr.pem));
// parsed.subject.values.commonName === 'example.com'Functions
decryptRsaOaep— Decrypt an RSA-OAEP ciphertext with the matching private key.decryptRsaOaepOrThrow— Decrypt an RSA-OAEP ciphertext with the matching private key.derivePublicKey— Derive the matching public key from an imported (or generated) private key.encryptRsaOaep— Encrypt a small message with an RSA-OAEP public key.encryptRsaOaepOrThrow— Encrypt a small message with an RSA-OAEP public key.exportBinaryBase64— Export a key as raw base64 (no PEM headers).exportEncryptedPkcs1Pem— Export an RSA private key as legacyProc-Type: 4,ENCRYPTEDPEM (PKCS#1).exportEncryptedPkcs8Der— Export a private key as DER-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.exportEncryptedPkcs8Pem— Export a private key as PEM-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.exportEncryptedSec1Pem— Export an EC private key as legacyProc-Type: 4,ENCRYPTEDPEM (SEC 1).exportPkcs1Der— Export an RSA private key as DER-encoded PKCS#1 RSAPrivateKey.exportPkcs1Pem— Export an RSA private key as PEM-encoded PKCS#1 RSAPrivateKey.exportPkcs8Der— Export a private key as DER-encoded PKCS#8 PrivateKeyInfo.exportPkcs8Pem— Export a private key as PEM-encoded PKCS#8 PrivateKeyInfo.exportPrivateJwk— Export a private key as a JSON Web Key.exportPublicJwk— Export a public key as a JSON Web Key.exportSec1Der— Export an EC private key as DER-encoded SEC 1 ECPrivateKey.exportSec1Pem— Export an EC private key as PEM-encoded SEC 1 ECPrivateKey.exportSpkiDer— Export a public key as DER-encoded SubjectPublicKeyInfo.exportSpkiPem— Export a public key as PEM-encoded SubjectPublicKeyInfo.generateKeyPair— Generate an asymmetric key pair for signing and verification, or — withimportEncryptedPkcs1Pem— Import an RSA private key from legacyProc-Type: 4,ENCRYPTEDPEM (PKCS#1).importEncryptedPkcs1PemOrThrow— Import an RSA private key from legacyProc-Type: 4,ENCRYPTEDPEM (PKCS#1).importEncryptedPkcs8Der— Import a private key from DER-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.importEncryptedPkcs8DerOrThrow— Import a private key from DER-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.importEncryptedPkcs8Pem— Import a private key from PEM-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.importEncryptedPkcs8PemOrThrow— Import a private key from PEM-encoded PBES2-encrypted PKCS#8 EncryptedPrivateKeyInfo.importEncryptedSec1Pem— Import an EC private key from legacyProc-Type: 4,ENCRYPTEDPEM (SEC 1).importEncryptedSec1PemOrThrow— Import an EC private key from legacyProc-Type: 4,ENCRYPTEDPEM (SEC 1).importPkcs1Der— Import an RSA private key from DER-encoded PKCS#1 RSAPrivateKey.importPkcs1DerOrThrow— Import an RSA private key from DER-encoded PKCS#1 RSAPrivateKey.importPkcs1Pem— Import an RSA private key from PEM-encoded PKCS#1 RSAPrivateKey.importPkcs1PemOrThrow— Import an RSA private key from PEM-encoded PKCS#1 RSAPrivateKey.importPkcs8Base64— Import a private key from base64-encoded PKCS#8 PrivateKeyInfo (no PEM headers).importPkcs8Base64OrThrow— Import a private key from base64-encoded PKCS#8 PrivateKeyInfo (no PEM headers).importPkcs8Der— Import a private key from DER-encoded PKCS#8 PrivateKeyInfo.importPkcs8DerOrThrow— Import a private key from DER-encoded PKCS#8 PrivateKeyInfo.importPkcs8Pem— Import a private key from PEM-encoded PKCS#8 PrivateKeyInfo.importPkcs8PemOrThrow— Import a private key from PEM-encoded PKCS#8 PrivateKeyInfo.importPrivateJwk— Import a private signing key from a JSON Web Key.importPrivateJwkOrThrow— Import a private signing key from a JSON Web Key.importPublicJwk— Import a public verification key from a JSON Web Key.importPublicJwkOrThrow— Import a public verification key from a JSON Web Key.importSec1Der— Import an EC private key from DER-encoded SEC 1 ECPrivateKey.importSec1DerOrThrow— Import an EC private key from DER-encoded SEC 1 ECPrivateKey.importSec1Pem— Import an EC private key from PEM-encoded SEC 1 ECPrivateKey.importSec1PemOrThrow— Import an EC private key from PEM-encoded SEC 1 ECPrivateKey.importSpkiBase64— Import a public key from base64-encoded SubjectPublicKeyInfo (no PEM headers).importSpkiBase64OrThrow— Import a public key from base64-encoded SubjectPublicKeyInfo (no PEM headers).importSpkiDer— Import a public key from DER-encoded SubjectPublicKeyInfo.importSpkiDerOrThrow— Import a public key from DER-encoded SubjectPublicKeyInfo.importSpkiPem— Import a public key from PEM-encoded SubjectPublicKeyInfo.importSpkiPemOrThrow— Import a public key from PEM-encoded SubjectPublicKeyInfo.inspectEncryptedPkcs8Der— Reads the PBES2 encryption parameters of a DER PKCS#8categorizePemBlocks— Groups PEM blocks by label into well-known PKI categoriescategorizePemBlocksOrThrow— Groups PEM blocks by label into well-known PKI categoriespemDecode— Extracts and base64-decodes the DER content from a PEM string.pemDecodeOrThrow— Throwing core forpemDecode: extracts and base64-decodes thepemEncode— Wraps DER bytes in a PEM envelope with 64-character base64 lines.splitPemBlocks— Finds allBEGIN/END-delimited PEM blocks in a string and returns themsplitPemBlocksOrThrow— Finds allBEGIN/END-delimited PEM blocks in a string and returnscreatePfx— Builds a PKCS#12/PFX archive containing certificates and/or private keys.createPkcs7CertBag— Creates a degenerate PKCS#7 SignedData structure containing onlycreatePkcs7SignedData— Creates a PKCS#7/CMS SignedData with one or more signers overcontent.parsePfxDer— Decodes a BER- or DER-encoded PKCS#12/PFX container into its constituent bags.parsePfxPem— Decodes a PEM-armored PKCS#12/PFX container. Expects exactly onePKCS12block.parsePkcs7CertBagDer— Parses a DER-encoded PKCS#7 cert bag, returning the contained certificates.parsePkcs7CertBagPem— Parses a PEM-armored PKCS#7/CMS cert bag. Expects exactly onePKCS7orCMSPEM block.parsePkcs7SignedDataDer— Decodes a DER-encoded PKCS#7 ContentInfo expectingsignedDatacontent type.parsePkcs7SignedDataPem— Decodes a PEM-armored PKCS#7/CMS SignedData. Expects exactly onePKCS7orCMSPEM block.verifyPkcs7SignedData— Verifies all signer signatures in a PKCS#7 SignedData structure.isResultError— Type guard: wasvaluethrown by unwrap? Narrows to ResultError.unwrap— Explicit escape hatch: returns the success value, or throws a ResultError carrying the structured failure.unwrapOr— Returns the success value, orfallbackwhen the result is a failure.checkCertificateRevocation— Evaluates all provided CRL and OCSP evidence to determine the certificate'scheckCertificateRevocationAgainstCrl— End-to-end revocation check: validates the CRL (and optional delta CRL),checkChainRevocation— Checks revocation status for all certificates in a validated chain.createCertificateRevocationList— Signs and encodes an X.509 v2 CRL.createOcspRequest— Builds a DER-encoded OCSP request containing one or more CertID entriescreateOcspResponse— Signs and encodes an OCSP BasicResponse with asuccessfulstatus.getCertificateOcspResponderUris— Extracts OCSP responder URIs from the certificate's Authority Information Access extension.hasOcspNoCheckExtension— Reports whether a certificate carries theid-pkix-ocsp-nocheckextensionisCertificateRevoked— Quick serial-number lookup — returnstrueif the serial appears in theparseCertificateRevocationListDer— Decodes a DER-encoded X.509 CRL into a structuredParsedCertificateRevocationList.parseCertificateRevocationListDerOrThrow— Throwing core forparseCertificateRevocationListDer.parseCertificateRevocationListPem— Decodes a PEM-encoded X.509 CRL (-----BEGIN X509 CRL-----).parseCertificateRevocationListPemOrThrow— Decodes a PEM-encoded X.509 CRL (-----BEGIN X509 CRL-----).parseOcspRequestDer— Decodes a DER-encoded OCSP request into a structuredParsedOcspRequest.parseOcspRequestDerOrThrow— Throwing core forparseOcspRequestDer.parseOcspRequestPem— Decodes a PEM-encoded OCSP request (-----BEGIN OCSP REQUEST-----).parseOcspRequestPemOrThrow— Decodes a PEM-encoded OCSP request (-----BEGIN OCSP REQUEST-----).parseOcspResponseDer— Decodes a DER-encoded OCSP response into a structuredParsedOcspResponse.parseOcspResponseDerOrThrow— Throwing core forparseOcspResponseDer.parseOcspResponsePem— Decodes a PEM-encoded OCSP response (-----BEGIN OCSP RESPONSE-----).parseOcspResponsePemOrThrow— Decodes a PEM-encoded OCSP response (-----BEGIN OCSP RESPONSE-----).resolveOcspResponderCandidates— Merges configured OCSP responders with those discovered from the certificate'srevocationReasonFromCode— Maps an integer CRLReason code to itsRevocationReasonname, or tovalidateCertificateRevocationList— Full CRL validation: issuer name match, authority key identifier match,validateOcspResponse— Full OCSP response validation: response status check, signature verification,verifyCertificateRevocationListSignature— Verifies the CRL signature against the issuer certificate's public key.verifyOcspResponseSignature— Verifies the OCSP response signature against the given signer certificate.buildCandidatePath— Builds a signature-verified path from a leaf certificate to a trusted root.checkExtendedKeyUsage— Standalone EKU check against a verified certificate chain.isSelfIssuedCertificate— Returnstrueif the certificate's subject and issuer DNs are semantically equal (RFC 5280 §7.1).matchCertificateServiceIdentity— Compares a reference identifier against a certificate's SAN entries.matchServiceIdentity— Checks whether a certificate covers the requested service identity.trustAnchorFromCertificate— Extracts aTrustAnchorfrom a parsed certificate, copying the subject, SPKI, and key identifiers.validateCandidatePath— Validates a pre-built certificate chain for time, constraints, policy, andvalidateForCa— Validates a certificate chain for CA use:validateForCodeSigning— Validates a certificate chain for code signing:validateForTlsClient— Validates a certificate chain for TLS client use:validateForTlsServer— Validates a certificate chain for TLS server use:verifyCertificateChain— All-in-one certificate chain verification: builds a candidate path thenverifyCertificateSigningRequest— Verifies the self-signature of a PKCS#10 certificate signing request.certificateFingerprint— Compute a certificate fingerprint — a hash over the DER encoding.certificateMatchesPrivateKey— Check whether a certificate's subject public key belongs to a private key.compareDistinguishedNames— RFC 5280 §7.1 semantic equality: same RDN count, each pair matches attribute-by-attribute.createCertificate— Create an X.509 certificate signed byinput.signerPrivateKey.createCertificateSigningRequest— Creates a PKCS#10 Certificate Signing Request signed with the given private key.createSelfSignedCertificate— Create a self-signed certificate.decodeExtension— Decode a single extension using a customExtensionDecoder.decodeExtensionMap— Decode all matching extensions using a namedExtensionDecoderMap.decodeExtensions— Decode all matching extensions using an array ofExtensionDecoders.defineExtensionDecoder— Identity helper that narrows the type of a customExtensionDecoderliteral.defineExtensionDecoderMap— Identity helper that narrows the type of a customExtensionDecoderMapliteral.distinguishedNameToString— Renders aParsedNameas an RFC 4514 distinguished name string, e.g.CN=Example CA,O=Acme,C=US.findExtension— Find a raw extension by OID within a parsed extension list.getSubjectPublicKey— Import the subject public key of a parsed certificate or CSR as a WebCryptoCryptoKey.getSubjectPublicKeyOrThrow— Import the subject public key of a parsed certificate or CSR as a WebCryptoCryptoKey.matchCertificatePrivateKey— Check whether a certificate's subject public key belongs to a private key,parseCertificateChainPem— Decode a PEM bundle containing one or more certificates.parseCertificateChainPemOrThrow— Decode a PEM bundle containing one or more certificates, throwing on malformed input.parseCertificateDer— Decode a DER-encoded X.509 certificate into aParsedCertificate.parseCertificateDerOrThrow— Throwing core forparseCertificateDer.parseCertificateFromSource— Normalizes a PEM, DER, or already-parsed certificate source into one parsed certificate.parseCertificatePem— Decode a PEM-encoded X.509 certificate into aParsedCertificate.parseCertificatePemOrThrow— Decode a PEM-encoded X.509 certificate into aParsedCertificate.parseCertificateSigningRequestDer— Decode a DER-encoded PKCS#10 CSR into aParsedCertificateSigningRequest.parseCertificateSigningRequestDerOrThrow— Decode a DER-encoded PKCS#10 CSR into aParsedCertificateSigningRequest.parseCertificateSigningRequestPem— Decode a PEM-encoded PKCS#10 CSR into aParsedCertificateSigningRequest.parseCertificateSigningRequestPemOrThrow— Decode a PEM-encoded PKCS#10 CSR into aParsedCertificateSigningRequest.parseCertificatesFromSource— Normalizes a PEM bundle or single DER certificate source into parsed certificates.parseDistinguishedNameDer— Decodes a bare DER-encoded X.501 Name, as carried in adirectoryNameGeneralName.relativeDistinguishedNameToString— Renders oneParsedRelativeDistinguishedName, joining a multi-valued RDN's attributes with+.subjectAltNameLabel— Theopenssl x509 -textlabel for aSubjectAltNamevariant —subjectAltNameToString— Renders oneSubjectAltNameas text.subjectPublicKeyInfoFingerprint— Compute the SHA-256 fingerprint of a certificate's complete DER
Types
DecryptRsaOaepErrorCode— Machine-readable failure reason fordecryptRsaOaep.DecryptRsaOaepFailure— Structured failure payload fordecryptRsaOaep.DecryptRsaOaepResult— Success-or-failure result returned bydecryptRsaOaep.EcKeyAlgorithmInput— ECDSA variant ofKeyAlgorithmInput.EcNamedCurve— NIST elliptic curve for ECDSA keys.Ed25519KeyAlgorithmInput— Ed25519 variant ofKeyAlgorithmInput.EncryptedPkcs8Options— PBES2 encryption options for the encrypted PKCS#8 export/import functions.EncryptRsaOaepErrorCode— Machine-readable failure reason forencryptRsaOaep.EncryptRsaOaepFailure— Structured failure payload forencryptRsaOaep.EncryptRsaOaepResult— Success-or-failure result returned byencryptRsaOaep.ImportEcKeyInput— ECDSA variant ofPublicKeyImportInput/PrivateKeyImportInput.ImportEd25519KeyInput— Ed25519 variant ofPublicKeyImportInput/PrivateKeyImportInput.ImportEncryptedKeyErrorCode— Machine-readable failure reason for theimportEncrypted*key functions.ImportEncryptedKeyFailure— Structured failure payload for encrypted key import.ImportEncryptedKeyOptions— Options for the encrypted PKCS#8 import functions.ImportEncryptedKeyResult— Success-or-failure result returned by the publicimportEncrypted*key functions.ImportKeyErrorCode— Machine-readable failure reason for theimport*key functions.ImportKeyFailure— Structured failure payload for key import.ImportKeyResult— Success-or-failure result returned by the publicimport*key functions.ImportRsaKeyInput— RSA variant ofPublicKeyImportInput/PrivateKeyImportInput.KdfLimitOptions— Caller-supplied bound on password-based KDF work.KeyAlgorithmInput— Input forgenerateKeyPair. Selects algorithm family and parameters.KeyPairMaterial— Key pair with convenience export helpers. Returned bygenerateKeyPair.LegacyPemEncryptionOptions— Options for OpenSSL-styleProc-Type: 4,ENCRYPTEDPEM encryption (PKCS#1/SEC1).Pbes2Parameters— Resolved PBES2 algorithm parameters, either parsed from DER or built byencryptPbes2.PrivateKeyImportInput— Algorithm descriptor for private key import functions. Same shape asPublicKeyImportInput.PublicKeyImportInput— Algorithm descriptor for public key import functions.RsaHash— Hash algorithm paired with an RSA key.RsaKeyAlgorithmInput— RSA variant ofKeyAlgorithmInput.RsaOaepOptions— Options shared byencryptRsaOaepanddecryptRsaOaep.RsaScheme— RSA padding scheme: a signature scheme, or'oaep'for RSA-OAEP encryptionRsaSignatureScheme— RSA signature padding scheme.CategorizedPemBlocks— PEM blocks grouped by their label into well-known PKI categories.CategorizePemBlocksResult— Success-or-failure result fromcategorizePemBlocks.PemBlock— A single decoded PEM block with its label, decoded DER bytes, and original PEM text.PemDecodeResult— Success-or-failure result frompemDecode.PemErrorCode— Machine-readable failure reason for the PEM decoders.PemFailure— Structured failure payload for PEM decoding.SplitPemBlocksResult— Success-or-failure result fromsplitPemBlocks.CreatePfxErrorCode— Caller-correctable failure code fromcreatePfx.CreatePfxFailure— Error payload for a failed PFX creation.CreatePfxInput— Input forcreatePfx.CreatePfxResult— Success-or-failure result fromcreatePfx.CreatePkcs7CertBagErrorCode— Caller-correctable failure code fromcreatePkcs7CertBag.CreatePkcs7CertBagFailure— Error payload for a failed PKCS#7 certificate bag creation.CreatePkcs7CertBagResult— Success-or-failure result fromcreatePkcs7CertBag.CreatePkcs7SignedDataErrorCode— Caller-correctable failure codes fromcreatePkcs7SignedData.CreatePkcs7SignedDataFailure— Error payload for a failed PKCS#7 SignedData creation.CreatePkcs7SignedDataInput— Input forcreatePkcs7SignedData.CreatePkcs7SignedDataResult— Success-or-failure result fromcreatePkcs7SignedData.CreatePkcs12MacDataErrorCode— Machine-readable reasoncreatePkcs12MacDatarejected its construction input.ParsedCertificateChoice— One RFC 5652 §10.2.2 CertificateChoices alternative.ParsedPfx— Fully decoded PFX container returned byparsePfxDer/parsePfxPem.ParsedPfxAttribute— A single PKCS#12 bag attribute as decoded byparsePfxDer.ParsedPfxBag— Discriminated union of SafeBag types decoded from a PFX container.ParsedPfxBagAttributes— Decoded bag attributes for a single SafeBag inside a PFX.ParsedPkcs7SignedData— Decoded PKCS#7 SignedData content, including certificates and signer info.ParsedPkcs7SignerInfo— A single SignerInfo decoded from a PKCS#7 SignedData structure.ParsedPkcs7SignerInfoBase— Fields shared by every decoded SignerInfo, regardless of signed-attribute presence.ParsedPkcs12MacData— Decoded PKCS#12 MacData block returned byparsePkcs12MacData.typenames theParsedSignerIdentifier— RFC 5652 §5.3 `SignerIdentifier ::= CHOICE { issuerAndSerialNumber,ParsePfxErrorCode— Error codes returned byparsePfxDerandparsePfxPem.ParsePfxFailure— Error payload for a failed PFX parse.ParsePfxOptions— Options forparsePfxDerandparsePfxPem.ParsePfxResult— Success-or-failure result fromparsePfxDer/parsePfxPem.ParsePkcs7CertBagResult— Success-or-failure result fromparsePkcs7CertBagDer/parsePkcs7CertBagPem.ParsePkcs7ErrorCode— Error codes for PKCS#7 parse failures.ParsePkcs7Failure— Error payload for a failed PKCS#7 parse.ParsePkcs7SignedDataResult— Success-or-failure result fromparsePkcs7SignedDataDer/parsePkcs7SignedDataPem.ParsePkcs12MacDataErrorCode— Machine-readable failure reason forparsePkcs12MacData.ParsePkcs12MacDataFailure— Structured failure payload for MacData parsing.ParsePkcs12MacDataOptions— Options forparsePkcs12MacDataandparsePkcs12MacDataOrThrow.ParsePkcs12MacDataResult— Success-or-failure result fromparsePkcs12MacData.PfxBagAttributesInput— Optional metadata attached to a certificate or key bag inside a PFX.PfxCertificateBagInput— A certificate to embed in a PFX container. Input forcreatePfx.PfxCertificateSource— PEM string or DER bytes for a certificate to include in a PFX bag.PfxEncoderErrorCode— Bag attribute input thatcreatePfxrefuses by throwing aResultError.PfxEncryptionOptions— PBES2 encryption settings for PFX key-bag protection. Alias ofEncryptedPkcs8Options.PfxMaterial— DER, PEM, and base64 encodings of a PFX container produced bycreatePfx.PfxPrivateKeyBagInput— A private key to embed in a PFX container. Input forcreatePfx.PfxPrivateKeySource— A WebCrypto private key or raw PKCS#8 DER bytes for a PFX key bag.Pkcs7CertBagMaterial— DER, PEM, and base64 encodings of a PKCS#7 certificate bag.Pkcs7CertificateSource— PEM text (may contain multiple CERTIFICATE blocks), raw DER bytes, or an already-parsed certificate.Pkcs7SignedDataMaterial— DER, PEM, and base64 encodings of a PKCS#7/CMS SignedData structure.Pkcs7Signer— A single signer forcreatePkcs7SignedData.Pkcs12MacOptions— Input forcreatePkcs12MacData.typeselects the MAC:'pkcs12-kdf'(theVerifiedPkcs7Signer— A SignerInfo paired with the certificate that verified its signature.VerifyPkcs7SignedDataErrorCode— Error codes forverifyPkcs7SignedDatafailures.VerifyPkcs7SignedDataFailure— Error payload for a failedverifyPkcs7SignedDatacall.VerifyPkcs7SignedDataOptions— Options forverifyPkcs7SignedData.VerifyPkcs7SignedDataResult— Success-or-failure result fromverifyPkcs7SignedData.DecodeFailureCode— The codes a parse boundary returns for input it cannot decode:malformedand everyDecodeRefusalCode.DecodeRefusalCode— One ofDECODE_REFUSAL_CODES.ErrorResult— Failed result with a flattened code/message/details surface for ergonomic matching.IndexedErrorResult— Like ErrorResult but also carries an index into the collection that was being processed.IndexedMicro509Error— Like Micro509Error but includes a positional index for collection-processing APIs.Micro509Error— Base error shape carried by all failure results in the library.Result— Discriminatedokunion: either{ ok: true; value }or{ ok: false; error }.ResultError— Exception form of a Micro509Error: a branded Error carrying the structuredCertificateRevocationListMaterial— Encoded CRL in multiple serialisation formats, returned bycreateCertificateRevocationList.CertificateRevocationStatus— Revocation evaluation result for a single certificate.CheckCertificateRevocationAgainstCrlErrorCode— Error codes thatcheckCertificateRevocationAgainstCrlmay return.CheckCertificateRevocationAgainstCrlFailure— Failure detail forcheckCertificateRevocationAgainstCrl.CheckCertificateRevocationAgainstCrlFailureDetails— Structured details attached to aCheckCertificateRevocationAgainstCrlFailure.CheckCertificateRevocationAgainstCrlGoodValue— Success value when the certificate is not found in the CRL.CheckCertificateRevocationAgainstCrlInput— Input forcheckCertificateRevocationAgainstCrl.CheckCertificateRevocationAgainstCrlResult— Result ofcheckCertificateRevocationAgainstCrl.CheckCertificateRevocationAgainstCrlRevokedValue— Success value when the certificate is found as revoked in the CRL.CheckCertificateRevocationAgainstCrlValue— Discriminated union ofgoodandrevokedoutcomes.CheckCertificateRevocationErrorCode— Error codes thatcheckCertificateRevocationmay surface inside anindeterminateresult.CheckCertificateRevocationFailureDetails— Diagnostic details attached to anindeterminaterevocation result.CheckCertificateRevocationInput— Input forcheckCertificateRevocation.CheckCertificateRevocationResult— Result ofcheckCertificateRevocation. Always succeeds (ok: true) —CheckCertificateRevocationValue— Discriminated union ofgood,revoked, andindeterminaterevocation outcomes.CheckChainRevocationInput— Input forcheckChainRevocation.CheckChainRevocationResult— Result type forcheckChainRevocation.CheckChainRevocationValue— Detailed revocation check results.ConfiguredOcspResponder— A manually-configured OCSP responder endpoint.ConfiguredOcspResponderCertificate— PEM or DER bytes of a pre-configured OCSP responder certificate.CreateCertificateRevocationListInput— Input forcreateCertificateRevocationList.CreateOcspCertStatusInput— Status to assert for one certificate, mirroring RFC 6960 §4.2.1CertStatus.CreateOcspRequestInput— Input forcreateOcspRequest.CreateOcspRequestItemInput— One certificate whose status to query in an OCSP request.CreateOcspResponseInput— Input forcreateOcspResponse.CreateOcspSingleResponseInput— One certificate's status entry forCreateOcspResponseInput.responses.CrlApplicabilityFailureReason— Structured reason why a CRL was deemed non-applicable to a given certificate.CrlCertificateSource— PEM string, DER bytes, or already-parsed certificate.CrlEncoderErrorCode— Machine-readable reason a CRL encoder rejected its construction input.CrlSource— PEM string, DER bytes, or already-parsed CRL.IssuingDistributionPoint— Input for the Issuing Distribution Point CRL extension (RFC 5280 §5.2.5).IssuingDistributionPointBase— Base shape for Issuing Distribution Point (RFC 5280 §5.2.5) — no scope restriction.IssuingDistributionPointForAttributeCerts— IDP scoped to attribute certificates only. Mutually exclusive with user / CA scopes.IssuingDistributionPointForCaCerts— IDP scoped to CA certificates only. Mutually exclusive with user / attribute scopes.IssuingDistributionPointForUserCerts— IDP scoped to end-entity (user) certificates only. Mutually exclusive with CA / attribute scopes.OcspCertificateSource— PEM string, DER bytes, or already-parsed certificate.OcspCertStatus— RFC 6960 certificate status reported by the responder for a single CertID.OcspEncoderErrorCode— Machine-readable reason an OCSP encoder rejected its construction input.OcspHashAlgorithm— Hash algorithm used to compute OCSP CertID fields. RFC 9919 §3.1.1 requires SHA-256 for conforming clients; RFC 6960 defines no default.OcspRequestMaterial— Encoded OCSP request in multiple serialisation formats, returned bycreateOcspRequest.OcspRequestSource— PEM string, DER bytes, or already-parsed OCSP request.OcspResponderCandidate— One candidate OCSP responder resolved byresolveOcspResponderCandidates.OcspResponderRevocationPolicy— Revocation policy for delegated OCSP responder certificates (RFC 6960 §4.2.2.2.1).OcspResponderSource— Where the OCSP responder URI came from.OcspResponseMaterial— Encoded OCSP response in multiple serialisation formats, returned bycreateOcspResponse.OcspResponseSource— OCSP response in any supported format.OcspResponseStatus— RFC 6960 overall response status — anything other than'successful'means the response body is absent or unusable.ParseCertificateRevocationListErrorCode— Machine-readable failure reason for the CRL parsers.ParseCertificateRevocationListFailure— Structured failure payload for CRL parsing.ParseCertificateRevocationListResult— Success-or-failure result fromparseCertificateRevocationListDer/parseCertificateRevocationListPem.ParsedCertificateRevocationList— Decoded X.509 CRL, returned byparseCertificateRevocationListDerParsedIssuingDistributionPoint— Decoded Issuing Distribution Point CRL extension (RFC 5280 §5.2.5).ParsedIssuingDistributionPointBase— Scope-independent fields of a decoded Issuing Distribution Point.ParsedIssuingDistributionPointScope— Which certificate kind a CRL is scoped to. RFC 5280 §5.2.5 allows at most oneParsedOcspCertId— Decoded OCSP CertID — identifies a certificate by hashed issuer name,ParsedOcspCertStatus— RFC 6960 §4.2.1 `CertStatus ::= CHOICE { good [0] NULL, revoked [1] RevokedInfo,ParsedOcspRequest— Decoded OCSP request, returned byparseOcspRequestDer/parseOcspRequestPem.ParsedOcspResponderId— How the OCSP responder identifies itself — either by distinguished name orParsedOcspResponse— Decoded OCSP response, returned byparseOcspResponseDer/parseOcspResponsePem.ParsedOcspSingleResponse— Status of one certificate inside an OCSP BasicResponse.ParsedRevocationReason— A decoded CRLReason: a namedRevocationReasonor anUnrecognizedRevocationReason.ParsedRevokedCertificate— A single revoked-certificate entry decoded from a CRL.ParseOcspRequestErrorCode— Machine-readable failure reason for the OCSP request parsers.ParseOcspRequestFailure— Structured failure payload for OCSP request parsing.ParseOcspRequestResult— Success-or-failure result fromparseOcspRequestDer/parseOcspRequestPem.ParseOcspResponseErrorCode— Machine-readable failure reason for the OCSP response parsers, with the codes ofParseOcspRequestErrorCode.ParseOcspResponseFailure— Structured failure payload for OCSP response parsing.ParseOcspResponseResult— Success-or-failure result fromparseOcspResponseDer/parseOcspResponsePem.ResolveOcspResponderCandidatesInput— Input forresolveOcspResponderCandidates.RevocationCertificateSource— PEM string, DER bytes, or already-parsed certificate.RevocationCheckGoodValue— Certificate is not revoked according to the checked evidence.RevocationCheckIndeterminateValue— Revocation status could not be determined from the provided evidence.RevocationCheckRevokedValue— Certificate is revoked according to the checked evidence.RevocationCrlEvidenceInput— CRL-based revocation evidence forCheckCertificateRevocationInput.evidence.RevocationEvidenceInput— Discriminated union of CRL and OCSP evidence inputs.RevocationEvidenceKind— Which revocation mechanism produced the evidence.RevocationExecutionError— Errors encountered while processing revocation evidence.RevocationIndeterminateEvidence— One piece of evidence that failed to produce a definitive revocation answer.RevocationIndeterminateReason— See the doc comment aboveREVOCATION_INDETERMINATE_REASONS.RevocationIndeterminateReasonCode— Why a particular piece of evidence could not produce a definitivegood/revokedanswer.RevocationOcspEvidenceInput— OCSP-based revocation evidence forCheckCertificateRevocationInput.evidence.RevocationParseError— Revocation evidence that did not parse.RevocationPolicy— Revocation checking policy forcheckChainRevocation.RevocationProcessingError— Revocation evidence that parsed but could not be processed.RevocationReason— RFC 5280 §5.3.1 CRLReason code values.RevocationSource— Identifies the source of revocation evidence.RevocationStatus— Unified revocation outcome across CRL and OCSP evidence.RevokedCertificateInput— Single revoked certificate entry forcreateCertificateRevocationList.TrustedOcspResponder— A locally trusted OCSP responder bound to the CA scope it may serve.UnrecognizedReasonCodePolicy— Treatment of revocation evidence whose CRLReason is anUnrecognizedRevocationReason— A CRLReason code outside the RFC 5280 §5.3.1 enumeration, such as the unusedValidateCertificateRevocationListFailure— Failure detail forvalidateCertificateRevocationList.ValidateCertificateRevocationListInput— Input forvalidateCertificateRevocationList.ValidateCertificateRevocationListResult— Result ofvalidateCertificateRevocationList.ValidateOcspResponseErrorCode— Failure codes produced byvalidateOcspResponse.ValidateOcspResponseFailure— Failure detail forvalidateOcspResponse.ValidateOcspResponseInput— Input forvalidateOcspResponse.ValidateOcspResponseResult— Result ofvalidateOcspResponse.VerifyCertificateRevocationListSignatureFailure— Failure detail when CRL signature verification fails.unsupportedandVerifyCertificateRevocationListSignatureResult— Result ofverifyCertificateRevocationListSignature.VerifyOcspResponseSignatureFailure— Failure detail when OCSP response signature verification fails.unsupportedVerifyOcspResponseSignatureResult— Result ofverifyOcspResponseSignature.BuildCandidatePathInput— Input forbuildCandidatePath.BuildCandidatePathResult— Result ofbuildCandidatePath. On success, contains theCandidatePath.CandidatePath— A signature-verified certification path from leaf to root, before constraint validation.CertificateSource— PEM string or DER bytes for a certificate. PEM may contain multiple blocks.ChainRevocationInput— Input for chain-level revocation checking inverifyCertificateChain.ConstrainedPolicy— One policy OID that survives RFC 5280 / RFC 9618 processing.CsrSource— PEM string or DER bytes for a certificate signing request.DnsServiceIdentityInput— DNS hostname reference identifier.EkuCheckFailure— Failure fromcheckExtendedKeyUsagewith the chain index of the certificate that failed.EkuCheckPurpose— Extended key usage purpose checked bycheckExtendedKeyUsage.EkuCheckResult— Result ofcheckExtendedKeyUsage. Success carries no value; failure identifies the offending certificate.InitialNameConstraintsInput— Input forcreateNameConstraintValidationState.IpServiceIdentityInput— IP address reference identifier.MatchServiceIdentityErrorCode— Discriminant codes for identity-matching failures.MatchServiceIdentityFailure— A failed identity-matching attempt.MatchServiceIdentityFailureDetails— Diagnostic context attached to an identity-matching failure.MatchServiceIdentityFailureResult— Failure branch ofMatchServiceIdentityResultwith structured error details.MatchServiceIdentityInput— Input formatchServiceIdentity.MatchServiceIdentityResult— Result of matching a reference identifier against a certificate's presented identifiers.MatchServiceIdentitySuccess— A successful identity match (the certificate covers the requested name).PolicyValidationInput— Input for the policy-validation engine.PolicyValidationOutcome— Final policy outputs exposed by successful path-validation APIs.ServiceIdentityInput— Discriminated union of all supported reference identifier types.ServiceIdentityType— Thetypediscriminant values ofServiceIdentityInput.SrvServiceIdentityInput— SRV-ID reference identifier (RFC 4985).TrustAnchor— Bare trust anchor — subject identity and public key material without aUriServiceIdentityInput— URI-ID reference identifier (RFC 9525 §§6.2-6.5). Scheme and host are matched.ValidateCandidatePathInput— Input forvalidateCandidatePath.ValidateCandidatePathResult— Result ofvalidateCandidatePath.ValidateCandidatePathSuccess— Success payload fromvalidateCandidatePath.ValidateForCaInput— Input forvalidateForCa. EnforcesbasicConstraints.caon the leaf.ValidateForCodeSigningInput— Input forvalidateForCodeSigning. EnforcescodeSigningEKU.ValidateForTlsClientInput— Input forvalidateForTlsClient. EnforcesclientAuthEKU.ValidateForTlsServerInput— Input forvalidateForTlsServer. EnforcesserverAuthEKU and optional DNS/IP identity matching.VerifiedCertificateChain— Fully verified certificate chain returned on success fromverifyCertificateChain.VerifyCertificateChainInput— Input forverifyCertificateChain. Combines path-building, validation, and identity options.VerifyChainFailure— A chain verification failure with its error code, human message, chain index, and diagnostic details.VerifyChainResult— Result ofverifyCertificateChain. On success, contains theVerifiedCertificateChain.VerifyErrorCode— See the doc comment aboveVERIFY_ERROR_CODESfor the meaning of each code.VerifyFailureDetails— Diagnostic context attached to everyVerifyChainFailure. All fields are optional; presence depends on the error code.VerifyFailureSource— An entry ofBuildCandidatePathInput.intermediatesorBuildCandidatePathInput.roots.VerifyPurpose— High-level purpose applied during path validation to enforce leaf constraints.VerifyRequestFailure— Failure fromverifyCertificateSigningRequest.VerifyRequestResult— Result ofverifyCertificateSigningRequest. On success, contains the parsed CSR.AuthorityInformationAccess— A single entry in the Authority Information Access extension (RFC 5280 §4.2.2.1).AuthorityInformationAccessInput— Builder input for one Authority Information Access entry.BasicConstraints— RFC 5280 §4.2.1.9 Basic Constraints.CertificateExtensionsInput— Input forcreateCertificate,createSelfSignedCertificate,CertificateFingerprint— The three rendered forms of a certificate fingerprint.CertificateFingerprintAlgorithm— Digest algorithms supported bycertificateFingerprint.CertificateFingerprintSource— A PEM string, raw DER bytes, or an already-parsed certificate.CertificateMaterial— Encoded certificate material in common interchange formats.CertificatePolicies— RFC 5280 §4.2.1.4 — array of policy OIDs with optional qualifiers.CreateCertificateErrorCode— Machine-readable reason a certificate builder rejected its construction input.CreateCertificateInput— Input forcreateCertificate.CreateCsrInput— Input forcreateCertificateSigningRequest.CreateSelfSignedCertificateBase— Fields common to bothSelfSignedKeySourcevariants.CreateSelfSignedCertificateInput— Input forcreateSelfSignedCertificate.CsrMaterial— DER, PEM, and base64 encodings of a CSR produced bycreateCertificateSigningRequest.DecodedExtensionMap— Inferred result type when decoding extensions via anExtensionDecoderMap.DecodedExtensionValue— A successfully decoded extension value paired with its OID and criticality.DisplayTextType— The ASN.1 string types RFC 5280 §4.2.1.4 allows for a DisplayText.DistributionPoint— Input for a single CRL Distribution Point (RFC 5280 §4.2.1.13).DistributionPointName— Name component of a CRL Distribution Point, mirroring RFC 5280 §4.2.1.13ExtendedKeyUsage— Extended Key Usage — either a well-known purpose string or a custom OID.ExtensionDecoder— User-supplied decoder for a single extension OID.ExtensionDecoderMap— String-keyed map ofExtensionDecoders, used withParseOptions.decoderMap.ExtensionEncoderErrorCode— Machine-readable reason an extension encoder rejected its construction input.GeneralName— Alias forSubjectAltName— used where RFC 5280 says "GeneralName".GeneralSubtree— A single subtree entry in a Name Constraints permitted/excluded list.InhibitAnyPolicy— RFC 5280 §4.2.1.14 Inhibit anyPolicy.KeyUsage— RFC 5280 §4.2.1.3 Key Usage bit flag.MatchCertificatePrivateKeyErrorCode— Machine-readable failure reason formatchCertificatePrivateKey.MatchCertificatePrivateKeyFailure— Structured failure payload formatchCertificatePrivateKey.MatchCertificatePrivateKeyFailureResult— Failure branch ofMatchCertificatePrivateKeyResultwith structured error details.MatchCertificatePrivateKeyResult— Result ofmatchCertificatePrivateKey.MatchCertificatePrivateKeySuccess— A successful match: the private key's public half is the certificate's subject public key.NameAttribute— Single name attribute within a distinguished name.NameConstraintForm— A name form used as a constraint base in namEConstraints.NameConstraints— RFC 5280 §4.2.1.10 Name Constraints.NameEncoderErrorCode— Machine-readable reason a distinguished-name encoder rejected its construction input.NameFieldKey— Union of recognized distinguished-name attribute type shorthand names.NameInput— Input forencodeName.NameObject— Convenience object form of an X.501 distinguished name.OversizedDisplayText— A user noticeexplicitTextornoticeReforganization longer than the 200ParseCertificateChainResult— Success-or-failure result fromparseCertificateChainPem.ParseCertificateErrorCode— Machine-readable failure reason forparseCertificateDer/parseCertificatePem.ParseCertificateFailure— Structured failure payload for certificate parsing.ParseCertificateResult— Success-or-failure result fromparseCertificateDer/parseCertificatePem.ParseCertificateSigningRequestErrorCode— Machine-readable failure reason for the CSR parsers, with the codes ofParseCertificateErrorCode.ParseCertificateSigningRequestFailure— Structured failure payload for CSR parsing.ParseCertificateSigningRequestResult— Success-or-failure result fromparseCertificateSigningRequestDer/ParsedBitFlags— A decoded BIT STRING flag set.ParsedCertificate— A fully decoded X.509 certificate.ParsedCertificateSigningRequest— A fully decoded PKCS#10 Certificate Signing Request.ParsedDistributionPoint— A decoded DistributionPoint from the CRL Distribution Points extension.ParsedDistributionPointName— The name component of a CRL Distribution Point, mirroring RFC 5280 §4.2.1.13ParsedExtension— A raw X.509v3 extension before type-specific decoding.ParsedName— An X.501 Distinguished Name decoded from an issuer or subject field.ParsedNameAttribute— A single decoded name attribute from an X.501 RelativeDistinguishedName.ParsedNameConstraintForm— Union of supported and unsupported name constraint forms as produced by parsing.ParsedRelativeDistinguishedName— A single RelativeDistinguishedName SET from an X.501 Name.ParseOptions— Options forparseCertificateDer,parseCertificatePem,PolicyConstraints— RFC 5280 §4.2.1.11 Policy Constraints.PolicyInformation— A single certificate policy: an OID plus optional qualifiers.PolicyMapping— Maps a policy OID in the issuer's domain to an equivalent OID in the subject's domain.PolicyMappings— RFC 5280 §4.2.1.5 — array of issuer-to-subject policy OID pairs.PolicyQualifierInfo— Discriminated union of all supported policy qualifier types.RelativeDistinguishedNameInput— Input forencodeRelativeDistinguishedName.SelfSignedCertificateResult— Result returned bycreateSelfSignedCertificate.SelfSignedKeySource— WherecreateSelfSignedCertificategets its key pair.SubjectAltName— RFC 5280 §4.2.1.6 Subject Alternative Name / GeneralName.SubjectAltNameTextOptions— Options forsubjectAltNameToString.ValidityInput— Configures the certificate validity window.
Variables
DECODE_REFUSAL_CODES— Codes a parse boundary returns for input it refuses without calling itREVOCATION_INDETERMINATE_REASON_CODES— EveryRevocationIndeterminateReasonCode, as a runtime array.REVOCATION_INDETERMINATE_REASONS— Granular reasons why revocation status could not be determined.VERIFY_ERROR_CODES— Discriminant for every failure a verify operation can produce.