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]

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.

Loading content...

Provided methods

fn to_keypair_bytes_buffer<B: WriteBuffer>(
    &self,
    out: &mut B
) -> Result<(), Error>
[src]

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.

Loading content...

Implementors

impl KeypairBytes for Ed25519KeyPair[src]

This is supported on crate feature ed25519 only.

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

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

impl KeypairBytes for K256KeyPair[src]

This is supported on crate feature k256 only.

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

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

impl KeypairBytes for P256KeyPair[src]

This is supported on crate feature p256 only.

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

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

impl KeypairBytes for X25519KeyPair[src]

This is supported on crate feature ed25519 only.

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

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

Loading content...