pub struct WorkspaceKeyManager { /* private fields */ }
Expand description
Workspace key manager for handling per-workspace encryption keys
Implementations§
Source§impl WorkspaceKeyManager
impl WorkspaceKeyManager
Sourcepub fn with_storage_path<P: AsRef<Path>>(path: P) -> Self
pub fn with_storage_path<P: AsRef<Path>>(path: P) -> Self
Create a workspace key manager with custom key storage path
Sourcepub fn generate_workspace_key(&self, workspace_id: &str) -> Result<String>
pub fn generate_workspace_key(&self, workspace_id: &str) -> Result<String>
Generate a new workspace key and encrypt it with the master key
Sourcepub fn get_workspace_key(&self, workspace_id: &str) -> Result<EncryptionKey>
pub fn get_workspace_key(&self, workspace_id: &str) -> Result<EncryptionKey>
Get the decrypted workspace key for a given workspace
Sourcepub fn has_workspace_key(&self, workspace_id: &str) -> bool
pub fn has_workspace_key(&self, workspace_id: &str) -> bool
Check if workspace key exists
Sourcepub fn generate_workspace_key_backup(
&self,
workspace_id: &str,
) -> Result<String>
pub fn generate_workspace_key_backup( &self, workspace_id: &str, ) -> Result<String>
Generate a backup string for the workspace key (for sharing between devices)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WorkspaceKeyManager
impl !RefUnwindSafe for WorkspaceKeyManager
impl Send for WorkspaceKeyManager
impl !Sync for WorkspaceKeyManager
impl Unpin for WorkspaceKeyManager
impl UnwindSafe for WorkspaceKeyManager
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