pub struct WrapKey { /* private fields */ }
Expand description
A wrapped Key for convenience and to ensure bytes are erased when dropped.
Implementations§
Source§impl WrapKey
impl WrapKey
Sourcepub fn new(key: &Key) -> Self
pub fn new(key: &Key) -> Self
Build a wrapped key by cloning the provided key. It is up to the caller to properly dispose of the memory.
Sourcepub fn from_bytes_and_erase_source(bytes: &mut [u8; 32]) -> Self
pub fn from_bytes_and_erase_source(bytes: &mut [u8; 32]) -> Self
Convenience method. Build the key from the submitted array reference. Since the bytes are cloned, the source is zeroed to help prevent security breaches.
Trait Implementations§
Source§impl From<&GenericArray<u8, <Salsa<R20> as NewStreamCipher>::KeySize>> for WrapKey
impl From<&GenericArray<u8, <Salsa<R20> as NewStreamCipher>::KeySize>> for WrapKey
Source§impl FromStr for WrapKey
Build a WrapKey
from a base64 encoded string. Same precaution applies with the string
data floating in memory after the key is built.
impl FromStr for WrapKey
Build a WrapKey
from a base64 encoded string. Same precaution applies with the string
data floating in memory after the key is built.
impl Eq for WrapKey
impl StructuralPartialEq for WrapKey
Auto Trait Implementations§
impl Freeze for WrapKey
impl RefUnwindSafe for WrapKey
impl Send for WrapKey
impl Sync for WrapKey
impl Unpin for WrapKey
impl UnwindSafe for WrapKey
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