Class UtilsAESCipher


  • public final class UtilsAESCipher
    extends java.lang.Object

    Class to decode and encode password using AES algorithm.

    Project:

    Platform for detection and validation of certificates recognized in European TSL.

    Version:
    1.1, 15/06/2021.
    • Method Detail

      • getInstance

        public static UtilsAESCipher getInstance()
        Method that obtains an instance of the class.
        Returns:
        an instance of the class.
      • forceReloadInstance

        public static UtilsAESCipher forceReloadInstance()
        Method that forces to reload the instance of the class.
        Returns:
        the reloaded instance of the class.
      • testCipher

        public static boolean testCipher​(java.lang.String newAES)
        Method that checks a new key.
        Parameters:
        newAES - The new key.
        Returns:
        true if the key is valid, otherwise false.
      • encryptMessage

        public byte[] encryptMessage​(java.lang.String msg)
                              throws CipherException
        Method that encrypts a message.
        Parameters:
        msg - The message to encrypt.
        Returns:
        the message encrypted.
        Throws:
        CipherException - If the method fails.
      • decryptMessage

        public byte[] decryptMessage​(java.lang.String msg)
                              throws CipherException
        Method that decrypts a message.
        Parameters:
        msg - The message to decrypt in base 64.
        Returns:
        the message decrypted.
        Throws:
        CipherException - If the method fails.