Class JCEEncryption
- java.lang.Object
-
- com.iplanet.services.util.JCEEncryption
-
- All Implemented Interfaces:
AMEncryption,ConfigurableKey
public class JCEEncryption extends Object implements AMEncryption, ConfigurableKey
This class provides encryption and decryption facility for the SDK based on the existence of a JCE provider in the runtime. Unlike
JSSEncryption, this class can only handle a fixed algorithm for key generation and encryption which isPBEWithMD5AndDES. Since different JCE providers such as IAIK use slightly different names for this algorithm, this class provides the facility to over-ride this hardcoded value by setting the system properties for each of these algorithms. The property name for specifying the key generation algorithm isamKeyGenDescriptorand that for specifying encryption algorithm isamCryptoDescriptor.NOTE: The facility of overriding key generation and encryption algorithms must be used very carefully. In particular, this facility is not meant to force the use of an algorithm different from the specified default algorithm
PBEWithMD5AndDESsince that will result in incompatibility between theJSSEncryptionif it is being used by any peer entity such as agent or server. This would not be a problem if all entities in the network were configured to use this encryption provider and all had the same implementation of the specified algorithms available.
-
-
Constructor Summary
Constructors Constructor Description JCEEncryption()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] encText)Method declarationbyte[]encrypt(byte[] clearText)Method declarationvoidsetPassword(String password)Sets password-based key to use
-
-
-
Method Detail
-
encrypt
public byte[] encrypt(byte[] clearText)
Method declaration- Specified by:
encryptin interfaceAMEncryption- Parameters:
clearText-
-
decrypt
public byte[] decrypt(byte[] encText)
Method declaration- Specified by:
decryptin interfaceAMEncryption- Parameters:
encText-
-
setPassword
public void setPassword(String password) throws Exception
Sets password-based key to use- Specified by:
setPasswordin interfaceConfigurableKey- Throws:
Exception
-
-