org.mule.impl.security
Class AbstractJCEEncryptionStrategy
java.lang.Object
org.mule.impl.security.AbstractJCEEncryptionStrategy
- All Implemented Interfaces:
- Initialisable, UMOEncryptionStrategy
- Direct Known Subclasses:
- PasswordBasedEncryptionStrategy, SecretKeyEncryptionStrategy
- public abstract class AbstractJCEEncryptionStrategy
- extends Object
- implements UMOEncryptionStrategy
A JCE based encryption strategy. It also provides base64 encoding of
encrypted/decrypted data by setting the base64encoding attribute
- Version:
- $Revision: 3798 $
- Author:
- Ross Mason
logger
protected transient Log logger
- logger used by this class
keySpec
protected KeySpec keySpec
secretKey
protected SecretKey secretKey
encryptCipher
protected Cipher encryptCipher
decryptCipher
protected Cipher decryptCipher
algorithm
protected String algorithm
base64Encoding
protected boolean base64Encoding
AbstractJCEEncryptionStrategy
public AbstractJCEEncryptionStrategy()
initialise
public void initialise()
throws InitialisationException
- Description copied from interface:
Initialisable
- Method used to perform any initialisation work. If a fatal error occurs during
initialisation an
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.
- Specified by:
initialise
in interface Initialisable
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule
instance to shutdown
getSecretKey
protected abstract SecretKey getSecretKey()
throws GeneralSecurityException
- Throws:
GeneralSecurityException
encrypt
public byte[] encrypt(byte[] data,
Object info)
throws CryptoFailureException
- Specified by:
encrypt
in interface UMOEncryptionStrategy
- Throws:
CryptoFailureException
decrypt
public byte[] decrypt(byte[] data,
Object info)
throws CryptoFailureException
- Specified by:
decrypt
in interface UMOEncryptionStrategy
- Throws:
CryptoFailureException
getAlgorithm
public String getAlgorithm()
setAlgorithm
public void setAlgorithm(String algorithm)
toString
public String toString()
isBase64Encoding
public boolean isBase64Encoding()
setBase64Encoding
public void setBase64Encoding(boolean base64Encoding)
createKeySpec
protected abstract KeySpec createKeySpec()
createAlgorithmParameterSpec
protected abstract AlgorithmParameterSpec createAlgorithmParameterSpec()
Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.