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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_ALGORITHM
public static final java.lang.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 java.security.spec.KeySpec createKeySpec()
- Specified by:
createKeySpec
in class AbstractJCEEncryptionStrategy
createAlgorithmParameterSpec
protected java.security.spec.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(java.lang.String password)
getSecretKey
protected javax.crypto.SecretKey getSecretKey()
throws java.security.GeneralSecurityException
- Specified by:
getSecretKey
in class AbstractJCEEncryptionStrategy
- Throws:
java.security.GeneralSecurityException
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.