Function rsa::algorithms::generate_multi_prime_key_with_exp[][src]

pub fn generate_multi_prime_key_with_exp<R: Rng>(
    rng: &mut R,
    nprimes: usize,
    bit_size: usize,
    exp: &BigUint
) -> Result<RsaPrivateKey>
Expand description

Generates a multi-prime RSA keypair of the given bit size, public exponent, 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.

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