anon.crypto
Class RSAKeyPair

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

public class RSAKeyPair
extends AsymmetricCryptoKeyPair

This class creates key pairs for the RSA algorithm.

Author:
Rolf Wendolsky

Field Summary
static int KEY_LENGTH_2048
           
 
Fields inherited from class anon.crypto.AsymmetricCryptoKeyPair
KEY_LENGTH_1024, KEY_LENGTH_512
 
Constructor Summary
RSAKeyPair(MyRSAPrivateKey a_privateKey)
          Creates a new rsa key pair.
 
Method Summary
static RSAKeyPair getInstance(java.math.BigInteger a_publicExponent, java.security.SecureRandom a_random, int a_strength, int a_certainty)
          Creates a new rsa key pair.
static RSAKeyPair getInstance(java.security.SecureRandom a_random, int a_strength, int a_certainty)
          Creates a new rsa key pair with a public exponent of 65537.
 
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
 

Field Detail

KEY_LENGTH_2048

public static final int KEY_LENGTH_2048
See Also:
Constant Field Values
Constructor Detail

RSAKeyPair

public RSAKeyPair(MyRSAPrivateKey a_privateKey)
Creates a new rsa key pair.

Parameters:
a_privateKey - an rsa private key
Method Detail

getInstance

public static RSAKeyPair getInstance(java.math.BigInteger a_publicExponent,
                                     java.security.SecureRandom a_random,
                                     int a_strength,
                                     int a_certainty)
Creates a new rsa key pair.

Parameters:
a_publicExponent - the public encyption exponent; a small integer denoted e, often a prime close to a power of 2, for example 3, 5, 7, 17, 257, or 65537.
a_random - a random number generator
a_strength - The bit-length of n = p*q.
a_certainty - The certainty, that the generated numbers are prime.
Returns:
a key pair or null if no key pair could be created with these parameters

getInstance

public static RSAKeyPair getInstance(java.security.SecureRandom a_random,
                                     int a_strength,
                                     int a_certainty)
Creates a new rsa key pair with a public exponent of 65537.

Parameters:
a_random - a random number generator
a_strength - The bit-length of n = p*q.
a_certainty - The certainty, that the generated numbers are prime.
Returns:
a key pair or null if no key pair could be created with these parameters