Package javax.crypto.spec
Class DHParameterSpec
java.lang.Object
javax.crypto.spec.DHParameterSpec
- All Implemented Interfaces:
AlgorithmParameterSpec
public class DHParameterSpec extends Object implements AlgorithmParameterSpec
The algorithm parameter specification for the Diffie-Hellman algorithm.
-
Constructor Summary
Constructors Constructor Description DHParameterSpec(BigInteger p, BigInteger g)Creates a newDHParameterSpecinstance with the specified prime modulus and base generator.DHParameterSpec(BigInteger p, BigInteger g, int l)Creates a newDHParameterSpecinstance with the specified prime modulus, base generator and size (in bits) of the random exponent. -
Method Summary
Modifier and Type Method Description BigIntegergetG()Returns the base generator of this parameter specification.intgetL()Returns the size (in bits) of the random exponent.BigIntegergetP()Returns the prime modulus of this parameter specification.
-
Constructor Details
-
DHParameterSpec
Creates a newDHParameterSpecinstance with the specified prime modulus and base generator.- Parameters:
p- the prime modulus.g- the base generator.
-
DHParameterSpec
Creates a newDHParameterSpecinstance with the specified prime modulus, base generator and size (in bits) of the random exponent.- Parameters:
p- the prime modulus.g- the base generator.l- the size of the random exponent (in bits).
-
-
Method Details
-
getP
Returns the prime modulus of this parameter specification.- Returns:
- the prime modulus.
-
getG
Returns the base generator of this parameter specification.- Returns:
- the base generator.
-
getL
public int getL()Returns the size (in bits) of the random exponent.- Returns:
- the size (in bits) of the random exponent.
-