Struct rcgen::CertificateRevocationList
source · pub struct CertificateRevocationList { /* private fields */ }
Expand description
A certificate revocation list (CRL)
§Example
extern crate rcgen;
use rcgen::*;
// Generate a CRL issuer.
let mut issuer_params = CertificateParams::new(vec!["crl.issuer.example.com".to_string()]);
issuer_params.is_ca = IsCa::Ca(BasicConstraints::Unconstrained);
issuer_params.key_usages = vec![KeyUsagePurpose::KeyCertSign, KeyUsagePurpose::DigitalSignature, KeyUsagePurpose::CrlSign];
let issuer = Certificate::from_params(issuer_params).unwrap();
// Describe a revoked certificate.
let revoked_cert = RevokedCertParams{
serial_number: SerialNumber::from(9999),
revocation_time: date_time_ymd(2024, 06, 17),
reason_code: Some(RevocationReason::KeyCompromise),
invalidity_date: None,
};
// Create a CRL signed by the issuer, revoking revoked_cert.
let crl = CertificateRevocationListParams{
this_update: date_time_ymd(2023, 06, 17),
next_update: date_time_ymd(2024, 06, 17),
crl_number: SerialNumber::from(1234),
issuing_distribution_point: None,
revoked_certs: vec![revoked_cert],
alg: &PKCS_ECDSA_P256_SHA256,
key_identifier_method: KeyIdMethod::Sha256,
};
let crl = CertificateRevocationList::from_params(crl).unwrap();
Implementations§
source§impl CertificateRevocationList
impl CertificateRevocationList
sourcepub fn from_params(
params: CertificateRevocationListParams
) -> Result<Self, Error>
pub fn from_params( params: CertificateRevocationListParams ) -> Result<Self, Error>
Generates a new certificate revocation list (CRL) from the given parameters.
sourcepub fn get_params(&self) -> &CertificateRevocationListParams
pub fn get_params(&self) -> &CertificateRevocationListParams
Returns the certificate revocation list (CRL) parameters.
sourcepub fn serialize_der_with_signer(
&self,
ca: &Certificate
) -> Result<Vec<u8>, Error>
pub fn serialize_der_with_signer( &self, ca: &Certificate ) -> Result<Vec<u8>, Error>
Serializes the certificate revocation list (CRL) in binary DER format, signed with the issuing certificate authority’s key.
sourcepub fn serialize_pem_with_signer(
&self,
ca: &Certificate
) -> Result<String, Error>
pub fn serialize_pem_with_signer( &self, ca: &Certificate ) -> Result<String, Error>
Serializes the certificate revocation list (CRL) in ASCII PEM format, signed with the issuing certificate authority’s key.
Auto Trait Implementations§
impl RefUnwindSafe for CertificateRevocationList
impl Send for CertificateRevocationList
impl Sync for CertificateRevocationList
impl Unpin for CertificateRevocationList
impl UnwindSafe for CertificateRevocationList
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
Mutably borrows from an owned value. Read more