pub trait SerializeSecret: Sized {
// Required methods
fn from_bytes(bytes: &[u8]) -> Result<Self>;
fn to_bytes_zeroizing(&self) -> Zeroizing<Vec<u8>>;
}Expand description
A trait for secret types that can be securely serialized.
Required Methods§
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self>
fn from_bytes(bytes: &[u8]) -> Result<Self>
Creates an object from a byte slice. Input should be zeroized after use.
Sourcefn to_bytes_zeroizing(&self) -> Zeroizing<Vec<u8>>
fn to_bytes_zeroizing(&self) -> Zeroizing<Vec<u8>>
Converts the object to a byte vector that is zeroized on drop.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".