Class 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 a CryptoHTML encrypted string.
      static java.lang.String decrypt​(java.lang.String encryptedData)
      Decrypt the value
      java.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CryptoHTML

        public CryptoHTML()
    • 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 a NullPointerException 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 a CryptoHTML encrypted string.
        Parameters:
        key - encryption key - this should be the same key that was used to encrypt the data
        encryptedText - 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