pub struct FileKeyStorage { /* private fields */ }
Expand description
File-based key storage implementation
Implementations§
Source§impl FileKeyStorage
impl FileKeyStorage
Sourcepub fn with_path<P: AsRef<Path>>(path: P) -> Self
pub fn with_path<P: AsRef<Path>>(path: P) -> Self
Create a new file-based key storage with custom base path
Sourcepub async fn store_key_async(
&mut self,
key_id: &String,
encrypted_key: &[u8],
) -> EncryptionResult<()>
pub async fn store_key_async( &mut self, key_id: &String, encrypted_key: &[u8], ) -> EncryptionResult<()>
Store a key asynchronously (non-blocking)
Sourcepub async fn retrieve_key_async(
&self,
key_id: &String,
) -> EncryptionResult<Vec<u8>>
pub async fn retrieve_key_async( &self, key_id: &String, ) -> EncryptionResult<Vec<u8>>
Retrieve a key asynchronously (non-blocking)
Sourcepub async fn delete_key_async(
&mut self,
key_id: &String,
) -> EncryptionResult<()>
pub async fn delete_key_async( &mut self, key_id: &String, ) -> EncryptionResult<()>
Delete a key asynchronously (non-blocking)
Trait Implementations§
Source§impl Clone for FileKeyStorage
impl Clone for FileKeyStorage
Source§fn clone(&self) -> FileKeyStorage
fn clone(&self) -> FileKeyStorage
Returns a duplicate 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 FileKeyStorage
impl Debug for FileKeyStorage
Source§impl Default for FileKeyStorage
impl Default for FileKeyStorage
Source§impl KeyStorage for FileKeyStorage
impl KeyStorage for FileKeyStorage
Source§fn store_key(
&mut self,
key_id: &String,
encrypted_key: &[u8],
) -> EncryptionResult<()>
fn store_key( &mut self, key_id: &String, encrypted_key: &[u8], ) -> EncryptionResult<()>
Store an encrypted key
Source§fn retrieve_key(&self, key_id: &String) -> EncryptionResult<Vec<u8>>
fn retrieve_key(&self, key_id: &String) -> EncryptionResult<Vec<u8>>
Retrieve an encrypted key
Source§fn delete_key(&mut self, key_id: &String) -> EncryptionResult<()>
fn delete_key(&mut self, key_id: &String) -> EncryptionResult<()>
Delete a key
Source§fn key_exists(&self, key_id: &String) -> bool
fn key_exists(&self, key_id: &String) -> bool
Check if a key exists
Auto Trait Implementations§
impl Freeze for FileKeyStorage
impl RefUnwindSafe for FileKeyStorage
impl Send for FileKeyStorage
impl Sync for FileKeyStorage
impl Unpin for FileKeyStorage
impl UnwindSafe for FileKeyStorage
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