PublicKeyExt

Trait PublicKeyExt 

Source
pub trait PublicKeyExt: Sized {
    type FromBytesErr;

    // Required methods
    fn as_bytes(&self) -> &[u8] ;
    fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, Self::FromBytesErr>;
    fn scheme(&self) -> SignatureScheme;

    // Provided method
    fn to_flagged_bytes(&self) -> Vec<u8>  { ... }
}

Required Associated Types§

Required Methods§

Source

fn as_bytes(&self) -> &[u8]

Returns the public key as bytes.

Source

fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, Self::FromBytesErr>

Tries to create a PublicKey from bytes.

Source

fn scheme(&self) -> SignatureScheme

Returns the signature scheme for this public key.

Provided Methods§

Source

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

Returns the bytes with signature scheme flag prepended

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§