Trait taple_core::crypto::KeyGenerator
source · pub trait KeyGenerator: KeyMaterial {
// Required methods
fn from_seed(seed: &[u8]) -> Self
where Self: Sized;
fn from_public_key(public_key: &[u8]) -> Self
where Self: Sized;
fn from_secret_key(private_key: &[u8]) -> Self
where Self: Sized;
// Provided method
fn new() -> Self
where Self: Sized { ... }
}
Expand description
Collection of methods to initialize a key pair using random or deterministic manner
Required Methods§
sourcefn from_seed(seed: &[u8]) -> Selfwhere
Self: Sized,
fn from_seed(seed: &[u8]) -> Selfwhere Self: Sized,
Generates keys deterministically using a given seed
sourcefn from_public_key(public_key: &[u8]) -> Selfwhere
Self: Sized,
fn from_public_key(public_key: &[u8]) -> Selfwhere Self: Sized,
Generates keys from existing public key
sourcefn from_secret_key(private_key: &[u8]) -> Selfwhere
Self: Sized,
fn from_secret_key(private_key: &[u8]) -> Selfwhere Self: Sized,
Generate keys from existing secret key
Provided Methods§
Implementors§
impl KeyGenerator for Ed25519KeyPair
impl KeyGenerator for Secp256k1KeyPair
Keys generation