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.slf4j.Logger |
logger
logger used by this class
|
protected SecretKey |
secretKey |
| 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)
Decrypts the given
data using this encryption strategy |
InputStream |
decrypt(InputStream data,
Object info)
Decrypts the given
data using this encryption strategy |
byte[] |
encrypt(byte[] data,
Object info)
Encrypts the given
data using this encryption strategy |
InputStream |
encrypt(InputStream data,
Object info)
Encrypts the given
data using this encryption strategy |
String |
getAlgorithm() |
protected abstract SecretKey |
getSecretKey() |
void |
initialise() |
boolean |
isBase64Encoding() |
void |
setAlgorithm(String algorithm) |
void |
setBase64Encoding(boolean base64Encoding) |
String |
toString() |
getName, setNameprotected transient org.slf4j.Logger logger
protected KeySpec keySpec
protected SecretKey secretKey
protected Cipher encryptCipher
protected Cipher decryptCipher
protected String algorithm
protected boolean base64Encoding
public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
org.mule.runtime.api.lifecycle.InitialisationExceptionprotected void createAndInitCiphers()
throws GeneralSecurityException
GeneralSecurityExceptionprotected abstract SecretKey getSecretKey() throws GeneralSecurityException
GeneralSecurityExceptionpublic InputStream encrypt(InputStream data, Object info) throws CryptoFailureException
EncryptionStrategydata using this encryption strategydata - an InputStream providing the data to encryptinfo - information relevant with the encryption method being usedInputStream with the data encryptedCryptoFailureException - if an error occurs while encryptingpublic InputStream decrypt(InputStream data, Object info) throws CryptoFailureException
EncryptionStrategydata using this encryption strategydata - an InputStream providing the data to decryptinfo - information relevant with the encryption method usedInputStream with the data decryptedCryptoFailureException - if an error occurs while decryptingpublic byte[] encrypt(byte[] data,
Object info)
throws CryptoFailureException
EncryptionStrategydata using this encryption strategyencrypt in interface EncryptionStrategyencrypt in class AbstractNamedEncryptionStrategydata - the data to encryptinfo - information relevant with the encryption method being useddataCryptoFailureException - if an error occurs while encryptingpublic byte[] decrypt(byte[] data,
Object info)
throws CryptoFailureException
EncryptionStrategydata using this encryption strategydecrypt in interface EncryptionStrategydecrypt in class AbstractNamedEncryptionStrategydata - the data to decryptinfo - information relevant with the encryption method useddataCryptoFailureException - if an error occurs while decryptingpublic 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–2017 MuleSoft, Inc.. All rights reserved.