Struct botan::Certificate[][src]

pub struct Certificate { /* fields omitted */ }

X.509 certificate

Implementations

impl Certificate[src]

pub fn load(data: &[u8]) -> Result<Certificate>[src]

Load a X.509 certificate from DER or PEM representation

pub fn from_file(fsname: &str) -> Result<Certificate>[src]

Read an X.509 certificate from a file

pub fn serial_number(&self) -> Result<Vec<u8>>[src]

Return the serial number of this certificate

pub fn fingerprint(&self, hash: &str) -> Result<Vec<u8>>[src]

Return the fingerprint of this certificate

pub fn duplicate(&self) -> Result<Certificate>[src]

Duplicate the certificate object

Since certificate objects are immutable, duplication just involves atomic incrementing a reference count, so is quite cheap

pub fn authority_key_id(&self) -> Result<Vec<u8>>[src]

Return the authority key id, if set

pub fn subject_key_id(&self) -> Result<Vec<u8>>[src]

Return the subject key id, if set

pub fn public_key_bits(&self) -> Result<Vec<u8>>[src]

Return the byte representation of the public key

pub fn public_key(&self) -> Result<Pubkey>[src]

Return the public key included in this certificate

pub fn to_string(&self) -> Result<String>[src]

Return a free-form string representation of this certificate

pub fn allows_usage(&self, usage: CertUsage) -> Result<bool>[src]

Test if the certificate is allowed for a particular usage

pub fn verify(
    &self,
    intermediates: &[&Certificate],
    trusted: &[&Certificate],
    trusted_path: Option<&str>,
    hostname: Option<&str>,
    reference_time: Option<u64>
) -> Result<CertValidationStatus>
[src]

Attempt to verify this certificate

pub fn matches_hostname(&self, hostname: &str) -> Result<bool>[src]

Return true if the provided hostname is valid for this certificate

Trait Implementations

impl Clone for Certificate[src]

impl Debug for Certificate[src]

impl Drop for Certificate[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.