Package com.sun.identity.security
Class EncodeAction
- java.lang.Object
-
- com.sun.identity.security.EncodeAction
-
- All Implemented Interfaces:
PrivilegedAction<String>
public class EncodeAction extends Object implements PrivilegedAction<String>
The class is used to perform privileged operation withAccessController.doPrivileged()when usingcom.iplanet.services.util.Cryptto encode passwords. Ths class implements the interfacePrivilegedActionwith a non-default constructor. This class should be used in order to perform the privileged operation ofcom.iplanet.services.util.Crypt.encode/encrypt(str).This line of code: String encStr = com.iplanet.services.util.Crypt.encode(str) should be replaced with: String encStr = (String) AccessController.doPrivileged( new EncodeAction(str)); If this is not done and Java security permissions check is enabled, then the operation will fail and return a null every time. Note: Java security permissions check for OpenAM can be enabled by setting the property
com.sun.identity.security.checkcallerto true in AMConfig properties file.
-
-
Field Summary
Fields Modifier and Type Field Description protected AMEncryptionencrprotected booleanuseSpecifiedKeyprotected Stringvalue
-
Constructor Summary
Constructors Constructor Description EncodeAction(String svalue)Non default constructor to be used when adoPrivileged()is performed for the encryption operations.EncodeAction(String svalue, AMEncryption encrKey)Non default constructor to be used when adoPrivileged()is performed.
-
-
-
Field Detail
-
value
protected String value
-
useSpecifiedKey
protected boolean useSpecifiedKey
-
encr
protected AMEncryption encr
-
-
Constructor Detail
-
EncodeAction
public EncodeAction(String svalue)
Non default constructor to be used when adoPrivileged()is performed for the encryption operations.- Parameters:
svalue- Value of string to be encoded/decoded
-
EncodeAction
public EncodeAction(String svalue, AMEncryption encrKey)
Non default constructor to be used when adoPrivileged()is performed.- Parameters:
svalue- Value to be encodedencrKey-AMEncryptionObject to be used
-
-
Method Detail
-
run
public String run()
- Specified by:
runin interfacePrivilegedAction<String>
-
-