CreateKey

Trait CreateKey 

Source
pub trait CreateKey
where Self: Sized,
{ type PrivKey; type PubKey; type Error; // Required methods fn from_privkey(privkey: Self::PrivKey) -> Result<Self, Self::Error>; fn gen_keypair() -> Self; fn privkey(&self) -> &Self::PrivKey; fn pubkey(&self) -> &Self::PubKey; fn address(&self) -> Address; fn sign_raw(&self, data: &[u8]) -> Result<Signature, Self::Error>; }
Expand description

Create secret Key

Required Associated Types§

Source

type PrivKey

Private key

Source

type PubKey

Public key

Source

type Error

Error

Required Methods§

Source

fn from_privkey(privkey: Self::PrivKey) -> Result<Self, Self::Error>

Create a pair from secret key

Source

fn gen_keypair() -> Self

Generate a pair of public and private keys

Source

fn privkey(&self) -> &Self::PrivKey

Get private key

Source

fn pubkey(&self) -> &Self::PubKey

Get public key

Source

fn address(&self) -> Address

Get address of the public key

Source

fn sign_raw(&self, data: &[u8]) -> Result<Signature, Self::Error>

Sign 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§