Skip to content

ParsedCertificateChoice ​

ParsedCertificateChoice ​

One RFC 5652 §10.2.2 CertificateChoices alternative.

X.509 is the only alternative this library decodes. The rest keep their DER, including the context tag, so a CertificateSet round-trips and a caller can tell an X.509-only bag from one carrying attribute certificates. RFC 5652 marks extendedCertificate and attributeCertificateV1 obsolete.

ts
type ParsedCertificateChoice = {
  readonly type: "certificate";
  readonly certificate: ParsedCertificate
} | {
  readonly type: "extendedCertificate";
  readonly der: Uint8Array
} | {
  readonly type: "attributeCertificateV1";
  readonly der: Uint8Array
} | {
  readonly type: "attributeCertificateV2";
  readonly der: Uint8Array
} | {
  readonly type: "other";
  readonly formatOid: string;
  readonly der: Uint8Array
}

Released under the MIT License.