Struct x509_parser::revocation_list::CertificateRevocationList[][src]

pub struct CertificateRevocationList<'a> {
    pub tbs_cert_list: TbsCertList<'a>,
    pub signature_algorithm: AlgorithmIdentifier<'a>,
    pub signature_value: BitStringObject<'a>,
}

An X.509 v2 Certificate Revocation List (CRL).

X.509 v2 CRLs are defined in RFC5280.

Fields

tbs_cert_list: TbsCertList<'a>signature_algorithm: AlgorithmIdentifier<'a>signature_value: BitStringObject<'a>

Implementations

impl<'a> CertificateRevocationList<'a>[src]

pub fn from_der(i: &'a [u8]) -> X509Result<'_, Self>[src]

Parse a DER-encoded X.509 v2 CRL, and return the remaining of the input and the built object.

The returned object uses zero-copy, and so has the same lifetime as the input.

CertificateList  ::=  SEQUENCE  {
     tbsCertList          TBSCertList,
     signatureAlgorithm   AlgorithmIdentifier,
     signatureValue       BIT STRING  }

Example

To parse a CRL and print information about revoked certificates:

let res = parse_x509_crl(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),
}

pub fn version(&self) -> Option<X509Version>[src]

Get the version of the encoded certificate

pub fn issuer(&self) -> &X509Name<'_>[src]

Get the certificate issuer.

pub fn last_update(&self) -> ASN1Time[src]

Get the date and time of the last (this) update.

pub fn next_update(&self) -> Option<ASN1Time>[src]

Get the date and time of the next update, if present.

pub fn iter_revoked_certificates(
    &self
) -> impl Iterator<Item = &RevokedCertificate<'a>>
[src]

Return an iterator over the RevokedCertificate objects

pub fn extensions(&self) -> &HashMap<Oid<'_>, X509Extension<'_>>[src]

Get the certificate extensions.

pub fn crl_number(&self) -> Option<&BigUint>[src]

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.

Trait Implementations

impl<'a> Debug for CertificateRevocationList<'a>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.