x509_cert::certificate

Type Alias TbsCertificate

Source
pub type TbsCertificate = TbsCertificateInner<Rfc5280>;
Expand description

X.509 TbsCertificate as defined in [RFC 5280 Section 4.1]

Aliased Type§

struct TbsCertificate {
    pub version: Version,
    pub serial_number: SerialNumber,
    pub signature: AlgorithmIdentifier<Any>,
    pub issuer: RdnSequence,
    pub validity: Validity,
    pub subject: RdnSequence,
    pub subject_public_key_info: SubjectPublicKeyInfo<Any, BitString>,
    pub issuer_unique_id: Option<BitString>,
    pub subject_unique_id: Option<BitString>,
    pub extensions: Option<Vec<Extension>>,
}

Fields§

§version: Version

The certificate version

Note that this value defaults to Version 1 per the RFC. However, fields such as issuer_unique_id, subject_unique_id and extensions require later versions. Care should be taken in order to ensure standards compliance.

§serial_number: SerialNumber§signature: AlgorithmIdentifier<Any>§issuer: RdnSequence§validity: Validity§subject: RdnSequence§subject_public_key_info: SubjectPublicKeyInfo<Any, BitString>§issuer_unique_id: Option<BitString>§subject_unique_id: Option<BitString>§extensions: Option<Vec<Extension>>

Implementations

Source§

impl<P: Profile> TbsCertificateInner<P>

Source

pub fn get<'a, T: Decode<'a> + AssociatedOid>( &'a self, ) -> Result<Option<(bool, T)>, Error>

Decodes a single extension

Returns an error if multiple of these extensions is present. Returns Ok(None) if the extension is not present. Returns a decoding error if decoding failed. Otherwise returns the extension.

Source

pub fn filter<'a, T: Decode<'a> + AssociatedOid>( &'a self, ) -> impl 'a + Iterator<Item = Result<(bool, T), Error>>

Filters extensions by an associated OID

Returns a filtered iterator over all the extensions with the OID.

Trait Implementations

Source§

impl<P: Clone + Profile> Clone for TbsCertificateInner<P>

Source§

fn clone(&self) -> TbsCertificateInner<P>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + Profile> Debug for TbsCertificateInner<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'__der_lifetime, P: Profile> DecodeValue<'__der_lifetime> for TbsCertificateInner<P>

Source§

fn decode_value<R: Reader<'__der_lifetime>>( reader: &mut R, header: Header, ) -> Result<Self>

Attempt to decode this message using the provided Reader.
Source§

impl<'__der_lifetime, P: Profile> EncodeValue for TbsCertificateInner<P>

Source§

fn value_len(&self) -> Result<Length>

Compute the length of this value (sans [Tag]+Length header) when encoded as ASN.1 DER.
Source§

fn encode_value(&self, writer: &mut impl Writer) -> Result<()>

Encode value (sans [Tag]+Length header) as ASN.1 DER using the provided Writer.
Source§

fn header(&self) -> Result<Header, Error>
where Self: Tagged,

Get the Header used to encode this value.
Source§

impl<P: PartialEq + Profile> PartialEq for TbsCertificateInner<P>

Source§

fn eq(&self, other: &TbsCertificateInner<P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ValueOrd for TbsCertificateInner

Source§

fn value_cmp(&self, other: &Self) -> Result<Ordering>

Return an Ordering between value portion of TLV-encoded self and other when serialized as ASN.1 DER.
Source§

impl<P: Eq + Profile> Eq for TbsCertificateInner<P>

Source§

impl<'__der_lifetime, P: Profile> Sequence<'__der_lifetime> for TbsCertificateInner<P>

Source§

impl<P: Profile> StructuralPartialEq for TbsCertificateInner<P>