pub struct FileStore { /* private fields */ }Expand description
File-based key store with optional encryption
Provides persistent storage of cryptographic keys with optional encryption at rest The key are cached in memory for performamce and automatically loaded from disk
Implementations§
Source§impl FileStore
impl FileStore
Sourcepub fn new<P: AsRef<Path>>(path: P, config: StorageConfig) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P, config: StorageConfig) -> Result<Self>
Create a new FileStore at the given path
Sourcepub fn set_master_key(&mut self, key: SecretKey) -> Result<()>
pub fn set_master_key(&mut self, key: SecretKey) -> Result<()>
Set master key for encryption
Sourcepub fn init_with_password(&mut self, password: &[u8]) -> Result<()>
pub fn init_with_password(&mut self, password: &[u8]) -> Result<()>
Initialize with password-derived master key (now using Argon2)
Trait Implementations§
Source§impl EncryptedStore for FileStore
impl EncryptedStore for FileStore
Source§fn init_with_password(&mut self, password: &[u8]) -> Result<()>
fn init_with_password(&mut self, password: &[u8]) -> Result<()>
Initialise with password-derived master key
Source§fn is_unlocked(&self) -> bool
fn is_unlocked(&self) -> bool
Check if the store is unlocked (has a master key available)
Returns true if a master key has been set and the store can decrypt keys
Source§impl KeyLifeCycle for FileStore
impl KeyLifeCycle for FileStore
Source§impl KeyStore for FileStore
impl KeyStore for FileStore
Source§fn update_metadata(&mut self, id: &KeyId, metadata: KeyMetadata) -> Result<()>
fn update_metadata(&mut self, id: &KeyId, metadata: KeyMetadata) -> Result<()>
Update key metadata
Source§fn rotate_key(&mut self, id: &KeyId) -> Result<VersionedKey>
fn rotate_key(&mut self, id: &KeyId) -> Result<VersionedKey>
Rotate a key to a new version
Source§fn get_key_versions(&self, id: &KeyId) -> Result<Vec<VersionedKey>>
fn get_key_versions(&self, id: &KeyId) -> Result<Vec<VersionedKey>>
Get all verions of a key (sorted by version number)
Source§fn get_latest_key(&self, id: &KeyId) -> Result<VersionedKey>
fn get_latest_key(&self, id: &KeyId) -> Result<VersionedKey>
Get the latest active version of a key
Auto Trait Implementations§
impl Freeze for FileStore
impl RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl UnwindSafe for FileStore
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