Trait askar_crypto::repr::KeyPublicBytes[][src]

pub trait KeyPublicBytes: KeypairMeta {
    fn from_public_bytes(key: &[u8]) -> Result<Self, Error>
    where
        Self: Sized
;
fn with_public_bytes<O>(&self, f: impl FnOnce(&[u8]) -> O) -> O; }
Expand description

Convert between key instance and key public bytes.

Required methods

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

Expand description

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

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

Expand description

Access a temporary slice of the key public bytes.

Loading content...

Implementors

impl KeyPublicBytes for Ed25519KeyPair[src]

This is supported on crate feature ed25519 only.

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

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

impl KeyPublicBytes for K256KeyPair[src]

This is supported on crate feature k256 only.

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

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

impl KeyPublicBytes for P256KeyPair[src]

This is supported on crate feature p256 only.

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

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

impl KeyPublicBytes for X25519KeyPair[src]

This is supported on crate feature ed25519 only.

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

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

impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk> where
    Self: KeypairMeta
[src]

This is supported on crate feature bls only.

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

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

Loading content...