public class SecretKeyEncryptionStrategy extends AbstractJCEEncryptionStrategy
SecretKeyFactory and must return a
byte array. The default algorthm used by this strategy is Blowfish, but users can
specify any valid algorithm supported by JCE.SecretKeyFactory| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ALGORITHM |
algorithm, base64Encoding, decryptCipher, encryptCipher, keySpec, logger, secretKeyPHASE_NAME| Constructor and Description |
|---|
SecretKeyEncryptionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected AlgorithmParameterSpec |
createAlgorithmParameterSpec() |
protected KeySpec |
createKeySpec() |
SecretKeyFactory |
getKeyFactory() |
protected SecretKey |
getSecretKey() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
setKey(byte[] rawKey) |
void |
setKey(String rawKey) |
void |
setKeyFactory(SecretKeyFactory keyFactory) |
decrypt, encrypt, getAlgorithm, isBase64Encoding, setAlgorithm, setBase64Encoding, toStringgetName, setNamepublic static final String DEFAULT_ALGORITHM
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.initialise in interface Initialisableinitialise in class AbstractJCEEncryptionStrategyInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered fromprotected KeySpec createKeySpec()
createKeySpec in class AbstractJCEEncryptionStrategyprotected AlgorithmParameterSpec createAlgorithmParameterSpec()
createAlgorithmParameterSpec in class AbstractJCEEncryptionStrategypublic void setKey(byte[] rawKey)
public void setKey(String rawKey)
public SecretKeyFactory getKeyFactory()
public void setKeyFactory(SecretKeyFactory keyFactory)
protected SecretKey getSecretKey() throws GeneralSecurityException
getSecretKey in class AbstractJCEEncryptionStrategyGeneralSecurityExceptionCopyright © 2003-2012 MuleSource, Inc.. All Rights Reserved.