org.mule.security
Class PasswordBasedEncryptionStrategy
java.lang.Object
org.mule.security.AbstractNamedEncryptionStrategy
org.mule.security.AbstractJCEEncryptionStrategy
org.mule.security.PasswordBasedEncryptionStrategy
- All Implemented Interfaces:
- EncryptionStrategy, Initialisable
public class PasswordBasedEncryptionStrategy
- extends AbstractJCEEncryptionStrategy
Provides password-based encryption using JCE. Users must specify a password and
optionally a salt and iteration count as well. The default algorithm is
PBEWithMD5AndDES, but users can specify any valid algorithm supported by JCE.
DEFAULT_ALGORITHM
public static final String DEFAULT_ALGORITHM
- See Also:
- Constant Field Values
DEFAULT_ITERATION_COUNT
public static final int DEFAULT_ITERATION_COUNT
- See Also:
- Constant Field Values
PasswordBasedEncryptionStrategy
public PasswordBasedEncryptionStrategy()
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
- Overrides:
initialise
in class AbstractJCEEncryptionStrategy
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
createKeySpec
protected KeySpec createKeySpec()
- Specified by:
createKeySpec
in class AbstractJCEEncryptionStrategy
createAlgorithmParameterSpec
protected AlgorithmParameterSpec createAlgorithmParameterSpec()
- Specified by:
createAlgorithmParameterSpec
in class AbstractJCEEncryptionStrategy
getSalt
public byte[] getSalt()
setSalt
public void setSalt(byte[] salt)
getIterationCount
public int getIterationCount()
setIterationCount
public void setIterationCount(int iterationCount)
setPassword
public void setPassword(String password)
getSecretKey
protected SecretKey getSecretKey()
throws GeneralSecurityException
- Specified by:
getSecretKey
in class AbstractJCEEncryptionStrategy
- Throws:
GeneralSecurityException
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.