pub struct KeyManager { /* private fields */ }Expand description
Key manager for secure key storage and retrieval
Implementations§
Source§impl KeyManager
impl KeyManager
Sourcepub fn with_storage<P: AsRef<Path>>(path: P) -> Self
pub fn with_storage<P: AsRef<Path>>(path: P) -> Self
Create a key manager with persistent storage
Sourcepub async fn store(&self, alias: String, keypair: KeyPair) -> Result<Uuid>
pub async fn store(&self, alias: String, keypair: KeyPair) -> Result<Uuid>
Store a new keypair with an alias
Sourcepub async fn get_by_alias(&self, alias: &str) -> Result<KeyPair>
pub async fn get_by_alias(&self, alias: &str) -> Result<KeyPair>
Retrieve a keypair by alias
Sourcepub async fn list_aliases(&self) -> Vec<String>
pub async fn list_aliases(&self) -> Vec<String>
List all key aliases
Sourcepub async fn alias_exists(&self, alias: &str) -> bool
pub async fn alias_exists(&self, alias: &str) -> bool
Check if an alias exists
Sourcepub async fn load_from_storage(&self) -> Result<usize>
pub async fn load_from_storage(&self) -> Result<usize>
Load all keys from persistent storage
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyManager
impl !RefUnwindSafe for KeyManager
impl Send for KeyManager
impl Sync for KeyManager
impl Unpin for KeyManager
impl !UnwindSafe for KeyManager
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