moses.security
Class keyPairCreation

java.lang.Object
  |
  +--moses.security.keyPairCreation

public class keyPairCreation
extends java.lang.Object

This class allows for handling of public/private keys, other than the functionality found in certCreation and KeyGenerator classes. This functionality refers to storing public/private keys into the file system. This class has a number of static methods used for saving the keys into files. It also has a main method that is invoked as a stand-alone program in order to generate key pairs and save them into files.


Constructor Summary
keyPairCreation()
           
 
Method Summary
static void main(java.lang.String[] args)
          This method is invoked when running this class as a stand alone program.
static void putPrivateKey(java.security.PrivateKey privK, java.lang.String priKeyFile)
          This method saves the provided private key into a file.
static void putPublicKey(java.security.PublicKey pubK, java.lang.String pubKeyFile)
          This method saves the provided public key into a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

keyPairCreation

public keyPairCreation()
Method Detail

main

public static void main(java.lang.String[] args)
This method is invoked when running this class as a stand alone program. A typical usage pattern is:


        java moses.security.keyPairCreation pubKeyFile priKeyFile
        

The command line arguments are as follows: As a result of running this class, two files conatining the kei pair are created in the current directory.


putPublicKey

public static void putPublicKey(java.security.PublicKey pubK,
                                java.lang.String pubKeyFile)
This method saves the provided public key into a file.

Parameters:
pubK - represents the public key object to be saved.
pubKeyFile - represents the name of the target file.

putPrivateKey

public static void putPrivateKey(java.security.PrivateKey privK,
                                 java.lang.String priKeyFile)
This method saves the provided private key into a file.

Parameters:
privK - represents the private key object to be saved.
priKeyFile - represents the name of the target file.