cryptix.examples.pgp
Class KeyGen

java.lang.Object
  extended bycryptix.examples.pgp.KeyGen
All Implemented Interfaces:
RSAKeyGenObserver, TestPrimeObserver
Direct Known Subclasses:
VanityKeyGen

class KeyGen
extends java.lang.Object
implements RSAKeyGenObserver

DOCUMENT ME.

SECURITY: this should not be public, since it writes to "pubring.pgp" and "secring.pgp".


Field Summary
protected  java.io.DataInputStream in
           
protected  java.io.PrintStream out
           
 
Fields inherited from interface cryptix.security.rsa.RSAKeyGenObserver
FINDING_P, FINDING_Q, KEY_GEN_DONE, KEY_RESOLVING
 
Fields inherited from interface cryptix.math.TestPrimeObserver
HAS_SMALL_FACTORS, IS_PRIME, NO_SMALL_FACTORS, NOT_PRIME
 
Constructor Summary
KeyGen()
           
KeyGen(java.io.InputStream in, java.io.PrintStream out)
           
 
Method Summary
protected  void begin()
           
protected  SecretKey getKey(int length, RandomStream rs)
           
protected  int getKeyLength()
           
protected  java.lang.String getPassphrase()
          WARNING this prints the passphrase out on to the screen.
protected  RandomStream getRandomStream(int keyLength)
          This is NOT VERY SECURE as the seed is rather simplistic.
protected  java.lang.String getUserName()
           
 void handleEvent(int evnt)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected java.io.DataInputStream in

out

protected java.io.PrintStream out
Constructor Detail

KeyGen

public KeyGen(java.io.InputStream in,
              java.io.PrintStream out)

KeyGen

public KeyGen()
Method Detail

main

public static void main(java.lang.String[] args)

begin

protected final void begin()

getKey

protected SecretKey getKey(int length,
                           RandomStream rs)

getUserName

protected java.lang.String getUserName()
                                throws java.io.IOException
Throws:
java.io.IOException

getKeyLength

protected int getKeyLength()
                    throws java.io.IOException
Throws:
java.io.IOException

getRandomStream

protected RandomStream getRandomStream(int keyLength)
                                throws java.io.IOException
This is NOT VERY SECURE as the seed is rather simplistic.

Throws:
java.io.IOException

getPassphrase

protected java.lang.String getPassphrase()
                                  throws java.io.IOException
WARNING this prints the passphrase out on to the screen.

Throws:
java.io.IOException

handleEvent

public void handleEvent(int evnt)
Specified by:
handleEvent in interface TestPrimeObserver