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§
Sourcefn from_public_bytes(key: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_public_bytes(key: &[u8]) -> Result<Self, Error>where
Self: Sized,
Create a new key instance from a slice of public key bytes.
Sourcefn with_public_bytes<O>(&self, f: impl FnOnce(&[u8]) -> O) -> O
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§
impl KeyPublicBytes for Ed25519KeyPair
Available on crate feature
ed25519 only.impl KeyPublicBytes for K256KeyPair
Available on crate feature
k256 only.impl KeyPublicBytes for P256KeyPair
Available on crate features
p256 or p256_hardware only.impl KeyPublicBytes for P384KeyPair
Available on crate feature
p384 only.impl KeyPublicBytes for X25519KeyPair
Available on crate feature
ed25519 only.impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk>where
Self: KeypairMeta,
Available on crate feature
bls only.