public class RSAKeyPairGenerator extends Object implements AsymmetricCipherKeyPairGenerator
Constructor and Description |
---|
RSAKeyPairGenerator() |
Modifier and Type | Method and Description |
---|---|
protected BigInteger |
chooseRandomPrime(int bitlength,
BigInteger e,
BigInteger sqrdBound)
Choose a random prime value for use with RSA
|
AsymmetricCipherKeyPair |
generateKeyPair()
return an AsymmetricCipherKeyPair containing the generated keys.
|
void |
init(KeyGenerationParameters param)
intialise the key pair generator.
|
protected boolean |
isProbablePrime(BigInteger x) |
public void init(KeyGenerationParameters param)
AsymmetricCipherKeyPairGenerator
init
in interface AsymmetricCipherKeyPairGenerator
param
- the parameters the key pair is to be initialised with.public AsymmetricCipherKeyPair generateKeyPair()
AsymmetricCipherKeyPairGenerator
generateKeyPair
in interface AsymmetricCipherKeyPairGenerator
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
bitlength
- the bit-length of the returned primee
- the RSA public exponentprotected boolean isProbablePrime(BigInteger x)
Copyright © 2021 BouncyCastle.org. All rights reserved.