KeyPublicBytes

Trait KeyPublicBytes 

Source
pub trait KeyPublicBytes: KeypairMeta {
    // Required methods
    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§

Source

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

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

Source

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

Access a temporary slice of the key public bytes.

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 KeyPublicBytes for Ed25519KeyPair

Available on crate feature ed25519 only.
Source§

impl KeyPublicBytes for K256KeyPair

Available on crate feature k256 only.
Source§

impl KeyPublicBytes for P256KeyPair

Available on crate features p256 or p256_hardware only.
Source§

impl KeyPublicBytes for P384KeyPair

Available on crate feature p384 only.
Source§

impl KeyPublicBytes for X25519KeyPair

Available on crate feature ed25519 only.
Source§

impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk>
where Self: KeypairMeta,

Available on crate feature bls only.