public class DHParametersGenerator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
certainty |
private java.security.SecureRandom |
random |
private int |
size |
private static java.math.BigInteger |
TWO |
Constructor and Description |
---|
DHParametersGenerator() |
Modifier and Type | Method and Description |
---|---|
DHParameters |
generateParameters()
which generates the p and g values from the given parameters,
returning the DHParameters object.
|
void |
init(int size,
int certainty,
java.security.SecureRandom random)
Initialise the parameters generator.
|
private int size
private int certainty
private java.security.SecureRandom random
private static final java.math.BigInteger TWO
public void init(int size, int certainty, java.security.SecureRandom random)
size
- bit length for the prime pcertainty
- level of certainty for the prime number testsrandom
- a source of randomnesspublic DHParameters generateParameters()
Note: can take a while...