fccsc.manager.crypto
Class MessageCryptography

java.lang.Object
  |
  +--fccsc.manager.crypto.MessageCryptography

public class MessageCryptography
extends java.lang.Object


Constructor Summary
MessageCryptography()
           
 
Method Summary
static CryptoData decrypt(byte[] p_data)
          Decrypts a message using the private key and pass phrase.
static byte[] decryptWithSessionKey(byte[] p_data, byte[] p_sessionKey)
          Decrypts a message using a session key.
static CryptoData encrypt(java.lang.String p_data)
          Encrypts a message using a certificate.
static byte[] encryptWithSessionKey(byte[] p_data, byte[] p_sessionKey)
          Encrypts a message using a session key.
static void init(java.util.Properties p_property)
          Initializes configuration information.
static void init(java.lang.String p_pathCertificate, java.lang.String p_pathPrivateKey, java.lang.String p_pathPassPhrase)
          Initializes configuration information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageCryptography

public MessageCryptography()
Method Detail

init

public static void init(java.util.Properties p_property)
Initializes configuration information. Property file must contain the following configuration data: crypto.path.certificate = cryptography/certificate.crt ...... (relative example) crypto.path.privatekey = d:/cryptography/privatekey.pem .... (absolute example) crypto.path.passphrase = d:/cryptography/passphrase.pph .... (absolute example) Each property path can use a relative or an absolute file path.

Parameters:
p_property - a properties object.

init

public static void init(java.lang.String p_pathCertificate,
                        java.lang.String p_pathPrivateKey,
                        java.lang.String p_pathPassPhrase)
Initializes configuration information.

Parameters:
p_pathCertificate - a file path to the certifcate.
p_pathPrivateKey - a file path to the private key.
p_pathPassPhrase - a file path to the encrypted pass phrase.

encrypt

public static CryptoData encrypt(java.lang.String p_data)
Encrypts a message using a certificate. From this (CB + DB) -> (CB + ESK + EDB + SK).

Parameters:
p_data - the data to encrypt.
Returns:
a CryptoData object.

encryptWithSessionKey

public static byte[] encryptWithSessionKey(byte[] p_data,
                                           byte[] p_sessionKey)
Encrypts a message using a session key. From this (CB + DB) -> (CB + ESK + EDB).

Parameters:
p_data - the data to encrypt.
p_sessionKey - the session key.
Returns:
a byte [] contianing the encrypted data (CB + ESK + EDB).

decrypt

public static CryptoData decrypt(byte[] p_data)
Decrypts a message using the private key and pass phrase. From this (CB + ESK + EDB) -> (CB + DB + SK).

Parameters:
p_data - the data to decrypt.
Returns:
a CryptoData object.

decryptWithSessionKey

public static byte[] decryptWithSessionKey(byte[] p_data,
                                           byte[] p_sessionKey)
Decrypts a message using a session key. From this (CB + ESK + EDB) -> (CB + DB).

Parameters:
p_data - the data to decrypt.
Returns:
a byte [] containing the unencrypted data (CB + DB).