pub struct CertStore(/* private fields */);
Expand description

Representation of certificate store on Windows, wrapping a HCERTSTORE.

Implementations§

source§

impl CertStore

source

pub fn open_current_user(which: &str) -> Result<CertStore>

Opens up the specified key store within the context of the current user.

Common valid values for which are “My”, “Root”, “Trust”, “CA”. Additonal MSDN docs https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore#remarks

source

pub fn open_local_machine(which: &str) -> Result<CertStore>

Opens up the specified key store within the context of the local machine.

Common valid values for which are “My”, “Root”, “Trust”, “CA”. Additonal MSDN docs https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore#remarks

source

pub fn import_pkcs12(data: &[u8], password: Option<&str>) -> Result<CertStore>

Imports a PKCS#12-encoded key/certificate pair, returned as a CertStore instance.

The password must also be provided to decrypt the encoded data.

source

pub fn certs(&self) -> Certs<'_>

Returns an iterator over the certificates in this certificate store.

source

pub fn add_cert( &mut self, cx: &CertContext, how: CertAdd ) -> Result<CertContext>

Adds a certificate context to this store.

This function will add the certificate specified in cx to this store. A copy of the added certificate is returned.

source

pub fn export_pkcs12(&self, password: &str) -> Result<Vec<u8>>

Exports this certificate store as a PKCS#12-encoded blob.

The password specified will be the password used to unlock the returned data.

Trait Implementations§

source§

impl Clone for CertStore

source§

fn clone(&self) -> CertStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CertStore

source§

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

Formats the value using the given formatter. Read more
source§

impl Drop for CertStore

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl RawPointer for CertStore

source§

unsafe fn from_ptr(t: *mut c_void) -> CertStore

Constructs an instance of this type from its handle / pointer. Read more
source§

unsafe fn as_ptr(&self) -> *mut c_void

Get a raw pointer from the underlying handle / pointer. Read more
source§

impl Send for CertStore

source§

impl Sync for CertStore

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.