Function key_gen

Source
pub fn key_gen(
    alg: Algorithm,
    rng: &mut (impl CryptoRng + Rng),
) -> Result<(PrivateKey, PublicKey), Error>
Expand description

Generate a key pair for the Algorithm using the provided rng.

The function returns a fresh key or a Error::KeyGen error if

  • not enough entropy was available
  • it was not possible to generate a valid key within a reasonable amount of iterations.