Trait zeroize::Zeroize

source ·
pub trait Zeroize {
    fn zeroize(&mut self);
}
Expand description

Trait for securely erasing types from memory

Required Methods

Zero out this object from memory (using Rust or OS intrinsics which ensure the zeroization operation is not “optimized away”)

Implementations on Foreign Types

Byte slices are the core type we can zeroize

Zeroize Vec<u8>s by zeroizing their memory and then truncating them, for consistency with the String behavior below, and also as an indication the underlying memory has been wiped.

Zeroize Strings by zeroizing their backing memory then truncating them, to zero length (ensuring valid UTF-8, since they’re empty)

Implementors