pub struct Cert<'a> {Show 13 fields
pub(crate) serial: Input<'a>,
pub(crate) signed_data: SignedData<'a>,
pub(crate) issuer: Input<'a>,
pub(crate) validity: Input<'a>,
pub(crate) subject: Input<'a>,
pub(crate) spki: Input<'a>,
pub(crate) basic_constraints: Option<Input<'a>>,
pub(crate) key_usage: Option<Input<'a>>,
pub(crate) eku: Option<Input<'a>>,
pub(crate) name_constraints: Option<Input<'a>>,
pub(crate) subject_alt_name: Option<Input<'a>>,
pub(crate) crl_distribution_points: Option<Input<'a>>,
der: CertificateDer<'a>,
}Expand description
A parsed X509 certificate.
Fields§
§serial: Input<'a>§signed_data: SignedData<'a>§issuer: Input<'a>§validity: Input<'a>§subject: Input<'a>§spki: Input<'a>§basic_constraints: Option<Input<'a>>§key_usage: Option<Input<'a>>§eku: Option<Input<'a>>§name_constraints: Option<Input<'a>>§subject_alt_name: Option<Input<'a>>§crl_distribution_points: Option<Input<'a>>§der: CertificateDer<'a>Implementations§
Source§impl<'a> Cert<'a>
impl<'a> Cert<'a>
pub(crate) fn from_der(cert_der: Input<'a>) -> Result<Self, Error>
Sourcepub fn valid_dns_names(&self) -> impl Iterator<Item = &str>
pub fn valid_dns_names(&self) -> impl Iterator<Item = &str>
Returns a list of valid DNS names provided in the subject alternative names extension
This function must not be used to implement custom DNS name verification. Checking that a certificate is valid for a given subject name should always be done with EndEntityCert::verify_is_valid_for_subject_name.
Sourcepub fn valid_uri_names(&self) -> impl Iterator<Item = &str>
pub fn valid_uri_names(&self) -> impl Iterator<Item = &str>
Returns a list of valid URI names provided in the subject alternative names extension
This function returns URIs as strings without performing validation beyond checking that they are valid UTF-8.
Sourcepub fn serial(&self) -> &[u8] ⓘ
pub fn serial(&self) -> &[u8] ⓘ
Raw certificate serial number.
This is in big-endian byte order, in twos-complement encoding.
If the caller were to add an INTEGER tag and suitable length, this
would become a valid DER encoding.
Sourcepub fn issuer(&self) -> &[u8] ⓘ
pub fn issuer(&self) -> &[u8] ⓘ
Raw DER-encoded certificate issuer.
This does not include the outer SEQUENCE tag or length.
Sourcepub fn subject(&self) -> &[u8] ⓘ
pub fn subject(&self) -> &[u8] ⓘ
Raw DER encoded certificate subject.
This does not include the outer SEQUENCE tag or length.
Sourcepub fn subject_public_key_info(&self) -> SubjectPublicKeyInfoDer<'static>
pub fn subject_public_key_info(&self) -> SubjectPublicKeyInfoDer<'static>
Get the RFC 5280-compliant SubjectPublicKeyInfoDer (SPKI) of this Cert.
This does include the outer SEQUENCE tag and length.
Sourcepub(crate) fn crl_distribution_points(
&self,
) -> Option<impl Iterator<Item = Result<CrlDistributionPoint<'a>, Error>>>
pub(crate) fn crl_distribution_points( &self, ) -> Option<impl Iterator<Item = Result<CrlDistributionPoint<'a>, Error>>>
Returns an iterator over the certificate’s cRLDistributionPoints extension values, if any.
Sourcepub fn der(&self) -> CertificateDer<'a>
pub fn der(&self) -> CertificateDer<'a>
Raw DER-encoded representation of the certificate.