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 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, setName
protected transient 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
Initialisable
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.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
GeneralSecurityException
protected abstract SecretKey getSecretKey() throws GeneralSecurityException
GeneralSecurityException
public InputStream encrypt(InputStream data, Object info) throws CryptoFailureException
CryptoFailureException
public InputStream decrypt(InputStream data, Object info) throws CryptoFailureException
CryptoFailureException
public byte[] encrypt(byte[] data, Object info) throws CryptoFailureException
encrypt
in interface EncryptionStrategy
encrypt
in class AbstractNamedEncryptionStrategy
CryptoFailureException
public byte[] decrypt(byte[] data, Object info) throws CryptoFailureException
decrypt
in interface EncryptionStrategy
decrypt
in class AbstractNamedEncryptionStrategy
CryptoFailureException
public 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–2016 MuleSoft, Inc.. All rights reserved.