public class RSAKeyPairGenerator extends java.lang.Object implements AsymmetricCipherKeyPairGenerator
Constructor and Description |
---|
RSAKeyPairGenerator() |
Modifier and Type | Method and Description |
---|---|
protected java.math.BigInteger |
chooseRandomPrime(int bitlength,
java.math.BigInteger e,
java.math.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(java.math.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 java.math.BigInteger chooseRandomPrime(int bitlength, java.math.BigInteger e, java.math.BigInteger sqrdBound)
bitlength
- the bit-length of the returned primee
- the RSA public exponentprotected boolean isProbablePrime(java.math.BigInteger x)