pub struct EncryptionKey(/* private fields */);Expand description
An AES-256-GCM encryption key (256 bits).
This is secret key material that must be protected. Use EncryptionKey::generate
to create a new random key, or EncryptionKey::from_bytes to restore from
secure storage.
Key material is securely zeroed from memory when dropped via ZeroizeOnDrop.
§Security
- Never log or expose the key bytes
- Store encrypted at rest (wrap with a KEK from the key hierarchy)
- Use one key per tenant/segment for isolation
Implementations§
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 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