pub trait KeyGen: Sized {
// Required method
fn generate(rng: impl KeyMaterial) -> Result<Self, Error>;
// Provided method
fn random() -> Result<Self, Error> { ... }
}Expand description
Raw key generation operations
Required Methods§
Sourcefn generate(rng: impl KeyMaterial) -> Result<Self, Error>
fn generate(rng: impl KeyMaterial) -> Result<Self, Error>
Create a new key from a key material generator.
Provided Methods§
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§
impl KeyGen for Ed25519KeyPair
Available on crate feature
ed25519 only.impl KeyGen for K256KeyPair
Available on crate feature
k256 only.impl KeyGen for P256KeyPair
Available on crate features
p256 or p256_hardware only.impl KeyGen for P384KeyPair
Available on crate feature
p384 only.impl KeyGen for X25519KeyPair
Available on crate feature
ed25519 only.impl<Pk: BlsPublicKeyType> KeyGen for BlsKeyPair<Pk>
Available on crate feature
bls only.impl<T: AesType> KeyGen for AesKey<T>
Available on crate feature
aes only.impl<T: Chacha20Type> KeyGen for Chacha20Key<T>
Available on crate feature
chacha only.