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]
Self: Sized,
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.
Implementors
impl KeyPublicBytes for Ed25519KeyPair
[src]
impl KeyPublicBytes for Ed25519KeyPair
[src]This is supported on crate feature
ed25519
only.impl KeyPublicBytes for K256KeyPair
[src]
impl KeyPublicBytes for K256KeyPair
[src]This is supported on crate feature
k256
only.impl KeyPublicBytes for P256KeyPair
[src]
impl KeyPublicBytes for P256KeyPair
[src]This is supported on crate feature
p256
only.impl KeyPublicBytes for X25519KeyPair
[src]
impl KeyPublicBytes for X25519KeyPair
[src]This is supported on crate feature
ed25519
only.impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk> where
Self: KeypairMeta,
[src]
impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk> where
Self: KeypairMeta,
[src]This is supported on crate feature
bls
only.