Struct schannel::cert_store::CertStore
source · pub struct CertStore(/* private fields */);
Expand description
Representation of certificate store on Windows, wrapping a HCERTSTORE
.
Implementations§
source§impl CertStore
impl CertStore
sourcepub fn open_current_user(which: &str) -> Result<CertStore>
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
sourcepub fn open_local_machine(which: &str) -> Result<CertStore>
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
sourcepub fn import_pkcs12(data: &[u8], password: Option<&str>) -> Result<CertStore>
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.
sourcepub fn certs(&self) -> Certs<'_> ⓘ
pub fn certs(&self) -> Certs<'_> ⓘ
Returns an iterator over the certificates in this certificate store.
sourcepub fn add_cert(
&mut self,
cx: &CertContext,
how: CertAdd
) -> Result<CertContext>
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.