Trait SerializeSecret

Source
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§

Source

fn from_bytes(bytes: &[u8]) -> Result<Self>

Creates an object from a byte slice. Input should be zeroized after use.

Source

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", so this trait is not object safe.

Implementors§