cryptix.security.rsa
Class RSAKeyGen

java.lang.Object
  |
  +--cryptix.security.rsa.RSAKeyGen
Direct Known Subclasses:
VanityRSAKeyGen

public class RSAKeyGen
extends java.lang.Object

This class is an RSA key pair generator.

Copyright (c) 1995, 1996 Systemics Ltd (http://www.systemics.com/) All rights reserved.


Field Summary
protected  RandomStream rand
           
 
Constructor Summary
RSAKeyGen(RandomStream rand0)
           
 
Method Summary
 SecretKey createKey(int bitlen)
          This function creates a Secret Key.
 SecretKey createKey(int bitlen, RSAKeyGenObserver obsrv)
          An observer class is used to monitor progress.
static SecretKey createKey(RandomStream rand, int bitlen)
          This function creates a Secret Key.
static SecretKey createKey(RandomStream rand, int bitlen, RSAKeyGenObserver obsrv)
          An observer class is used to monitor progress.
protected  SecretKey deriveKeys(BigInteger p, BigInteger q, BigInteger e)
          An observer class is used to monitor progress.
 BigInteger randomPrime(int bitlen, RSAKeyGenObserver obsrv)
          An observer class is used to monitor progress.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rand

protected RandomStream rand
Constructor Detail

RSAKeyGen

public RSAKeyGen(RandomStream rand0)
Parameters:
rand0 - the source of random numbers for the prime number generation.
Method Detail

randomPrime

public BigInteger randomPrime(int bitlen,
                              RSAKeyGenObserver obsrv)
An observer class is used to monitor progress.


createKey

public static final SecretKey createKey(RandomStream rand,
                                        int bitlen)
This function creates a Secret Key.

N.B. this can take a LONG time.

Parameters:
rand - the source of random data for the prime number generation.
bitlen - the bit length of the final n
Returns:
a random RSA SecretKey.

createKey

public static final SecretKey createKey(RandomStream rand,
                                        int bitlen,
                                        RSAKeyGenObserver obsrv)
An observer class is used to monitor progress.
Parameters:
rand - the source of random data for the prime number generation.
bitlen - The bit length of the final n
obsrv - The callback interface.
Returns:
a random RSA SecretKey.

createKey

public SecretKey createKey(int bitlen)
This function creates a Secret Key.

N.B. this can take a LONG time.

Parameters:
bitlen - the bit length of the final n
Returns:
a random RSA SecretKey.

createKey

public SecretKey createKey(int bitlen,
                           RSAKeyGenObserver obsrv)
An observer class is used to monitor progress.
Parameters:
bitlen - The bit length of the final n
obsrv - The callback interface.
Returns:
a random RSA SecretKey.

deriveKeys

protected final SecretKey deriveKeys(BigInteger p,
                                     BigInteger q,
                                     BigInteger e)
An observer class is used to monitor progress.
Parameters:
p - the largest factor of n
q - the other factor of n
e - the initial public exponent (must be odd).
Returns:
a random RSA SecretKey.