APIdia Launch Partner
Top Fields Constructors Methods
com.sun.crypto.provider

public final Class DHParameterGenerator

extends AlgorithmParameterGeneratorSpi
Class Inheritance
Imports
java.math.BigInteger, java.security.*, java.security.spec.*, javax.crypto.spec.DHParameterSpec, .DHGenParameterSpec

Field Summary

Modifier and TypeField and Description
private int
private int
private SecureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
checkSupport(int keysize, int exponentSize)

protected AlgorithmParameters

Returns:

the new AlgorithmParameters object
engineGenerateParameters
()

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineGenerateParameters.

Generates the parameters.

protected void
engineInit(int
the keysize (size of prime modulus) in bits
keysize
,
SecureRandom
the source of randomness
random
)

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

Initializes this parameter generator for a certain keysize and source of randomness.

protected void
engineInit(AlgorithmParameterSpec
the set of parameter generation values
genParamSpec
,
SecureRandom
the source of randomness
random
)

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

Initializes this parameter generator with a set of parameter generation values, which specify the size of the prime modulus and the size of the random exponent, both in bits.

Field Detail

exponentSizeback to summary
private int exponentSize
primeSizeback to summary
private int primeSize
randomback to summary
private SecureRandom random

Constructor Detail

DHParameterGeneratorback to summary
public DHParameterGenerator()

Method Detail

checkSupportback to summary
private static void checkSupport(int keysize, int exponentSize) throws InvalidParameterException
engineGenerateParametersback to summary
protected AlgorithmParameters engineGenerateParameters()

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineGenerateParameters.

Generates the parameters.

Returns:AlgorithmParameters

the new AlgorithmParameters object

Annotations
@Override
engineInitback to summary
protected void engineInit(int keysize, SecureRandom random)

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

Initializes this parameter generator for a certain keysize and source of randomness. The keysize is specified as the size in bits of the prime modulus.

Parameters
keysize:int

the keysize (size of prime modulus) in bits

random:SecureRandom

the source of randomness

Annotations
@Override
engineInitback to summary
protected void engineInit(AlgorithmParameterSpec genParamSpec, SecureRandom random) throws InvalidAlgorithmParameterException

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

Initializes this parameter generator with a set of parameter generation values, which specify the size of the prime modulus and the size of the random exponent, both in bits.

Parameters
genParamSpec:AlgorithmParameterSpec

the set of parameter generation values

random:SecureRandom

the source of randomness

Annotations
@Override
Exceptions
InvalidAlgorithmParameterException:
if the given parameter generation values are inappropriate for this parameter generator