atg.projects.store.crypto
Class DESedeEncryptor

java.lang.Object
  extended by atg.projects.store.crypto.AbstractEncryptor
      extended by atg.projects.store.crypto.DESedeEncryptor
All Implemented Interfaces:
Encryptor, java.io.Serializable

public class DESedeEncryptor
extends AbstractEncryptor

A simple class for performing encryption/decryption operations using the javax.crypto package.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static atg.nucleus.logging.ApplicationLogging mLogger
          Logger.
 
Constructor Summary
DESedeEncryptor()
          Default constructor.
 
Method Summary
protected  void acceptKey(byte[] pValue)
          Initialize the KeySpec.
protected  void addSecurityProviders()
          This method add's new security provider at the top of the list of exsisting providers.
protected  byte[] decodeToByteArray(java.lang.String pValue)
          Decode pValue into array of bytes.
protected  void doAcceptDecryptKey(byte[] pValue)
          This is two way encryption, so encrypt/decrypt keys are the same.
protected  void doAcceptEncryptKey(byte[] pValue)
          This is two way encryption, so encrypt/decrypt keys are the same.
protected  byte[] doDecrypt(byte[] pValue)
          Implement this with the actual decryption operation.
protected  byte[] doEncrypt(byte[] pValue)
          Implement this with the actual encryption operation.
protected  void doInit()
          Initialize DESedeEncryptor.
protected  java.lang.String encodeToString(byte[] pValue)
          Once encrypted, string data may no longer be a string because the encrypted data is binary and may contain null characters, thus it may need to be encoded using a encoder such as Base64, UUEncode (ASCII only) or UCEncode(ASCII independent).
 java.util.List getSecurityProviders()
           
 void setSecurityProviders(java.util.List pSecurityProviders)
          Set the list of Providers from the property.
 
Methods inherited from class atg.projects.store.crypto.AbstractEncryptor
acceptDecryptKey, acceptEncryptKey, decrypt, decrypt, encrypt, encrypt, init, postDecrypt, postDecrypt, postEncrypt, postEncrypt, preDecrypt, preDecrypt, preEncrypt, preEncrypt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mLogger

public static atg.nucleus.logging.ApplicationLogging mLogger
Logger.

Constructor Detail

DESedeEncryptor

public DESedeEncryptor()
Default constructor.

Method Detail

getSecurityProviders

public java.util.List getSecurityProviders()
Returns:
list of security providers.

setSecurityProviders

public void setSecurityProviders(java.util.List pSecurityProviders)
Set the list of Providers from the property.

Parameters:
pSecurityProviders - - security providers list

doAcceptEncryptKey

protected final void doAcceptEncryptKey(byte[] pValue)
                                 throws EncryptorException
This is two way encryption, so encrypt/decrypt keys are the same.

Specified by:
doAcceptEncryptKey in class AbstractEncryptor
Parameters:
pValue - - value
Throws:
EncryptorException - if encryptor error occurs

doAcceptDecryptKey

protected final void doAcceptDecryptKey(byte[] pValue)
                                 throws EncryptorException
This is two way encryption, so encrypt/decrypt keys are the same.

Specified by:
doAcceptDecryptKey in class AbstractEncryptor
Parameters:
pValue - - value
Throws:
EncryptorException - if encryptor error occurs

acceptKey

protected final void acceptKey(byte[] pValue)
                        throws EncryptorException
Initialize the KeySpec.

Parameters:
pValue - key in byte[]
Throws:
EncryptorException - This exception indicates that a severe error occurred while performing a cryptography operation.

doInit

protected final void doInit()
                     throws EncryptorException
Initialize DESedeEncryptor.

Specified by:
doInit in class AbstractEncryptor
Throws:
EncryptorException - This exception indicates that a severe error occurred while performing a cryptography operation.

doEncrypt

protected final byte[] doEncrypt(byte[] pValue)
                          throws EncryptorException
Implement this with the actual encryption operation.

Specified by:
doEncrypt in class AbstractEncryptor
Parameters:
pValue - array of bytes
Returns:
encrypted array of bytes
Throws:
EncryptorException - This exception indicates that a severe error occured while performing a cryptograpy operation.

doDecrypt

protected final byte[] doDecrypt(byte[] pValue)
                          throws EncryptorException
Implement this with the actual decryption operation.

Specified by:
doDecrypt in class AbstractEncryptor
Parameters:
pValue - array of bytes
Returns:
decrypted array of bytes
Throws:
EncryptorException - This exception indicates that a severe error occured while performing a cryptograpy operation.

encodeToString

protected java.lang.String encodeToString(byte[] pValue)
                                   throws EncryptorException
Once encrypted, string data may no longer be a string because the encrypted data is binary and may contain null characters, thus it may need to be encoded using a encoder such as Base64, UUEncode (ASCII only) or UCEncode(ASCII independent).

Overrides:
encodeToString in class AbstractEncryptor
Parameters:
pValue - - value
Returns:
encoded data
Throws:
EncryptorException - This exception indicates that an error occurred while performing a cryptography operation.

decodeToByteArray

protected byte[] decodeToByteArray(java.lang.String pValue)
                            throws EncryptorException
Decode pValue into array of bytes.

Overrides:
decodeToByteArray in class AbstractEncryptor
Parameters:
pValue - decoded string
Returns:
decoded array of bytes
Throws:
EncryptorException - This exception indicates that a severe error occurred while performing a cryptography operation.

addSecurityProviders

protected void addSecurityProviders()
This method add's new security provider at the top of the list of exsisting providers.