pub struct EncryptionManager { /* private fields */ }Expand description
Encryption manager for repository
Implementations§
Source§impl EncryptionManager
impl EncryptionManager
Sourcepub fn new(config: EncryptionConfig) -> Self
pub fn new(config: EncryptionConfig) -> Self
Create new encryption manager
Sourcepub fn initialize(&mut self, passphrase: &str) -> Result<(), String>
pub fn initialize(&mut self, passphrase: &str) -> Result<(), String>
Initialize encryption with passphrase
Sourcepub fn initialize_with_cache(
&mut self,
repo_path: &str,
passphrase: Option<&str>,
) -> Result<(), String>
pub fn initialize_with_cache( &mut self, repo_path: &str, passphrase: Option<&str>, ) -> Result<(), String>
Initialize encryption with passphrase caching support
Sourcepub fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>, String>
pub fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>, String>
Encrypt data if encryption is enabled
Sourcepub fn decrypt(&self, encrypted: &[u8]) -> Result<Vec<u8>, String>
pub fn decrypt(&self, encrypted: &[u8]) -> Result<Vec<u8>, String>
Decrypt data if encryption is enabled
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if encryption is enabled
Auto Trait Implementations§
impl !Freeze for EncryptionManager
impl RefUnwindSafe for EncryptionManager
impl Send for EncryptionManager
impl Sync for EncryptionManager
impl Unpin for EncryptionManager
impl UnsafeUnpin for EncryptionManager
impl UnwindSafe for EncryptionManager
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