Package com.sun.identity.security
Class EncryptAction
java.lang.Object
com.sun.identity.security.EncryptAction
- All Implemented Interfaces:
PrivilegedAction
The class is used to perform privileged operation with
AccessController.doPrivileged()
when using
com.iplanet.am.util.AMPasswordUtil
to encrypt passwords. Ths
class implements the interface
PrivilegedAction
with a
non-default constructor. This class should be used in order to perform the
privileged operation of
com.iplanet.am.util.AMPasswordUtil.encrypt()
.
This line of code: String encStr =
com.iplanet.am.util.AMPasswordUtil.encrypt(str); should be replaced with:
String encStr = (String) AccessController.doPrivileged( new
EncryptAction(str)); If this is not done and Java security permissions check
is enabled, then the operation will fail and return a null everytime.
Note: Java security permissions check for OpenAM can be enabled by
setting the property com.sun.identity.security.checkcaller
to
true in AMConfig properties file.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEncryptAction
(String svalue) Non default constructor to be used when adoPrivileged()
is performed for encryption operations. -
Method Summary
-
Field Details
-
value
-
-
Constructor Details
-
EncryptAction
Non default constructor to be used when adoPrivileged()
is performed for encryption operations.- Parameters:
svalue
- Value of string to be encoded/decoded
-
-
Method Details
-
run
- Specified by:
run
in interfacePrivilegedAction
-