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
[Expand]
Inherited Methods |
From class
java.security.KeyPairGenerator
final
KeyPair
|
genKeyPair()
Generates a key pair.
|
KeyPair
|
generateKeyPair()
Generates a key pair.
|
String
|
getAlgorithm()
Returns the standard name of the algorithm for this key pair generator.
|
static
KeyPairGenerator
|
getInstance(String algorithm, String provider)
Returns a KeyPairGenerator object that generates public/private
key pairs for the specified algorithm.
|
static
KeyPairGenerator
|
getInstance(String algorithm, Provider provider)
Returns a KeyPairGenerator object that generates public/private
key pairs for the specified algorithm.
|
static
KeyPairGenerator
|
getInstance(String algorithm)
Returns a KeyPairGenerator object that generates public/private
key pairs for the specified algorithm.
|
final
Provider
|
getProvider()
Returns the provider of this key pair generator object.
|
void
|
initialize(AlgorithmParameterSpec params)
Initializes the key pair generator using the specified parameter
set and the SecureRandom
implementation of the highest-priority installed provider as the source
of randomness.
|
void
|
initialize(AlgorithmParameterSpec params, SecureRandom random)
Initializes the key pair generator with the given parameter
set and source of randomness.
|
void
|
initialize(int keysize)
Initializes the key pair generator for a certain keysize using
a default parameter set and the SecureRandom
implementation of the highest-priority installed provider as the source
of randomness.
|
void
|
initialize(int keysize, SecureRandom random)
Initializes the key pair generator for a certain keysize with
the given source of randomness (and a default parameter set).
|
|
From class
java.security.KeyPairGeneratorSpi
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.security.interfaces.DSAKeyPairGenerator
abstract
void
|
initialize(DSAParams params, SecureRandom random)
Initializes the key pair generator using the DSA family parameters
(p,q and g) and an optional SecureRandom bit source.
|
abstract
void
|
initialize(int modlen, boolean genParams, SecureRandom random)
Initializes the key pair generator for a given modulus length
(instead of parameters), and an optional SecureRandom bit source.
|
|
Public Constructors
public
DSAKeyPairGenerator
()
Public Methods
public
KeyPair
generateKeyPair
()
Generates a pair of keys usable by any JavaSecurity compliant
DSA implementation.
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. |
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. |
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. |