parseCertificateDerOrThrow
parseCertificateDerOrThrow
Throwing core for parseCertificateDer.
Decodes a DER-encoded X.509 certificate into a ParsedCertificate, throwing on malformed input. All built-in extensions (basicConstraints, keyUsage, subjectAltNames, etc.) are decoded automatically.
Pass ParseOptions to also decode custom extensions.
ts
function parseCertificateDerOrThrow<TMap extends ExtensionDecoderMap>(
der: Uint8Array,
options?: ParseOptions<TMap>,
): ParsedCertificate<TMap>Parameters
der:Uint8Array— Raw DER bytes of an X.509 certificate.options?:ParseOptions<TMap> — Custom extension decoders to apply during parsing.