Struct CertificateRevocationList
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§
§impl<'a> CertificateRevocationList<'a>
impl<'a> CertificateRevocationList<'a>
pub fn version(&self) -> Option<X509Version>
pub fn version(&self) -> Option<X509Version>
Get the version of the encoded certificate
pub fn last_update(&self) -> ASN1Time
pub fn last_update(&self) -> ASN1Time
Get the date and time of the last (this) update.
pub fn next_update(&self) -> Option<ASN1Time>
pub fn next_update(&self) -> Option<ASN1Time>
Get the date and time of the next update, if present.
pub 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
pub fn extensions(&self) -> &[X509Extension<'_>]
pub fn extensions(&self) -> &[X509Extension<'_>]
Get the CRL extensions.
pub 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.
pub fn verify_signature(
&self,
public_key: &SubjectPublicKeyInfo<'_>,
) -> Result<(), X509Error>
pub fn verify_signature( &self, public_key: &SubjectPublicKeyInfo<'_>, ) -> Result<(), X509Error>
Verify the cryptographic signature of this certificate revocation list
public_key is the public key of the signer.
Not all algorithms are supported, this function is limited to what ring supports.
pub 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.
§impl CertificateRevocationList<'_>
impl CertificateRevocationList<'_>
pub fn walk<V>(&self, visitor: &mut V)where
V: CertificateRevocationListVisitor,
pub fn walk<V>(&self, visitor: &mut V)where
V: CertificateRevocationListVisitor,
Run the provided CertificateRevocationListVisitor over the Certificate Revocation List (self)
Trait Implementations§
§impl<'a> AsRef<[u8]> for CertificateRevocationList<'a>
impl<'a> AsRef<[u8]> for CertificateRevocationList<'a>
§impl<'a> Clone for CertificateRevocationList<'a>
impl<'a> Clone for CertificateRevocationList<'a>
§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 more§impl<'a> Debug for CertificateRevocationList<'a>
impl<'a> Debug for CertificateRevocationList<'a>
§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 }
Auto Trait Implementations§
impl<'a> Freeze for CertificateRevocationList<'a>
impl<'a> RefUnwindSafe for CertificateRevocationList<'a>
impl<'a> Send for CertificateRevocationList<'a>
impl<'a> Sync for CertificateRevocationList<'a>
impl<'a> Unpin for CertificateRevocationList<'a>
impl<'a> UnwindSafe for CertificateRevocationList<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)