cryptix.examples.pgp
Class VanityKeyGen

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

public final class VanityKeyGen
extends KeyGen


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
VanityKeyGen()
           
 
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[] argv)
           
 
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

VanityKeyGen

public VanityKeyGen()
Method Detail

main

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

getKey

protected SecretKey getKey(int length,
                           RandomStream rs)
Overrides:
getKey in class KeyGen

begin

protected final void begin()

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