ParsedCertificate
A fully decoded X.509 certificate.
Built-in extensions (basicConstraints, keyUsage, etc.) are decoded into typed fields automatically.
Supply ParseOptions to also decode custom extensions.
ts
interface ParsedCertificate<TMap extends ExtensionDecoderMap> {
readonly der: Uint8Array;
readonly version: number;
readonly serialNumberHex: string;
readonly tbsCertificateDer: Uint8Array;
readonly subjectPublicKeyInfoDer: Uint8Array;
readonly signatureValue: Uint8Array;
readonly issuer: ParsedName;
readonly subject: ParsedName;
readonly notBefore: Date;
readonly notAfter: Date;
readonly signatureAlgorithmOid: string;
readonly signatureAlgorithmName: string;
readonly signatureAlgorithmParametersDer?: Uint8Array;
readonly publicKeyAlgorithmOid: string;
readonly publicKeyAlgorithmName: string;
readonly publicKeyAlgorithmParametersDer?: Uint8Array;
readonly publicKeyParametersOid?: string;
readonly extensions: readonly ParsedExtension[];
readonly basicConstraints?: BasicConstraints;
readonly keyUsage?: ParsedBitFlags<KeyUsage>;
readonly extendedKeyUsage?: readonly ExtendedKeyUsage[];
readonly subjectAltNames?: readonly SubjectAltName[];
readonly nameConstraints?: NameConstraints<ParsedNameConstraintForm>;
readonly certificatePolicies?: CertificatePolicies;
readonly policyMappings?: PolicyMappings;
readonly policyConstraints?: PolicyConstraints;
readonly inhibitAnyPolicy?: InhibitAnyPolicy;
readonly authorityInfoAccess?: readonly AuthorityInformationAccess[];
readonly crlDistributionPoints?: readonly ParsedDistributionPoint[];
readonly decodedExtensions?: readonly DecodedExtensionValue<unknown>[];
readonly decodedExtensionMap?: DecodedExtensionMap<TMap>;
readonly subjectKeyIdentifier?: string;
readonly authorityKeyIdentifier?: string;
}Properties
readonlyder:Uint8Array— Complete DER encoding of the certificate (copied from the input).readonlyversion:number— X.509 version number (1, 2, or 3). Almost always 3.readonlyserialNumberHex:string— Hex-encoded serial number assigned by the issuing CA.readonlytbsCertificateDer:Uint8Array— DER encoding of the TBSCertificate, used for signature verification.readonlysubjectPublicKeyInfoDer:Uint8Array— DER encoding of the SubjectPublicKeyInfo, used for key import.readonlysignatureValue:Uint8Array— Raw signature bytes (BIT STRING content, padding removed).readonlyissuer:ParsedName— Distinguished name of the certificate issuer.readonlysubject:ParsedName— Distinguished name of the certificate subject.readonlynotBefore:Date— Start of the certificate validity period.readonlynotAfter:Date— End of the certificate validity period.readonlysignatureAlgorithmOid:string— OID of the algorithm used to sign this certificate (e.g."1.2.840.113549.1.1.11"for SHA-256 with RSA).readonlysignatureAlgorithmName:string— Human-readable signature algorithm name (e.g."ECDSA with SHA-256").readonlysignatureAlgorithmParametersDer?:Uint8Array— DER-encoded parameters for the signature algorithm. Absent for algorithms with no parameters.readonlypublicKeyAlgorithmOid:string— OID of the subject's public key algorithm (e.g."1.2.840.10045.2.1"for EC).readonlypublicKeyAlgorithmName:string— Human-readable public key algorithm name (e.g."EC P-256").readonlypublicKeyAlgorithmParametersDer?:Uint8Array— DER-encoded parameters for the public key algorithm. Absent when implicit.readonlypublicKeyParametersOid?:string— OID of the named curve or other key sub-parameter, when present.readonlyextensions:readonlyParsedExtension[]— All extensions as rawParsedExtensions, in certificate order.readonlybasicConstraints?:BasicConstraints— Decoded Basic Constraints (RFC 5280 §4.2.1.9).readonlykeyUsage?:ParsedBitFlags<KeyUsage> — Decoded Key Usage bit flags (RFC 5280 §4.2.1.3).readonlyextendedKeyUsage?:readonlyExtendedKeyUsage[]— Decoded Extended Key Usage purposes (RFC 5280 §4.2.1.12).readonlysubjectAltNames?:readonlySubjectAltName[]— Decoded Subject Alternative Names (RFC 5280 §4.2.1.6).readonlynameConstraints?:NameConstraints<ParsedNameConstraintForm> — Decoded Name Constraints (RFC 5280 §4.2.1.10).readonlycertificatePolicies?:CertificatePolicies— Decoded Certificate Policies (RFC 5280 §4.2.1.4).readonlypolicyMappings?:PolicyMappings— Decoded Policy Mappings (RFC 5280 §4.2.1.5).readonlypolicyConstraints?:PolicyConstraints— Decoded Policy Constraints (RFC 5280 §4.2.1.11).readonlyinhibitAnyPolicy?:InhibitAnyPolicy— Decoded Inhibit anyPolicy (RFC 5280 §4.2.1.14).readonlyauthorityInfoAccess?:readonlyAuthorityInformationAccess[]— Decoded Authority Information Access — OCSP and CA Issuer URIs (RFC 5280 §4.2.2.1).readonlycrlDistributionPoints?:readonlyParsedDistributionPoint[]— Decoded CRL Distribution Points (RFC 5280 §4.2.1.13).readonlydecodedExtensions?:readonlyDecodedExtensionValue<unknown>[]— Custom-decoded extensions fromParseOptions.decoders.readonlydecodedExtensionMap?:DecodedExtensionMap<TMap> — Custom-decoded extensions fromParseOptions.decoderMap, keyed by map key.readonlysubjectKeyIdentifier?:string— Hex-encoded Subject Key Identifier (RFC 5280 §4.2.1.2).readonlyauthorityKeyIdentifier?:string— Hex-encoded Authority Key Identifier (RFC 5280 §4.2.1.1).