KeyGen

Trait KeyGen 

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

Source

fn generate(rng: impl KeyMaterial) -> Result<Self, Error>

Create a new key from a key material generator.

Provided Methods§

Source

fn random() -> Result<Self, Error>

Available on crate feature getrandom only.

Generate a new random key.

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 KeyGen for Ed25519KeyPair

Available on crate feature ed25519 only.
Source§

impl KeyGen for K256KeyPair

Available on crate feature k256 only.
Source§

impl KeyGen for P256KeyPair

Available on crate features p256 or p256_hardware only.
Source§

impl KeyGen for P384KeyPair

Available on crate feature p384 only.
Source§

impl KeyGen for X25519KeyPair

Available on crate feature ed25519 only.
Source§

impl<Pk: BlsPublicKeyType> KeyGen for BlsKeyPair<Pk>

Available on crate feature bls only.
Source§

impl<T: AesType> KeyGen for AesKey<T>

Available on crate feature aes only.
Source§

impl<T: Chacha20Type> KeyGen for Chacha20Key<T>

Available on crate feature chacha only.