com.sun.identity.security
Class EncodeAction

java.lang.Object
  |
  +--com.sun.identity.security.EncodeAction
All Implemented Interfaces:
java.security.PrivilegedAction

public class EncodeAction
extends java.lang.Object
implements java.security.PrivilegedAction

The class is used to perform privileged operation with AccessController.doPrivileged() when using com.iplanet.services.util.Crypt to encode 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.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 everytime.
 
 Note: Java security permissions check for Access Manager can be enabled by
 setting the property com.sun.identity.security.checkcaller to
 true in AMConfig properties file.
 


Constructor Summary
EncodeAction(java.lang.String svalue)
          Non default constructor to be used when a doPrivileged() is performed for the encryption operations.
EncodeAction(java.lang.String svalue, com.iplanet.services.util.AMEncryption encrKey)
          Non default constructor to be used when a doPrivileged() is performed.
 
Method Summary
 java.lang.Object run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncodeAction

public EncodeAction(java.lang.String svalue)
Non default constructor to be used when a doPrivileged() is performed for the encryption operations.
Parameters:
svalue - Value of string to be encoded/decoded

EncodeAction

public EncodeAction(java.lang.String svalue,
                    com.iplanet.services.util.AMEncryption encrKey)
Non default constructor to be used when a doPrivileged() is performed.
Parameters:
svalue - Value to be encoded
encrKey - AMEncryption Object to be used
Method Detail

run

public java.lang.Object run()
Specified by:
run in interface java.security.PrivilegedAction


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.