APIdia Launch Partner
Top Description Fields Constructors Methods
javax.crypto.spec

public Class DHGenParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.security.spec.AlgorithmParameterSpec

This class specifies the set of parameters used for generating Diffie-Hellman (system) parameters for use in Diffie-Hellman key agreement. This is typically done by a central authority.

The central authority, after computing the parameters, must send this information to the parties looking to agree on a secret key.

Author
Jan Luehe
Since
1.4
See Also
DHParameterSpec

Field Summary

Modifier and TypeField and Description
private final int
private final int

Constructor Summary

AccessConstructor and Description
public
DHGenParameterSpec(int
the size (in bits) of the prime modulus.
primeSize
,
int
the size (in bits) of the random exponent.
exponentSize
)

Constructs a parameter set for the generation of Diffie-Hellman (system) parameters.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the size in bits of the random exponent (private value)
getExponentSize
()

Returns the size in bits of the random exponent (private value).

public int

Returns:

the size in bits of the prime modulus
getPrimeSize
()

Returns the size in bits of the prime modulus.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exponentSizeback to summary
private final int exponentSize
primeSizeback to summary
private final int primeSize

Constructor Detail

DHGenParameterSpecback to summary
public DHGenParameterSpec(int primeSize, int exponentSize)

Constructs a parameter set for the generation of Diffie-Hellman (system) parameters. The constructed parameter set can be used to initialize an AlgorithmParameterGenerator object for the generation of Diffie-Hellman parameters.

Parameters
primeSize:int

the size (in bits) of the prime modulus.

exponentSize:int

the size (in bits) of the random exponent.

Method Detail

getExponentSizeback to summary
public int getExponentSize()

Returns the size in bits of the random exponent (private value).

Returns:int

the size in bits of the random exponent (private value)

getPrimeSizeback to summary
public int getPrimeSize()

Returns the size in bits of the prime modulus.

Returns:int

the size in bits of the prime modulus