Expresso 5-5-0

com.jcorporate.expresso.core.security
Class AbstractStringEncryption

java.lang.Object
  extended bycom.jcorporate.expresso.core.security.AbstractStringEncryption
Direct Known Subclasses:
StringEncryption, StringEncryption

public abstract class AbstractStringEncryption
extends Object

This class represents a StringEncryption Interface

Version:
$Revision: 1.11 $ $Date: 2003/06/03 06:12:15 $
Author:
Michael Rimov

Field Summary
protected  byte[] passKey
           
 
Constructor Summary
AbstractStringEncryption()
          Default Constructor
 
Method Summary
abstract  byte[] decrypt(byte[] inputData)
          Same as decryptString, but only deals in byte arrays.
 String decryptString(byte[] inputData)
          Decode a string.
 void destroy()
          Implemented by lower levels to destroy the cryptographic managers.
abstract  byte[] encrypt(byte[] inputData)
          Same as encryptString, but only deals in byte arrays.
 byte[] encryptString(String inputData)
          Encode a string.
 CryptoManager getCryptoManager()
           
 void init()
           
 void preparePassKey()
          Basic implementation puts a hash of the config manager's key into the passKey variable.
 void setCryptoManager(CryptoManager cryptoManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

passKey

protected byte[] passKey
Constructor Detail

AbstractStringEncryption

public AbstractStringEncryption()
Default Constructor

Throws:
ChainedException
Method Detail

init

public void init()
          throws ChainedException
Throws:
ChainedException

destroy

public void destroy()
Implemented by lower levels to destroy the cryptographic managers.


decrypt

public abstract byte[] decrypt(byte[] inputData)
                        throws ChainedException
Same as decryptString, but only deals in byte arrays. This method must be implemented by descendants of this class.

Parameters:
inputData - A byte aray of data to decrypt
Returns:
A byte array of decrypted data
Throws:
ChainedException - If there's an error decrypting the data

decryptString

public String decryptString(byte[] inputData)
                     throws IllegalStateException
Decode a string. Derived classes determine what strength/type of encoding is done.

Parameters:
inputData - A greater than zero length byte array. that was encoded with the encryptString() routine.
Returns:
the decrypted data in a String format.
Throws:
IllegalStateException

encrypt

public abstract byte[] encrypt(byte[] inputData)
                        throws ChainedException
Same as encryptString, but only deals in byte arrays. This must be implemented by the descendants of this class.

Parameters:
inputData - A byte array to encrypt
Returns:
An encrypted byte array.
Throws:
ChainedException

encryptString

public byte[] encryptString(String inputData)
                     throws IllegalStateException,
                            IllegalArgumentException,
                            ChainedException
Encode a string. Derived classes determine what strength/type of encoding is done.

Parameters:
inputData - a non-null string.
Returns:
a byte array that is the inputData encoded.
Throws:
IllegalStateException
IllegalArgumentException
ChainedException

preparePassKey

public void preparePassKey()
                    throws ChainedException
Basic implementation puts a hash of the config manager's key into the passKey variable.

Throws:
ChainedException

setCryptoManager

public void setCryptoManager(CryptoManager cryptoManager)

getCryptoManager

public CryptoManager getCryptoManager()

Expresso 5-5-0

Please see www.jcorporate.com for information about new Expresso releases.