Package com.sun.identity.security
Class DecodeAction
- java.lang.Object
-
- com.sun.identity.security.DecodeAction
-
- All Implemented Interfaces:
PrivilegedAction<String>
@SupportedAll public class DecodeAction extends Object implements PrivilegedAction<String>
The class is used to perform privileged operations withAccessController.doPrivileged()
when usingcom.iplanet.services.util.Crypt
to decode passwords. Ths class implements the interfacePrivilegedAction
with a non-default constructor. This class should be used in order to perform the privileged operation ofcom.iplanet.services.util.Crypt.decode/decrypt()
.This line of code: String decStr = com.iplanet.services.util.Crypt.decode(str) should be replaced with: String decStr = (String) AccessController.doPrivileged( new DecodeAction(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.checkcaller
to true in AMConfig properties file.
-
-
Constructor Summary
Constructors Constructor Description DecodeAction(String svalue)
Non default constructor to be used when adoPrivileged()
is performed for the decryption operations.DecodeAction(String value, com.iplanet.services.util.AMEncryption encrKey)
-
-
-
Field Detail
-
value
protected String value
-
encr
protected com.iplanet.services.util.AMEncryption encr
-
-
Constructor Detail
-
DecodeAction
public DecodeAction(String svalue)
Non default constructor to be used when adoPrivileged()
is performed for the decryption operations.- Parameters:
svalue
- Value of string to be encoded/decoded
-
DecodeAction
public DecodeAction(String value, com.iplanet.services.util.AMEncryption encrKey)
- Parameters:
value
- Value to be decodedencrKey
- Encryption object to be used for decoding
-
-
Method Detail
-
run
public String run()
- Specified by:
run
in interfacePrivilegedAction<String>
-
-