Top Fields Constructors Methods
org.bouncycastle.crypto.generators

public Class DHParametersGenerator

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.params.DHParameters

Field Summary

Modifier and TypeField and Description
private int
private SecureRandom
private int
private static final BigInteger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DHParameters

Returns:

a generated Diffie-Hellman parameters object.
generateParameters
()

which generates the p and g values from the given parameters, returning the DHParameters object.

public void
init(int
bit length for the prime p
size
,
int
level of certainty for the prime number tests
certainty
,
SecureRandom
a source of randomness
random
)

Initialise the parameters generator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certaintyback to summary
private int certainty
randomback to summary
private SecureRandom random
sizeback to summary
private int size
TWOback to summary
private static final BigInteger TWO

Constructor Detail

DHParametersGeneratorback to summary
public DHParametersGenerator()

Method Detail

generateParametersback to summary
public DHParameters generateParameters()

which generates the p and g values from the given parameters, returning the DHParameters object.

Note

can take a while...

Returns:DHParameters

a generated Diffie-Hellman parameters object.

initback to summary
public void init(int size, int certainty, SecureRandom random)

Initialise the parameters generator.

Parameters
size:int

bit length for the prime p

certainty:int

level of certainty for the prime number tests

random:SecureRandom

a source of randomness