Skip to content

ParsedPfxBag

Discriminated union of SafeBag types decoded from a PFX container.

Use kind to narrow: 'certificate' | 'privateKey' | 'unknown'.

ts
type ParsedPfxBag = {
  readonly kind: certificate;
  readonly bagId: string;
  readonly attributes: ParsedPfxBagAttributes;
  readonly certificate: ParsedCertificate
} | {
  readonly kind: privateKey;
  readonly bagId: string;
  readonly attributes: ParsedPfxBagAttributes;
  readonly pkcs8Der: Uint8Array
} | {
  readonly kind: unknown;
  readonly bagId: string;
  readonly attributes: ParsedPfxBagAttributes;
  readonly valueDer: Uint8Array
}

Released under the MIT License.