moses.security
Class certCreation

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

public class certCreation
extends java.lang.Object

This class allows for additional handling of certificates and public/private keys. This functionality refers to storing and retrieving of certificates and public/private keys from the file system. This class has a number of static methods in order to save and to retrieve these objects from files. It also also has a main method that is invoked as a stand-alone program in order to create certificate files.


Constructor Summary
certCreation()
           
 
Method Summary
static moses.security.LGICert getCert(java.lang.String certFile)
          This method reads a previously saved certificate from its file.
static java.security.PrivateKey getPrivateKey(java.lang.String priKeyFile)
          This method reads a previously saved private key from its file.
static java.security.PublicKey getPublicKey(java.lang.String pubKeyFile)
          This method reads a previously saved public key from its file.
static void main(java.lang.String[] args)
          This method is invoked when running this class as a stand alone program.
static void putCert(moses.security.LGICert cert, java.lang.String certFile)
          This method saves the provided certificate into a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

certCreation

public certCreation()
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.certCreation CApubkf CAprivkf SUBpubkf CERTf ATTRIBUTES
        

The command line arguments are as follows: As a result of running this class, a certificate file is created in the current directory.


putCert

public static void putCert(moses.security.LGICert cert,
                           java.lang.String certFile)
This method saves the provided certificate into a file.

Parameters:
cert - represents the certificate to be saved.
certFile - represents the target file name to save the certificate.

getCert

public static moses.security.LGICert getCert(java.lang.String certFile)
This method reads a previously saved certificate from its file.

Parameters:
certFile - represents the name of the file that contains a certificate.
Returns:
returns the LGI certificate from the file, or null if any exception occurs.

getPublicKey

public static java.security.PublicKey getPublicKey(java.lang.String pubKeyFile)
This method reads a previously saved public key from its file.

Parameters:
pubKeyFile - represents the name of the file that contains the public key.
Returns:
returns the public key from the file.

getPrivateKey

public static java.security.PrivateKey getPrivateKey(java.lang.String priKeyFile)
This method reads a previously saved private key from its file.

Parameters:
priKeyFile - represents the name of the file that contains the private key.
Returns:
returns the private key from the file.