pub struct ZeroizingVec(/* private fields */);Expand description
A wrapper for decrypted private key material that is zeroized on drop.
This type should be used whenever working with unencrypted private key bytes to ensure the sensitive data is securely erased from memory.
For long-lived key storage, prefer LockedVec which additionally pins
memory to RAM and excludes it from core dumps.
§Example
ⓘ
let decrypted = ZeroizingVec::new(decrypt_private_key(encrypted)?);
// Use decrypted key...
// When decrypted goes out of scope, memory is automatically zeroizedImplementations§
Trait Implementations§
Source§impl AsRef<[u8]> for ZeroizingVec
impl AsRef<[u8]> for ZeroizingVec
Source§impl Clone for ZeroizingVec
impl Clone for ZeroizingVec
Source§fn clone(&self) -> ZeroizingVec
fn clone(&self) -> ZeroizingVec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZeroizingVec
impl Debug for ZeroizingVec
Source§impl Drop for ZeroizingVec
impl Drop for ZeroizingVec
Source§impl Zeroize for ZeroizingVec
impl Zeroize for ZeroizingVec
impl ZeroizeOnDrop for ZeroizingVec
Auto Trait Implementations§
impl Freeze for ZeroizingVec
impl RefUnwindSafe for ZeroizingVec
impl Send for ZeroizingVec
impl Sync for ZeroizingVec
impl Unpin for ZeroizingVec
impl UnsafeUnpin for ZeroizingVec
impl UnwindSafe for ZeroizingVec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)