anon.crypto
Class DSAKeyPair

java.lang.Object
  extended by anon.crypto.AsymmetricCryptoKeyPair
      extended by anon.crypto.DSAKeyPair

public class DSAKeyPair
extends AsymmetricCryptoKeyPair

This class creates key pairs for the DSA algorithm.

Author:
Rolf Wendolsky

Field Summary
 
Fields inherited from class anon.crypto.AsymmetricCryptoKeyPair
KEY_LENGTH_1024, KEY_LENGTH_512
 
Constructor Summary
DSAKeyPair(MyDSAPrivateKey a_privateKey)
          Creates a new DSA key pair.
 
Method Summary
static DSAKeyPair getInstance(java.security.SecureRandom a_secureRandom, int a_keyLength, int a_certainty)
          This creates a new DSA key pair.
private static DSAKeyPair getInstanceJCE(java.security.SecureRandom a_secureRandom, int a_keyLength, int a_certainty)
           
 
Methods inherited from class anon.crypto.AsymmetricCryptoKeyPair
createPublicKey, getPrivate, getPublic, isValidKeyPair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSAKeyPair

public DSAKeyPair(MyDSAPrivateKey a_privateKey)
Creates a new DSA key pair.

Parameters:
a_privateKey - a private key
Method Detail

getInstance

public static DSAKeyPair getInstance(java.security.SecureRandom a_secureRandom,
                                     int a_keyLength,
                                     int a_certainty)
This creates a new DSA key pair.

Parameters:
a_secureRandom - A random number as initialization for the key generator.
a_keyLength - The length of the key in bits. For the current implementation of bouncycastle it must be a number between 256 and 1024 which is a multiple of 64.
a_certainty - Measure of robustness of prime. For FIPS 186-2 compliance this value should be at least 80.
Returns:
a key pair or null if no key pair could be created with these parameters

getInstanceJCE

private static DSAKeyPair getInstanceJCE(java.security.SecureRandom a_secureRandom,
                                         int a_keyLength,
                                         int a_certainty)