public abstract class AbstractJCEEncryptionStrategy extends AbstractNamedEncryptionStrategy
| Modifier and Type | Field and Description |
|---|---|
protected String |
algorithm |
protected boolean |
base64Encoding |
protected Cipher |
decryptCipher |
protected Cipher |
encryptCipher |
protected KeySpec |
keySpec |
protected org.apache.commons.logging.Log |
logger
logger used by this class
|
protected SecretKey |
secretKey |
PHASE_NAME| Constructor and Description |
|---|
AbstractJCEEncryptionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract AlgorithmParameterSpec |
createAlgorithmParameterSpec() |
protected void |
createAndInitCiphers() |
protected abstract KeySpec |
createKeySpec() |
byte[] |
decrypt(byte[] data,
Object info) |
InputStream |
decrypt(InputStream data,
Object info) |
byte[] |
encrypt(byte[] data,
Object info) |
InputStream |
encrypt(InputStream data,
Object info) |
String |
getAlgorithm() |
protected abstract SecretKey |
getSecretKey() |
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isBase64Encoding() |
void |
setAlgorithm(String algorithm) |
void |
setBase64Encoding(boolean base64Encoding) |
String |
toString() |
getName, setNameprotected transient org.apache.commons.logging.Log logger
protected KeySpec keySpec
protected SecretKey secretKey
protected Cipher encryptCipher
protected Cipher decryptCipher
protected String algorithm
protected boolean base64Encoding
public void initialise()
throws InitialisationException
InitialisableInitialisationException 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.InitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered fromprotected void createAndInitCiphers()
throws GeneralSecurityException
GeneralSecurityExceptionprotected abstract SecretKey getSecretKey() throws GeneralSecurityException
GeneralSecurityExceptionpublic InputStream encrypt(InputStream data, Object info) throws CryptoFailureException
CryptoFailureExceptionpublic InputStream decrypt(InputStream data, Object info) throws CryptoFailureException
CryptoFailureExceptionpublic byte[] encrypt(byte[] data,
Object info)
throws CryptoFailureException
encrypt in interface EncryptionStrategyencrypt in class AbstractNamedEncryptionStrategyCryptoFailureExceptionpublic byte[] decrypt(byte[] data,
Object info)
throws CryptoFailureException
decrypt in interface EncryptionStrategydecrypt in class AbstractNamedEncryptionStrategyCryptoFailureExceptionpublic String getAlgorithm()
public void setAlgorithm(String algorithm)
public boolean isBase64Encoding()
public void setBase64Encoding(boolean base64Encoding)
protected abstract KeySpec createKeySpec()
protected abstract AlgorithmParameterSpec createAlgorithmParameterSpec()
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.