Skip to content

checkCertificateRevocation ​

checkCertificateRevocation ​

Evaluates all provided CRL and OCSP evidence to determine the certificate's revocation status. Returns the first revoked if any. Otherwise an OCSP good settles the status, then a CRL good once the CRLs together cover every revocation reason, else indeterminate with diagnostic details about each indeterminate evidence. Each CRL in evidence counts as a delta CRL when it carries the delta CRL indicator and as a complete CRL otherwise, whichever field holds it. Each distinct complete CRL is checked once, updated by the newest delta CRL among them that applies to it, as checkChainRevocation does, within the same attempt limits, which the CRL checks of delegated OCSP responders share. A delta CRL that cannot settle the status records delta_crl_unusable in details.indeterminateEvidence, and a candidate the limits leave unread that counts under unreadSupersededDeltaCrls records delta_crl_retry_limit_exceeded there; either keeps other evidence from settling the status as good. Unless other evidence revokes the certificate, the result is then indeterminate with the top-level code revocation_status_indeterminate. A certificate carrying noRevAvail is skipped without consulting evidence (RFC 9608 §4). One carrying id-pkix-ocsp-nocheck is still checked against the evidence, which may list it as revoked.

ts
function checkCertificateRevocation(
	callerInput: CheckCertificateRevocationInput,
): Promise<CheckCertificateRevocationResult>

Parameters

Examples

ts
import { checkCertificateRevocation } from 'micro509';

const result = await checkCertificateRevocation({
  certificate: leafPem,
  issuerCertificate: caPem,
  evidence: [{ kind: 'crl', crl: crlPem }],
});
if (result.ok && result.value.status === 'revoked') {
  console.log('revoked at', result.value.revokedAt);
}

Released under the MIT License.