pub trait Generate: KeyMaterial {
// Required methods
fn new() -> Result<Self, Error>
where Self: Sized;
fn new_with_seed(seed: &[u8]) -> Result<Self, Error>
where Self: Sized;
fn from_public_key(public_key: &[u8; 32]) -> Result<Self, Error>
where Self: Sized;
fn from_secret_key(private_key: &[u8; 32]) -> Result<Self, Error>
where Self: Sized;
}Expand description
A trait for types that support deterministic key generation.
Required Methods§
Sourcefn new() -> Result<Self, Error>where
Self: Sized,
fn new() -> Result<Self, Error>where
Self: Sized,
Generates a new random key.
Returns a Result containing the new key, or an Error if the operation fails.
Sourcefn new_with_seed(seed: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn new_with_seed(seed: &[u8]) -> Result<Self, Error>where
Self: Sized,
Generates a new key deterministically using the given seed.
Returns a Result containing the new key, or an Error if the operation fails.