Skip to content

ParsedOcspCertStatus ​

ParsedOcspCertStatus ​

RFC 6960 §4.2.1 CertStatus ::= CHOICE { good [0] NULL, revoked [1] RevokedInfo, unknown [2] UnknownInfo }.

Only revoked carries data, so RevokedInfo's fields exist only on that alternative. revocationReasonCode stays optional because revocationReason is OPTIONAL within RevokedInfo.

ts
type ParsedOcspCertStatus = {
  readonly certStatus: "good"
} | {
  readonly certStatus: "revoked";
  readonly revokedAt: Date;
  readonly revocationReasonCode?: bigint
} | {
  readonly certStatus: "unknown"
}

Released under the MIT License.