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§
Sourcefn from_secret_bytes(key: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_secret_bytes(key: &[u8]) -> Result<Self, Error>where
Self: Sized,
Create a new key instance from a slice of key secret bytes.
Sourcefn with_secret_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O
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§
impl KeySecretBytes for Ed25519KeyPair
Available on crate feature
ed25519 only.impl KeySecretBytes for K256KeyPair
Available on crate feature
k256 only.impl KeySecretBytes for P256KeyPair
Available on crate features
p256 or p256_hardware only.impl KeySecretBytes for P384KeyPair
Available on crate feature
p384 only.impl KeySecretBytes for X25519KeyPair
Available on crate feature
ed25519 only.impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>
Available on crate feature
bls only.impl<T: AesType> KeySecretBytes for AesKey<T>
Available on crate feature
aes only.impl<T: Chacha20Type> KeySecretBytes for Chacha20Key<T>
Available on crate feature
chacha only.