endtoend
Class KeyGen

java.lang.Object
  |
  +--endtoend.KeyGen

public class KeyGen
extends java.lang.Object

Generates a new set of random public and private key pair. Yet to be released. Stay tuned.

Version:
0.5.0.1

Constructor Summary
KeyGen(int keylen)
          Takes in a configurable key length.
 
Method Summary
 java.lang.String getPublicKey()
          Returns the public key in base64 format.
static void main(java.lang.String[] argc)
          Usage: java endtoend.KeyGen <public key file> <private key file> <password> Key strength is set at 1024 bits.
 void writePrivateKey(java.lang.String path, java.lang.String pass)
          Output the encrypted private key to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyGen

public KeyGen(int keylen)
Takes in a configurable key length.

A key length of 1024 is safe (for now).

Parameters:
keylen - number of bits in the public/private key
Method Detail

main

public static void main(java.lang.String[] argc)
Usage: java endtoend.KeyGen <public key file> <private key file> <password>

Key strength is set at 1024 bits.

The two files generated are in base64 format.


writePrivateKey

public void writePrivateKey(java.lang.String path,
                            java.lang.String pass)
                     throws java.io.IOException
Output the encrypted private key to a file.

Parameters:
path - private key file name
pass - password to lock the private key
java.io.IOException
See Also:
getPublicKey()

getPublicKey

public java.lang.String getPublicKey()
Returns the public key in base64 format.

Returns:
public key in base64 format
See Also:
writePrivateKey(java.lang.String, java.lang.String)