public final class ElGamalKeyPairGenerator
extends java.security.KeyPairGenerator
Constructor and Description |
---|
ElGamalKeyPairGenerator()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.security.KeyPair |
generateKeyPair()
Actually generates the requested DH KeyPair.
|
void |
initialize(java.security.spec.AlgorithmParameterSpec params) |
void |
initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Initializes this ElGamalKeyPairGenerator with given ElGamal parameter specification and random seed.
|
void |
initialize(int keysize)
Initializes the ElGamalKeyPairGenerator for given prime modulus length.
|
void |
initialize(int keysize,
java.security.SecureRandom random)
Initializes the ElGamalKeyPairGenerator for given prime modulus length with the given
random seed.
|
public void initialize(int keysize)
initialize
in class java.security.KeyPairGenerator
keysize
- the length of the prime modulus in bitspublic void initialize(int keysize, java.security.SecureRandom random)
initialize
in class java.security.KeyPairGenerator
keysize
- the length of the prime modulus in bitsrandom
- the random seed as SecureRandom.public void initialize(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
initialize
in class java.security.KeyPairGenerator
java.security.InvalidAlgorithmParameterException
public void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
initialize
in class java.security.KeyPairGenerator
params
- the ElGamalParameterSpec representing prime modulus p
, base
generator g
, and exponent length l
random
- the random seed as SecureRandomjava.security.InvalidParameterException
- if the given algorithm parameter specification is not
a ElGamalParameterSpec or the size of the exponent is not
shorter than that of the prime modulus, both derived
from the given DH parameter specificationjava.security.InvalidAlgorithmParameterException
public java.security.KeyPair generateKeyPair()
generateKeyPair
in class java.security.KeyPairGenerator