pub enum SqlCipherKey {
Passphrase(Vec<u8>),
RawKey([u8; 32]),
}Expand description
The key supplied by the caller.
Secure-by-design: the two shapes are distinct types, so a raw key can never be
mistaken for a passphrase (which would silently PBKDF2-stretch 32 random bytes
and fail to decrypt).
Variants§
Passphrase(Vec<u8>)
A user passphrase (PRAGMA key = 'passphrase'); the encryption key is
PBKDF2-derived from it and the database’s per-file salt.
RawKey([u8; 32])
A raw 32-byte key (PRAGMA key = "x'<64 hex>'"), used directly as the
AES-256 key. The salt for HMAC-key derivation still comes from the file.
Trait Implementations§
Source§impl Clone for SqlCipherKey
impl Clone for SqlCipherKey
Source§fn clone(&self) -> SqlCipherKey
fn clone(&self) -> SqlCipherKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SqlCipherKey
impl RefUnwindSafe for SqlCipherKey
impl Send for SqlCipherKey
impl Sync for SqlCipherKey
impl Unpin for SqlCipherKey
impl UnsafeUnpin for SqlCipherKey
impl UnwindSafe for SqlCipherKey
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