APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.provider

public Class DSAParameterGenerator

extends AlgorithmParameterGeneratorSpi
Class Inheritance
Imports
java.math.BigInteger, java.security.AlgorithmParameterGeneratorSpi, .AlgorithmParameters, .InvalidAlgorithmParameterException, .NoSuchAlgorithmException, .NoSuchProviderException, .InvalidParameterException, .MessageDigest, .SecureRandom, .ProviderException, java.security.spec.AlgorithmParameterSpec, .InvalidParameterSpecException, .DSAParameterSpec, .DSAGenParameterSpec

This class generates parameters for the DSA algorithm.
Author
Jan Luehe
Since
1.2
See Also
java.security.AlgorithmParameters, java.security.spec.AlgorithmParameterSpec, DSAParameters

Field Summary

Modifier and TypeField and Description
private SecureRandom
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected AlgorithmParameters

Returns:

the new AlgorithmParameters object
engineGenerateParameters
()

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineGenerateParameters.

Generates the parameters.

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

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

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

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

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

Initializes this parameter generator with a set of algorithm-specific parameter generation values.

private static BigInteger
private static BigInteger[]
generatePandQ(SecureRandom random, int valueL, int valueN, int seedLen)

private static byte[]

Field Detail

randomback to summary
private SecureRandom random
seedLenback to summary
private int seedLen
valueLback to summary
private int valueL
valueNback to summary
private int valueN

Constructor Detail

DSAParameterGeneratorback to summary
public DSAParameterGenerator()

Method Detail

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 strength, SecureRandom random)

Implements abstract java.security.AlgorithmParameterGeneratorSpi.engineInit.

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

Parameters
strength:int

the strength (size of prime) 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 algorithm-specific parameter generation values.

Parameters
genParamSpec:AlgorithmParameterSpec

the set of algorithm-specific 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
generateGback to summary
private static BigInteger generateG(BigInteger p, BigInteger q)
generatePandQback to summary
private static BigInteger[] generatePandQ(SecureRandom random, int valueL, int valueN, int seedLen)
toByteArrayback to summary
private static byte[] toByteArray(BigInteger bigInt)