Struct botan::Certificate
source · pub struct Certificate { /* private fields */ }
Expand description
X.509 certificate
Implementations§
source§impl Certificate
impl Certificate
sourcepub fn load(data: &[u8]) -> Result<Certificate>
pub fn load(data: &[u8]) -> Result<Certificate>
Load a X.509 certificate from DER or PEM representation
sourcepub fn from_file(fsname: &str) -> Result<Certificate>
pub fn from_file(fsname: &str) -> Result<Certificate>
Read an X.509 certificate from a file
sourcepub fn serial_number(&self) -> Result<Vec<u8>>
pub fn serial_number(&self) -> Result<Vec<u8>>
Return the serial number of this certificate
sourcepub fn fingerprint(&self, hash: &str) -> Result<Vec<u8>>
pub fn fingerprint(&self, hash: &str) -> Result<Vec<u8>>
Return the fingerprint of this certificate
sourcepub fn duplicate(&self) -> Result<Certificate>
pub fn duplicate(&self) -> Result<Certificate>
Duplicate the certificate object
Since certificate objects are immutable, duplication just involves atomic incrementing a reference count, so is quite cheap
Return the authority key id, if set
sourcepub fn subject_key_id(&self) -> Result<Vec<u8>>
pub fn subject_key_id(&self) -> Result<Vec<u8>>
Return the subject key id, if set
sourcepub fn public_key_bits(&self) -> Result<Vec<u8>>
pub fn public_key_bits(&self) -> Result<Vec<u8>>
Return the byte representation of the public key
sourcepub fn public_key(&self) -> Result<Pubkey>
pub fn public_key(&self) -> Result<Pubkey>
Return the public key included in this certificate
sourcepub fn to_string(&self) -> Result<String>
pub fn to_string(&self) -> Result<String>
Return a free-form string representation of this certificate
sourcepub fn allows_usage(&self, usage: CertUsage) -> Result<bool>
pub fn allows_usage(&self, usage: CertUsage) -> Result<bool>
Test if the certificate is allowed for a particular usage
sourcepub fn verify(
&self,
intermediates: &[&Certificate],
trusted: &[&Certificate],
trusted_path: Option<&str>,
hostname: Option<&str>,
reference_time: Option<u64>
) -> Result<CertValidationStatus>
pub fn verify( &self, intermediates: &[&Certificate], trusted: &[&Certificate], trusted_path: Option<&str>, hostname: Option<&str>, reference_time: Option<u64> ) -> Result<CertValidationStatus>
Attempt to verify this certificate
sourcepub fn matches_hostname(&self, hostname: &str) -> Result<bool>
pub fn matches_hostname(&self, hostname: &str) -> Result<bool>
Return true if the provided hostname is valid for this certificate
Trait Implementations§
source§impl Clone for Certificate
impl Clone for Certificate
source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Certificate
impl Debug for Certificate
source§impl Drop for Certificate
impl Drop for Certificate
impl Send for Certificate
impl Sync for Certificate
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more