public class

DSAKeyPairGenerator

extends KeyPairGenerator
implements DSAKeyPairGenerator
java.lang.Object
   ↳ java.security.KeyPairGeneratorSpi
     ↳ java.security.KeyPairGenerator
       ↳ sun.security.provider.DSAKeyPairGenerator

Class Overview

This class generates DSA key parameters and public/private key pairs according to the DSS standard NIST FIPS 186. It uses the updated version of SHA, SHA-1 as described in FIPS 180-1.

Summary

Public Constructors
DSAKeyPairGenerator()
Public Methods
KeyPair generateKeyPair()
Generates a pair of keys usable by any JavaSecurity compliant DSA implementation.
KeyPair generateKeyPair(BigInteger p, BigInteger q, BigInteger g, SecureRandom random)
void initialize(DSAParams params, SecureRandom random)
Initializes the DSA object using a DSA parameter object.
void initialize(int modlen, boolean genParams, SecureRandom random)
Initializes the DSA key pair generator.
void initialize(AlgorithmParameterSpec params, SecureRandom random)
Initializes the DSA object using a parameter object.
void initialize(int modlen, SecureRandom random)
Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).
[Expand]
Inherited Methods
From class java.security.KeyPairGenerator
From class java.security.KeyPairGeneratorSpi
From class java.lang.Object
From interface java.security.interfaces.DSAKeyPairGenerator

Public Constructors

public DSAKeyPairGenerator ()

Public Methods

public KeyPair generateKeyPair ()

Generates a pair of keys usable by any JavaSecurity compliant DSA implementation.

Returns
  • the generated key pair

public KeyPair generateKeyPair (BigInteger p, BigInteger q, BigInteger g, SecureRandom random)

public void initialize (DSAParams params, SecureRandom random)

Initializes the DSA object using a DSA parameter object.

Parameters
params a fully initialized DSA parameter object.
random the random bit source to use to generate key bits; can be null.

public void initialize (int modlen, boolean genParams, SecureRandom random)

Initializes the DSA key pair generator. If genParams is false, a set of pre-computed parameters is used.

Parameters
modlen the modulus length in bits. Valid values are any multiple of 8 between 512 and 1024, inclusive.
genParams whether or not to generate new parameters for the modulus length requested.
random the random bit source to use to generate key bits; can be null.

public void initialize (AlgorithmParameterSpec params, SecureRandom random)

Initializes the DSA object using a parameter object.

Parameters
params the parameter set to be used to generate the keys.
random the source of randomness for this generator.
Throws
InvalidAlgorithmParameterException if the given parameters are inappropriate for this key pair generator

public void initialize (int modlen, SecureRandom random)

Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).

Parameters
modlen the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.
random the source of randomness.