Trait PublicKeyBytes

Source
pub trait PublicKeyBytes: Sized {
    // Required methods
    fn from_bytes(bytes: &[u8]) -> Result<Self>;
    fn to_bytes(&self) -> Vec<u8> ;
}
Expand description

Extension trait for convenient public key operations

This trait can be implemented for public key types that have a byte representation.

Required Methods§

Source

fn from_bytes(bytes: &[u8]) -> Result<Self>

Create from byte representation

Source

fn to_bytes(&self) -> Vec<u8>

Convert to byte representation

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§