pub struct BackupEncryption { /* private fields */ }Expand description
Backup encryption manager
Implementations§
Source§impl BackupEncryption
impl BackupEncryption
Sourcepub fn new(config: EncryptionConfig) -> Result<Self>
pub fn new(config: EncryptionConfig) -> Result<Self>
Create new backup encryption manager
Sourcepub fn encrypt(&mut self, plaintext: &[u8]) -> Result<EncryptedData>
pub fn encrypt(&mut self, plaintext: &[u8]) -> Result<EncryptedData>
Encrypt data
Sourcepub fn encrypt_file(
&mut self,
input_path: &Path,
output_path: &Path,
) -> Result<()>
pub fn encrypt_file( &mut self, input_path: &Path, output_path: &Path, ) -> Result<()>
Encrypt a file
Sourcepub fn change_password(
&mut self,
encrypted: &EncryptedData,
new_password: impl Into<String>,
) -> Result<EncryptedData>
pub fn change_password( &mut self, encrypted: &EncryptedData, new_password: impl Into<String>, ) -> Result<EncryptedData>
Change password (re-encrypt with new password)
Auto Trait Implementations§
impl Freeze for BackupEncryption
impl RefUnwindSafe for BackupEncryption
impl Send for BackupEncryption
impl Sync for BackupEncryption
impl Unpin for BackupEncryption
impl UnwindSafe for BackupEncryption
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more