Struct lief::pe::signature::X509

pub struct X509<'a> { /* private fields */ }
Expand description

Structure for a x509 certificate

Implementations§

§

impl X509<'_>

pub fn version(&self) -> u32

X.509 version. (1=v1, 2=v2, 3=v3)

pub fn serial_number(&self) -> Vec<u8>

Unique id for certificate issued by a specific CA.

pub fn signature_algorithm(&self) -> String

Signature algorithm (OID)

pub fn valid_from(&self) -> Vec<u64>

Start time of certificate validity

pub fn valid_to(&self) -> Vec<u64>

End time of certificate validity

pub fn issuer(&self) -> String

Issuer information

pub fn subject(&self) -> String

Subject information

pub fn raw(&self) -> Vec<u8>

The raw x509 bytes (DER encoded)

pub fn key_type(&self) -> KeyType

Return the underlying public-key scheme

pub fn is_ca(&self) -> bool

pub fn signature(&self) -> Vec<u8>

The signature of the certificate

pub fn rsa_info(&self) -> Option<RsaInfo<'_>>

If the underlying public-key scheme is RSA, return the RSA information.

pub fn check_signature( &self, hash: &[u8], signature: &[u8], digest: Algorithms ) -> bool

Try to decrypt the given signature and check if it matches the given hash according to the hash algorithm provided

pub fn verify(&self, ca: &X509<'_>) -> VerificationFlags

Verify that this certificate has been used to trust the given certificate

Trait Implementations§

§

impl Debug for X509<'_>

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for X509<'a>

§

impl<'a> !Send for X509<'a>

§

impl<'a> !Sync for X509<'a>

§

impl<'a> Unpin for X509<'a>

§

impl<'a> UnwindSafe for X509<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.