Implementing CRL Checking
pub enum RevocationStatus {
Good,
Revoked { reason: String, at: OffsetDateTime },
Undetermined,
}
pub fn check_crl_revocation(
cert: &X509Certificate,
issuer: &X509Certificate,
crl_der: &[u8],
now: OffsetDateTime,
) -> anyhow::Result<RevocationStatus> {
let (_, crl) = CertificateRevocationList::from_der(crl_der)?;
crl.verify_signature(issuer.public_key())
.map_err(|e| anyhow::anyhow!("CRL signature invalid: {e:?}"))?;
}