Function rsa::algorithms::generate_multi_prime_key[][src]

pub fn generate_multi_prime_key<R: Rng>(
    rng: &mut R,
    nprimes: usize,
    bit_size: usize
) -> Result<RSAPrivateKey>
Expand description

Generates a multi-prime RSA keypair of the given bit size, and the given random source, as suggested in [1]. Although the public keys are compatible (actually, indistinguishable) from the 2-prime case, the private keys are not. Thus it may not be possible to export multi-prime private keys in certain formats or to subsequently import them into other code.

Uses default public key exponent of 65537. If you want to use a custom public key exponent value, use algorithms::generate_multi_prime_key_with_exp instead.

Table 1 in [2] suggests maximum numbers of primes for a given size.

[1] US patent 4405829 (1972, expired) [2] http://www.cacr.math.uwaterloo.ca/techreports/2006/cacr2006-16.pdf