pub struct KeyStore { /* private fields */ }Expand description
A key store holding a private key and a chain of certificates
Implementations§
Source§impl KeyStore
impl KeyStore
Sourcepub fn new<I>(key: PrivateKey, certs: I) -> Result<Self>where
I: IntoIterator<Item = Certificate>,
pub fn new<I>(key: PrivateKey, certs: I) -> Result<Self>where
I: IntoIterator<Item = Certificate>,
Create new key store. The first certificate entry must be a leaf certificate.
Sourcepub fn from_pkcs12(data: &[u8], password: &str) -> Result<Self>
pub fn from_pkcs12(data: &[u8], password: &str) -> Result<Self>
Load key store from the PKCS12/PFX file
Sourcepub fn to_pkcs12(&self, alias: &str, password: &str) -> Result<Vec<u8>>
pub fn to_pkcs12(&self, alias: &str, password: &str) -> Result<Vec<u8>>
Write key store to PKCS12/PFX file
Sourcepub fn from_pkcs8(data: &[u8]) -> Result<Self>
pub fn from_pkcs8(data: &[u8]) -> Result<Self>
Load key store from PEM-encoded PKCS8 file which contains both private key and certificate chain
Sourcepub fn private_key(&self) -> &PrivateKey
pub fn private_key(&self) -> &PrivateKey
Return private key of this key store
Sourcepub fn certs(&self) -> &[Certificate]
pub fn certs(&self) -> &[Certificate]
Return certificate chain of this key store, leaf certificate first
Auto Trait Implementations§
impl Freeze for KeyStore
impl RefUnwindSafe for KeyStore
impl Send for KeyStore
impl Sync for KeyStore
impl Unpin for KeyStore
impl UnwindSafe for KeyStore
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