ToSecretBytes

Trait ToSecretBytes 

Source
pub trait ToSecretBytes {
    // Required methods
    fn secret_bytes_length(&self) -> Result<usize, Error>;
    fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>;

    // Provided method
    fn to_secret_bytes(&self) -> Result<SecretBytes, Error> { ... }
}
Expand description

Object-safe trait for exporting key secret bytes

Required Methods§

Source

fn secret_bytes_length(&self) -> Result<usize, Error>

Get the length of a secret key

Source

fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>

Write the key secret bytes to a buffer.

Provided Methods§

Source

fn to_secret_bytes(&self) -> Result<SecretBytes, Error>

Available on crate feature alloc only.

Write the key secret bytes to a new allocated buffer.

Implementors§

Source§

impl ToSecretBytes for AnyKey

Available on crate feature any_key only.
Source§

impl<K> ToSecretBytes for K
where K: KeySecretBytes,