Public

Trait Public 

Source
pub trait Public:
    AsRef<[u8]>
    + AsMut<[u8]>
    + Default
    + Derive
    + CryptoType
    + PartialEq
    + Eq
    + Clone
    + Send
    + Sync
    + for<'a> TryFrom<&'a [u8]> {
    // Required methods
    fn from_slice(data: &[u8]) -> Self;
    fn to_public_crypto_pair(&self) -> CryptoTypePublicPair;

    // Provided methods
    fn to_raw_vec(&self) -> Vec<u8>  { ... }
    fn as_slice(&self) -> &[u8]  { ... }
}
Expand description

Trait suitable for typical cryptographic PKI key public type.

Required Methods§

Source

fn from_slice(data: &[u8]) -> Self

A new instance from the given slice.

NOTE: No checking goes on to ensure this is a real public key. Only use it if you are certain that the array actually is a pubkey. GIGO!

Source

fn to_public_crypto_pair(&self) -> CryptoTypePublicPair

Return CryptoTypePublicPair from public key.

Provided Methods§

Source

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

Return a Vec<u8> filled with raw data.

Source

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

Return a slice filled with raw data.

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§

Source§

impl Public for tet_core::ecdsa::Public

Source§

impl Public for tet_core::ed25519::Public

Source§

impl Public for tet_core::sr25519::Public

Source§

impl Public for Dummy