Skip to main content

ParsedCertificate

Struct ParsedCertificate 

Source
pub struct ParsedCertificate<'a> {
Show 13 fields pub der: &'a [u8], pub spki: &'a [u8], pub public_key: &'a [u8], pub issuer_dn: &'a [u8], pub subject_dn: &'a [u8], pub tbs: &'a [u8], pub signature_value: &'a [u8], pub sig_alg_oid: &'a [u8], pub spki_alg_oid: &'a [u8], pub is_ca: Option<bool>, pub has_server_auth_eku: Option<bool>, pub not_before: u64, pub not_after: u64,
}
Expand description

A pre-parsed X.509 certificate with all commonly accessed fields extracted in a single DER walk.

Fields§

§der: &'a [u8]

Full DER encoding.

§spki: &'a [u8]

SubjectPublicKeyInfo DER.

§public_key: &'a [u8]

Raw public key bytes (BIT STRING content, minus unused-bits byte).

§issuer_dn: &'a [u8]

Issuer Distinguished Name (value of the Name SEQUENCE).

§subject_dn: &'a [u8]

Subject Distinguished Name (value of the Name SEQUENCE).

§tbs: &'a [u8]

TBSCertificate raw bytes (tag + length + value) — the signed portion.

§signature_value: &'a [u8]

Signature value bytes (BIT STRING content).

§sig_alg_oid: &'a [u8]

Signature algorithm OID.

§spki_alg_oid: &'a [u8]

SPKI algorithm OID.

§is_ca: Option<bool>

Whether Basic Constraints cA is TRUE (None = extension absent).

§has_server_auth_eku: Option<bool>

Whether EKU includes serverAuth (None = extension absent).

§not_before: u64

notBefore as Unix timestamp (seconds since epoch).

§not_after: u64

notAfter as Unix timestamp (seconds since epoch).

Implementations§

Source§

impl<'a> ParsedCertificate<'a>

Source

pub fn from_der(der: &'a [u8]) -> Result<Self, Error>

Parse a DER-encoded X.509 certificate, extracting all fields at once.

Auto Trait Implementations§

§

impl<'a> Freeze for ParsedCertificate<'a>

§

impl<'a> RefUnwindSafe for ParsedCertificate<'a>

§

impl<'a> Send for ParsedCertificate<'a>

§

impl<'a> Sync for ParsedCertificate<'a>

§

impl<'a> Unpin for ParsedCertificate<'a>

§

impl<'a> UnsafeUnpin for ParsedCertificate<'a>

§

impl<'a> UnwindSafe for ParsedCertificate<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.