Top Description Fields Constructors Methods
org.bouncycastle.crypto.generators

public Class RSAKeyPairGenerator

extends Object
implements AsymmetricCipherKeyPairGenerator
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator
Imports
java.math.BigInteger, org.bouncycastle.crypto.AsymmetricCipherKeyPair, .AsymmetricCipherKeyPairGenerator, .CryptoServicePurpose, .CryptoServicesRegistrar, .KeyGenerationParameters, org.bouncycastle.crypto.constraints.ConstraintUtils, .DefaultServiceProperties, org.bouncycastle.crypto.params.RSAKeyGenerationParameters, .RSAKeyParameters, .RSAPrivateCrtKeyParameters, org.bouncycastle.math.Primes, org.bouncycastle.math.ec.WNafUtil, org.bouncycastle.util.BigIntegers

an RSA key pair generator.

Field Summary

Modifier and TypeField and Description
private static final BigInteger
private RSAKeyGenerationParameters

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected BigInteger

Returns:

A prime p, with (p-1) relatively prime to e
chooseRandomPrime
(int
the bit-length of the returned prime
bitlength
,
BigInteger
the RSA public exponent
e
,
BigInteger sqrdBound)

Choose a random prime value for use with RSA

public AsymmetricCipherKeyPair
generateKeyPair()

Implements org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator.generateKeyPair.

return an AsymmetricCipherKeyPair containing the generated keys.
private static int
getNumberOfIterations(int bits, int certainty)

public void
init(KeyGenerationParameters
the parameters the key pair is to be initialised with.
param
)

Implements org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator.init.

intialise the key pair generator.
protected boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ONEback to summary
private static final BigInteger ONE
paramback to summary
private RSAKeyGenerationParameters param

Constructor Detail

RSAKeyPairGeneratorback to summary
public RSAKeyPairGenerator()

Method Detail

chooseRandomPrimeback to summary
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)

Choose a random prime value for use with RSA

Parameters
bitlength:int

the bit-length of the returned prime

e:BigInteger

the RSA public exponent

Returns:BigInteger

A prime p, with (p-1) relatively prime to e

generateKeyPairback to summary
public AsymmetricCipherKeyPair generateKeyPair()

Implements org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator.generateKeyPair.

Doc from org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator.generateKeyPair.

return an AsymmetricCipherKeyPair containing the generated keys.

Returns:AsymmetricCipherKeyPair

an AsymmetricCipherKeyPair containing the generated keys.

getNumberOfIterationsback to summary
private static int getNumberOfIterations(int bits, int certainty)
initback to summary
public void init(KeyGenerationParameters param)

Implements org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator.init.

Doc from org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator.init.

intialise the key pair generator.

Parameters
param:KeyGenerationParameters

the parameters the key pair is to be initialised with.

isProbablePrimeback to summary
protected boolean isProbablePrime(BigInteger x)