pub struct CertificateRevocationList<'a> {
pub tbs_cert_list: TbsCertList<'a>,
pub signature_algorithm: AlgorithmIdentifier<'a>,
pub signature_value: BitString<'a>,
/* private fields */
}Expand description
An X.509 v2 Certificate Revocation List (CRL).
X.509 v2 CRLs are defined in RFC5280.
§Example
To parse a CRL and print information about revoked certificates:
use x509_parser::prelude::FromDer;
use x509_parser::revocation_list::CertificateRevocationList;
let res = CertificateRevocationList::from_der(DER);
match res {
Ok((_rem, crl)) => {
for revoked in crl.iter_revoked_certificates() {
println!("Revoked certificate serial: {}", revoked.raw_serial_as_string());
println!(" Reason: {}", revoked.reason_code().unwrap_or_default().1);
}
},
_ => panic!("CRL parsing failed: {:?}", res),
}Fields§
§tbs_cert_list: TbsCertList<'a>§signature_algorithm: AlgorithmIdentifier<'a>§signature_value: BitString<'a>Implementations§
Source§impl<'a> CertificateRevocationList<'a>
impl<'a> CertificateRevocationList<'a>
Sourcepub fn version(&self) -> Option<X509Version>
pub fn version(&self) -> Option<X509Version>
Get the version of the encoded certificate
Sourcepub fn last_update(&self) -> ASN1Time
pub fn last_update(&self) -> ASN1Time
Get the date and time of the last (this) update.
Sourcepub fn next_update(&self) -> Option<ASN1Time>
pub fn next_update(&self) -> Option<ASN1Time>
Get the date and time of the next update, if present.
Sourcepub fn iter_revoked_certificates(
&self,
) -> impl Iterator<Item = &RevokedCertificate<'a>>
pub fn iter_revoked_certificates( &self, ) -> impl Iterator<Item = &RevokedCertificate<'a>>
Return an iterator over the RevokedCertificate objects
Sourcepub fn extensions(&self) -> &[X509Extension<'_>]
pub fn extensions(&self) -> &[X509Extension<'_>]
Get the CRL extensions.
Sourcepub fn crl_number(&self) -> Option<&BigUint>
pub fn crl_number(&self) -> Option<&BigUint>
Get the CRL number, if present
Note that the returned value is a BigUint, because of the following RFC specification:
Given the requirements above, CRL numbers can be expected to contain long integers. CRL verifiers MUST be able to handle CRLNumber values up to 20 octets. Conformant CRL issuers MUST NOT use CRLNumber values longer than 20 octets.
Sourcepub fn as_raw(&self) -> &'a [u8] ⓘ
pub fn as_raw(&self) -> &'a [u8] ⓘ
Return the raw ASN.1 DER content of the complete signed certificate revocation list that was parsed.
This includes the to-be-signed (TBS) certificate list, the signature algorithm, and the signature.
If you want just the ASN.1 DER of the TBS certificate list, prefer TbsCertList::as_ref().
We avoid the AsRef trait in this instance to ensure the full lifetime of the CertificateRevocationList is used.
Source§impl CertificateRevocationList<'_>
impl CertificateRevocationList<'_>
Sourcepub fn walk<V: CertificateRevocationListVisitor>(&self, visitor: &mut V)
pub fn walk<V: CertificateRevocationListVisitor>(&self, visitor: &mut V)
Run the provided CertificateRevocationListVisitor over the Certificate Revocation List (self)
Trait Implementations§
Source§impl<'a> AsRef<[u8]> for CertificateRevocationList<'a>
impl<'a> AsRef<[u8]> for CertificateRevocationList<'a>
Source§impl<'a> Clone for CertificateRevocationList<'a>
impl<'a> Clone for CertificateRevocationList<'a>
Source§fn clone(&self) -> CertificateRevocationList<'a>
fn clone(&self) -> CertificateRevocationList<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for CertificateRevocationList<'a>
impl<'a> Debug for CertificateRevocationList<'a>
Source§impl<'a> FromDer<'a, X509Error> for CertificateRevocationList<'a>
CertificateList ::= SEQUENCE {
tbsCertList TBSCertList,
signatureAlgorithm AlgorithmIdentifier,
signatureValue BIT STRING }
impl<'a> FromDer<'a, X509Error> for CertificateRevocationList<'a>
CertificateList ::= SEQUENCE {
tbsCertList TBSCertList,
signatureAlgorithm AlgorithmIdentifier,
signatureValue BIT STRING }