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