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]

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.

Loading content...

Implementors

impl KeySecretBytes for Ed25519KeyPair[src]

This is supported on crate feature ed25519 only.

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

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

impl KeySecretBytes for K256KeyPair[src]

This is supported on crate feature k256 only.

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

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

impl KeySecretBytes for P256KeyPair[src]

This is supported on crate feature p256 only.

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

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

impl KeySecretBytes for X25519KeyPair[src]

This is supported on crate feature ed25519 only.

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

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

impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>[src]

This is supported on crate feature bls only.

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

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

impl<T: AesType> KeySecretBytes for AesKey<T>[src]

This is supported on crate feature aes only.

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

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

impl<T: Chacha20Type> KeySecretBytes for Chacha20Key<T>[src]

This is supported on crate feature chacha only.

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

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

Loading content...