public class DSAKeyPairGenerator extends java.lang.Object implements AsymmetricCipherKeyPairGenerator
Modifier and Type | Field and Description |
---|---|
private static java.math.BigInteger |
ONE |
private DSAKeyGenerationParameters |
param |
Constructor and Description |
---|
DSAKeyPairGenerator() |
Modifier and Type | Method and Description |
---|---|
private static java.math.BigInteger |
calculatePublicKey(java.math.BigInteger p,
java.math.BigInteger g,
java.math.BigInteger x) |
AsymmetricCipherKeyPair |
generateKeyPair()
return an AsymmetricCipherKeyPair containing the generated keys.
|
private static java.math.BigInteger |
generatePrivateKey(java.math.BigInteger q,
java.security.SecureRandom random) |
void |
init(KeyGenerationParameters param)
intialise the key pair generator.
|
private static final java.math.BigInteger ONE
private DSAKeyGenerationParameters param
public void init(KeyGenerationParameters param)
AsymmetricCipherKeyPairGenerator
init
in interface AsymmetricCipherKeyPairGenerator
param
- the parameters the key pair is to be initialised with.public AsymmetricCipherKeyPair generateKeyPair()
AsymmetricCipherKeyPairGenerator
generateKeyPair
in interface AsymmetricCipherKeyPairGenerator
private static java.math.BigInteger generatePrivateKey(java.math.BigInteger q, java.security.SecureRandom random)
private static java.math.BigInteger calculatePublicKey(java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger x)