pub struct AesEncryption { /* private fields */ }Expand description
Common encryption implementation for AES-256-GCM with PBKDF2 key derivation
Implementations§
Source§impl AesEncryption
impl AesEncryption
pub fn new() -> Self
pub fn with_salt(salt: [u8; 32]) -> Self
pub fn salt_base64(&self) -> String
pub fn from_salt_base64(salt_b64: &str) -> Result<Self, EncryptionError>
pub fn encrypt( &self, plaintext: &str, password: &str, empty_error: &str, ) -> Result<String, EncryptionError>
pub fn decrypt( &self, encrypted: &str, password: &str, ) -> Result<String, EncryptionError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AesEncryption
impl RefUnwindSafe for AesEncryption
impl Send for AesEncryption
impl Sync for AesEncryption
impl Unpin for AesEncryption
impl UnwindSafe for AesEncryption
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