Skip to content

RevocationPolicy ​

RevocationPolicy ​

Revocation checking policy for checkChainRevocation.

Controls how indeterminate results (missing evidence, expired CRLs) affect the final decision.

ts
interface RevocationPolicy {
	readonly mode?: "soft-fail" | "hard-fail";
	readonly prefer?: "ocsp" | "crl" | "best-available";
	readonly ocspResponderRevocation?: OcspResponderRevocationPolicy;
	readonly crlMaxAgeMs?: number;
	readonly clockSkewMs?: number;
	readonly ocspProfile?: ValidateOcspResponseInput["profile"];
	readonly unrecognizedReasonCode?: UnrecognizedReasonCodePolicy;
	readonly crlSignerSelfEvidence?: "delegated" | "any";
	readonly unreadSupersededDeltaCrls?: SupersededDeltaCrlPolicy;
}

Properties

  • readonly mode?: "soft-fail" | "hard-fail" — How to handle indeterminate status.

    • 'hard-fail': indeterminate certificates cause denial (default)
    • 'soft-fail': indeterminate certificates are allowed — an explicit availability/compatibility choice

    Revocation checking itself is opt-in: no check runs unless evidence is supplied. Once it is, indeterminate status denies by default.

  • readonly prefer?: "ocsp" | "crl" | "best-available" — Evidence preference when multiple sources are available.

    Both evidence kinds are always evaluated, and a validated revoked verdict from either source wins regardless of preference (fail-closed). Preference only decides which source's good verdict is reported when both yield one.

    • 'best-available': the source with the fresher evidence — the later thisUpdate on the validated OCSP entry or CRL — is reported; ties favor OCSP (default)
    • 'ocsp': prefer OCSP over CRL
    • 'crl': prefer CRL over OCSP
  • readonly ocspResponderRevocation?: OcspResponderRevocationPolicy — Revocation policy for delegated OCSP responder certificates (RFC 6960 §4.2.2.2.1). Supplied CRLs double as responder revocation evidence. Defaults to 'nocheck-or-evidence'.

  • readonly crlMaxAgeMs?: number — Maximum age of a CRL's thisUpdate at the evaluation time, in milliseconds. An older CRL, or one without nextUpdate when this is unset, settles only a revocation other than certificateHold of an unexpired certificate (RFC 5280 §5.3.1). Applies to CRLs for chain certificates, CRL signers and delegated OCSP responders. Unbounded by default. RFC 5280 §3.3 leaves the required recency of revocation data to local policy.

  • readonly clockSkewMs?: number — Clock-skew tolerance in milliseconds for CRL and OCSP thisUpdate/ nextUpdate checks. It also widens crlMaxAgeMs by the same amount. Defaults to 0. Throws RangeError when negative or not finite.

  • readonly ocspProfile?: ValidateOcspResponseInput["profile"] — OCSP client profile for every OCSP response. See ValidateOcspResponseInput.profile. 'rfc9919' turns a response without nextUpdate into ocsp_next_update_missing. Defaults to 'rfc6960'.

  • readonly unrecognizedReasonCode?: UnrecognizedReasonCodePolicy — Treatment of CRL entries and OCSP responses whose CRLReason is unrecognized, including the CRLs for CRL signers and delegated OCSP responders. See UnrecognizedReasonCodePolicy. 'reject' makes that evidence yield crl_reason_code_unrecognized or ocsp_reason_code_unrecognized, which outranks a good verdict from other evidence. Defaults to 'revoked'.

  • readonly crlSignerSelfEvidence?: "delegated" | "any" — Whether a CRL that a delegated CRL signer signed may establish that signer's own status. RFC 5280 §6.3.3 (f) and X.509 (2019) §9.1.5 leave it open.

    • 'delegated': only when the signer's cRLDistributionPoints names the signer as cRLIssuer, the delegation PKITS 4.14.30 validates (default)
    • 'any': any such CRL that covers the signer, such as one under its issuer's name signed with the signer's separate CRL key

    A revocation of the signer in such a CRL counts under either value.

  • readonly unreadSupersededDeltaCrls?: SupersededDeltaCrlPolicy — Treatment of delta CRLs that the attempt limits leave unread although one already read supersedes them, for the chain, its CRL signers and its delegated OCSP responders. See SupersededDeltaCrlPolicy. Defaults to 'indeterminate'.

Released under the MIT License.