pub struct KeyStore { /* private fields */ }
Expand description
Key store for managing encryption keys
Implementations§
Source§impl KeyStore
impl KeyStore
Sourcepub fn store_key(&mut self, id: String, key: EncryptionKey)
pub fn store_key(&mut self, id: String, key: EncryptionKey)
Store a key with a given identifier
Sourcepub fn get_key(&self, id: &str) -> Option<&EncryptionKey>
pub fn get_key(&self, id: &str) -> Option<&EncryptionKey>
Retrieve a key by identifier
Sourcepub fn remove_key(&mut self, id: &str) -> bool
pub fn remove_key(&mut self, id: &str) -> bool
Remove a key
Sourcepub fn derive_and_store_key(
&mut self,
id: String,
password: &str,
algorithm: EncryptionAlgorithm,
method: KeyDerivationMethod,
) -> Result<()>
pub fn derive_and_store_key( &mut self, id: String, password: &str, algorithm: EncryptionAlgorithm, method: KeyDerivationMethod, ) -> Result<()>
Derive and store a key from password
Trait Implementations§
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