pub struct EncryptionKey { /* private fields */ }Expand description
Secure encryption key with automatic zeroization
Implementations§
Source§impl EncryptionKey
impl EncryptionKey
Sourcepub fn from_passphrase(passphrase: &str, salt: &[u8]) -> Result<Self, String>
pub fn from_passphrase(passphrase: &str, salt: &[u8]) -> Result<Self, String>
Derive key from passphrase using PBKDF2-HMAC-SHA512
Sourcepub fn generate_salt() -> [u8; 16]
pub fn generate_salt() -> [u8; 16]
Generate a random salt for key derivation
Trait Implementations§
Source§impl Drop for EncryptionKey
impl Drop for EncryptionKey
Auto Trait Implementations§
impl Freeze for EncryptionKey
impl RefUnwindSafe for EncryptionKey
impl Send for EncryptionKey
impl Sync for EncryptionKey
impl Unpin for EncryptionKey
impl UnsafeUnpin for EncryptionKey
impl UnwindSafe for EncryptionKey
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