Package com.microstrategy.utils.crypto
Class CryptoHTML
- java.lang.Object
-
- com.microstrategy.utils.crypto.CryptoHTML
-
public class CryptoHTML extends java.lang.Object
Encryption of strings. The encrypted string is HTML safe, i.e. may be used in the URL. Class is thread safe.- Since:
- MicroStrategy Web 9.0.0
-
-
Constructor Summary
Constructors Constructor Description CryptoHTML()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
decrypt(byte[] key, java.lang.String encryptedText)
Decrypts aCryptoHTML
encrypted string.static java.lang.String
decrypt(java.lang.String encryptedData)
Decrypt the valuejava.lang.String
encrypt(byte[] key, java.lang.String plainText)
Encrypts a string.static java.lang.String
encrypt(java.lang.String clearData)
Encrypts a string.static void
init()
Initiate EncryptedObject with supported encryption algorithm.
-
-
-
Method Detail
-
init
public static void init()
Initiate EncryptedObject with supported encryption algorithm. At the same time generate and save the AES key.
-
encrypt
public java.lang.String encrypt(byte[] key, java.lang.String plainText)
Encrypts a string. String must be non-null otherwise aNullPointerException
will be thrown.- Parameters:
key
- encryption key (8-bytes)plainText
- string- Returns:
- encrypted string
- See Also:
decrypt(byte[], String)
-
decrypt
public java.lang.String decrypt(byte[] key, java.lang.String encryptedText)
Decrypts aCryptoHTML
encrypted string.- Parameters:
key
- encryption key - this should be the same key that was used to encrypt the dataencryptedText
- encrypted string- Returns:
- original string
- See Also:
encrypt(byte[], String)
-
encrypt
public static final java.lang.String encrypt(java.lang.String clearData)
Encrypts a string.- Parameters:
clearData
- string to be encrypted- Returns:
- encrypted string
-
decrypt
public static java.lang.String decrypt(java.lang.String encryptedData)
Decrypt the value- Parameters:
encryptedData
- data to be decrypted- Returns:
- decrypted string
-
-