Trait askar_crypto::repr::KeypairBytes [−][src]
pub trait KeypairBytes { fn from_keypair_bytes(key: &[u8]) -> Result<Self, Error>
where
Self: Sized; fn with_keypair_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O; fn to_keypair_bytes_buffer<B: WriteBuffer>(
&self,
out: &mut B
) -> Result<(), Error> { ... } fn to_keypair_bytes(&self) -> Result<SecretBytes, Error> { ... } }
Expand description
Convert between keypair instance and keypair (secret and public) bytes
Required methods
fn from_keypair_bytes(key: &[u8]) -> Result<Self, Error> where
Self: Sized,
[src]
Self: Sized,
Expand description
Create a new key instance from a slice of keypair bytes.
fn with_keypair_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O
[src]
Expand description
Create a new key instance from a slice of keypair bytes.
Provided methods
fn to_keypair_bytes_buffer<B: WriteBuffer>(
&self,
out: &mut B
) -> Result<(), Error>
[src]
&self,
out: &mut B
) -> Result<(), Error>
Expand description
Write the keypair bytes to a buffer.
fn to_keypair_bytes(&self) -> Result<SecretBytes, Error>
[src]
This is supported on crate feature
alloc
only.Expand description
Write the keypair bytes to a new allocated buffer.
Implementors
impl KeypairBytes for Ed25519KeyPair
[src]
impl KeypairBytes for Ed25519KeyPair
[src]This is supported on crate feature
ed25519
only.impl KeypairBytes for K256KeyPair
[src]
impl KeypairBytes for K256KeyPair
[src]This is supported on crate feature
k256
only.impl KeypairBytes for P256KeyPair
[src]
impl KeypairBytes for P256KeyPair
[src]This is supported on crate feature
p256
only.impl KeypairBytes for X25519KeyPair
[src]
impl KeypairBytes for X25519KeyPair
[src]This is supported on crate feature
ed25519
only.