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

pack-priv Class RsaKeyPairGenerator

extends Object
implements AsymmetricCipherKeyPairGenerator
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.AsymmetricCipherKeyPairGenerator
Imports
java.math.BigInteger, org.bouncycastle.crypto.internal.AsymmetricCipherKeyPair, .AsymmetricCipherKeyPairGenerator, .KeyGenerationParameters, org.bouncycastle.crypto.internal.params.RsaKeyGenerationParameters, .RsaKeyParameters, .RsaPrivateCrtKeyParameters, org.bouncycastle.math.ec.WNafUtil, org.bouncycastle.math.internal.Primes

an RSA key pair generator.

Field Summary

Modifier and TypeField and Description
private static final BigInteger
private RsaKeyGenerationParameters

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private 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.internal.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.internal.AsymmetricCipherKeyPairGenerator.init.

intialise the key pair generator.
private boolean
isProbablePrime(BigInteger x, int iterations)

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
pack-priv RsaKeyPairGenerator()

Method Detail

chooseRandomPrimeback to summary
private 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.internal.AsymmetricCipherKeyPairGenerator.generateKeyPair.

Doc from org.bouncycastle.crypto.internal.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.internal.AsymmetricCipherKeyPairGenerator.init.

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

intialise the key pair generator.

Parameters
param:KeyGenerationParameters

the parameters the key pair is to be initialised with.

isProbablePrimeback to summary
private boolean isProbablePrime(BigInteger x, int iterations)