public class Crypt extends Object
Crypt
provides generic methods to encryt and decrypt
data. This class provides a pluggable architecture to encrypt and decrypt
data, using the AMEncryption
interface class. A class that
implements AMEncryption
must be specified via the system
property: com.iplanet.security.encryptor
. If none is
provided, the default provided by iDSAME
com.iplanet.services.util.JCEEncryption
will be used.
Additionally, it provides a method to check if the calling class has permission to call these methods. To enable the additional security, the property com.sun.identity.security.checkcaller must be set to true.
Modifier and Type | Field and Description |
---|---|
static SecurityManager |
securityManager |
Constructor and Description |
---|
Crypt() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkCaller()
Check to see if security is enabled and Caller needs to be checked for
OpenAM specific Java security permissions
|
static String |
decode(String encoded)
Decode an encoded string
|
static String |
decode(String encoded,
AMEncryption encr)
Decode an encoded string
|
static String |
decrypt(String encoded)
Decrypt a String.
|
static String |
decryptLocal(String encoded)
Decrypt a String using client's encryption key
|
static String |
encode(String clearText)
Encode a String.
|
static String |
encode(String clearText,
AMEncryption encr)
Encode a String.
|
static String |
encrypt(String clearText)
Encrypt a String.
|
static String |
encryptLocal(String clearText)
Encrypt a String using the client's encryption key
|
static AMEncryption |
getEncryptor()
Return AMEncryption instance for deployment-specific secret key
|
static AMEncryption |
getHardcodedKeyEncryptor()
This is a temporary kludge which always returns an instance of
AMEncryption using hardcoded key It is necessary for backward
compatibility with 2.0 Java agents This method is to be ONLY used by
Session module for session id generation.
|
protected static String |
getParentClass(String callerClass) |
protected static boolean |
isCallerValid()
Check to determine if the calling class has the privilege to execute
sensitive methods which returns passwords, decrypts data, etc.
|
static boolean |
isCallerValid(Object obj)
Check to determine if the calling class has the privilege to execute
sensitive methods which returns passwords, decrypts data, etc.
|
static boolean |
isCallerValid(String className)
Check to determine if the calling class has the privilege to execute
sensitive methods which returns passwords, decrypts data, etc.
|
static void |
reinitialize() |
public static SecurityManager securityManager
public static void reinitialize()
public static boolean checkCaller()
public static AMEncryption getHardcodedKeyEncryptor()
public static AMEncryption getEncryptor()
public static String encrypt(String clearText)
Encrypt a String.
clearText
- The string to be encoded.public static String encryptLocal(String clearText)
Encrypt a String using the client's encryption key
clearText
- The string to be encoded.public static String decrypt(String encoded)
Decrypt a String.
encoded
- The string to be decoded.public static String decryptLocal(String encoded)
Decrypt a String using client's encryption key
encoded
- The string to be decoded.public static String encode(String clearText, AMEncryption encr)
Encode a String.
clearText
- The string to be encoded.encr
- instance of AMEncryption to usepublic static String encode(String clearText)
Encode a String.
clearText
- The string to be encoded.public static String decode(String encoded, AMEncryption encr)
encoded
- The encoded string.encr
- instance of AMEncryption to usepublic static String decode(String encoded)
encoded
- The encoded string.protected static boolean isCallerValid()
public static boolean isCallerValid(Object obj)
obj
- The Java object that is performing this checkpublic static boolean isCallerValid(String className)
className
- fully qualified class name of Object calling this functionCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.