Struct x509_parser::certificate::TbsCertificate[][src]

pub struct TbsCertificate<'a> {
    pub version: X509Version,
    pub serial: BigUint,
    pub signature: AlgorithmIdentifier<'a>,
    pub issuer: X509Name<'a>,
    pub validity: Validity,
    pub subject: X509Name<'a>,
    pub subject_pki: SubjectPublicKeyInfo<'a>,
    pub issuer_uid: Option<UniqueIdentifier<'a>>,
    pub subject_uid: Option<UniqueIdentifier<'a>>,
    pub extensions: HashMap<Oid<'a>, X509Extension<'a>>,
    // some fields omitted
}

The sequence TBSCertificate contains information associated with the subject of the certificate and the CA that issued it.

RFC5280 definition:

  TBSCertificate  ::=  SEQUENCE  {
       version         [0]  EXPLICIT Version DEFAULT v1,
       serialNumber         CertificateSerialNumber,
       signature            AlgorithmIdentifier,
       issuer               Name,
       validity             Validity,
       subject              Name,
       subjectPublicKeyInfo SubjectPublicKeyInfo,
       issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL,
                            -- If present, version MUST be v2 or v3
       subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL,
                            -- If present, version MUST be v2 or v3
       extensions      [3]  EXPLICIT Extensions OPTIONAL
                            -- If present, version MUST be v3
       }

Fields

version: X509Versionserial: BigUintsignature: AlgorithmIdentifier<'a>issuer: X509Name<'a>validity: Validitysubject: X509Name<'a>subject_pki: SubjectPublicKeyInfo<'a>issuer_uid: Option<UniqueIdentifier<'a>>subject_uid: Option<UniqueIdentifier<'a>>extensions: HashMap<Oid<'a>, X509Extension<'a>>

Implementations

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

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

Parse a DER-encoded TbsCertificate object

TBSCertificate  ::=  SEQUENCE  {
     version         [0]  Version DEFAULT v1,
     serialNumber         CertificateSerialNumber,
     signature            AlgorithmIdentifier,
     issuer               Name,
     validity             Validity,
     subject              Name,
     subjectPublicKeyInfo SubjectPublicKeyInfo,
     issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL,
                          -- If present, version MUST be v2 or v3
     subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL,
                          -- If present, version MUST be v2 or v3
     extensions      [3]  Extensions OPTIONAL
                          -- If present, version MUST be v3 --  }

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

Get a reference to the map of extensions.

pub fn basic_constraints(&self) -> Option<(bool, &BasicConstraints)>[src]

pub fn key_usage(&self) -> Option<(bool, &KeyUsage)>[src]

pub fn extended_key_usage(&self) -> Option<(bool, &ExtendedKeyUsage<'_>)>[src]

pub fn policy_constraints(&self) -> Option<(bool, &PolicyConstraints)>[src]

pub fn inhibit_anypolicy(&self) -> Option<(bool, &InhibitAnyPolicy)>[src]

pub fn policy_mappings(&self) -> Option<(bool, &PolicyMappings<'_>)>[src]

pub fn subject_alternative_name(
    &self
) -> Option<(bool, &SubjectAlternativeName<'_>)>
[src]

pub fn name_constraints(&self) -> Option<(bool, &NameConstraints<'_>)>[src]

pub fn is_ca(&self) -> bool[src]

Returns true if certificate has basicConstraints CA:true

pub fn raw_serial(&self) -> &[u8][src]

Get the raw bytes of the certificate serial number

pub fn raw_serial_as_string(&self) -> String[src]

Get a formatted string of the certificate serial number, separated by ‘:’

Trait Implementations

impl<'a> AsRef<[u8]> for TbsCertificate<'a>[src]

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

impl<'a> PartialEq<TbsCertificate<'a>> for TbsCertificate<'a>[src]

impl<'a> StructuralPartialEq for TbsCertificate<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for TbsCertificate<'a>

impl<'a> Send for TbsCertificate<'a>

impl<'a> Sync for TbsCertificate<'a>

impl<'a> Unpin for TbsCertificate<'a>

impl<'a> UnwindSafe for TbsCertificate<'a>

Blanket Implementations

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

impl<A, T> AsBits<T> for A where
    T: BitStore + BitRegister,
    A: AsRef<[T]>, 

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.