pub struct AeadKey {
pub data: Vec<u8>,
}Expand description
AEAD key.
§Zeroization
With the alloc feature, the key bytes in data are zeroized when the value
is dropped (#[derive(ZeroizeOnDrop)]), and can be wiped earlier by calling
[Zeroize::zeroize]. This is best-effort and covers only the current
allocation:
- If the
Vechas ever reallocated (growth,shrink_to_fit), earlier copies of its contents may remain elsewhere on the heap; the wipe cannot reach them. Construct keys with their final contents and do not growdata. datais a public field: moving the buffer out (for example withcore::mem::take(&mut key.data)) transfers ownership of the secret bytes — and responsibility for wiping them — to the caller.- Copies made through accessors (for example
as_bytes) are outside the scope of this wipe. - Without the
allocfeature,datais a borrowed&'static [u8]and is deliberately not zeroized: the borrow is not this type’s to wipe.
Fields§
§data: Vec<u8>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AeadKey
impl RefUnwindSafe for AeadKey
impl Send for AeadKey
impl Sync for AeadKey
impl Unpin for AeadKey
impl UnsafeUnpin for AeadKey
impl UnwindSafe for AeadKey
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