KeySecretBytes

Trait KeySecretBytes 

Source
pub trait KeySecretBytes: KeyMeta {
    // Required methods
    fn from_secret_bytes(key: &[u8]) -> Result<Self, Error>
       where Self: Sized;
    fn with_secret_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O;
}
Expand description

Convert between key instance and key secret bytes

Required Methods§

Source

fn from_secret_bytes(key: &[u8]) -> Result<Self, Error>
where Self: Sized,

Create a new key instance from a slice of key secret bytes.

Source

fn with_secret_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O

Access a temporary slice of the key secret bytes, if any.

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§

Source§

impl KeySecretBytes for Ed25519KeyPair

Available on crate feature ed25519 only.
Source§

impl KeySecretBytes for K256KeyPair

Available on crate feature k256 only.
Source§

impl KeySecretBytes for P256KeyPair

Available on crate features p256 or p256_hardware only.
Source§

impl KeySecretBytes for P384KeyPair

Available on crate feature p384 only.
Source§

impl KeySecretBytes for X25519KeyPair

Available on crate feature ed25519 only.
Source§

impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>

Available on crate feature bls only.
Source§

impl<T: AesType> KeySecretBytes for AesKey<T>

Available on crate feature aes only.
Source§

impl<T: Chacha20Type> KeySecretBytes for Chacha20Key<T>

Available on crate feature chacha only.