Trait askar_crypto::repr::KeySecretBytes [−][src]
pub trait KeySecretBytes: KeyMeta { 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
fn from_secret_bytes(key: &[u8]) -> Result<Self, Error> where
Self: Sized,
[src]
Self: Sized,
Expand description
Create a new key instance from a slice of key secret bytes.
fn with_secret_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O
[src]
Expand description
Access a temporary slice of the key secret bytes, if any.
Implementors
impl KeySecretBytes for Ed25519KeyPair
[src]
impl KeySecretBytes for Ed25519KeyPair
[src]This is supported on crate feature
ed25519
only.impl KeySecretBytes for K256KeyPair
[src]
impl KeySecretBytes for K256KeyPair
[src]This is supported on crate feature
k256
only.impl KeySecretBytes for P256KeyPair
[src]
impl KeySecretBytes for P256KeyPair
[src]This is supported on crate feature
p256
only.impl KeySecretBytes for X25519KeyPair
[src]
impl KeySecretBytes for X25519KeyPair
[src]This is supported on crate feature
ed25519
only.impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>
[src]
impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>
[src]This is supported on crate feature
bls
only.impl<T: AesType> KeySecretBytes for AesKey<T>
[src]
impl<T: AesType> KeySecretBytes for AesKey<T>
[src]This is supported on crate feature
aes
only.impl<T: Chacha20Type> KeySecretBytes for Chacha20Key<T>
[src]
impl<T: Chacha20Type> KeySecretBytes for Chacha20Key<T>
[src]This is supported on crate feature
chacha
only.