Class AesEncryptor

    • Constructor Detail

      • AesEncryptor

        public AesEncryptor()
        Default constructor
      • AesEncryptor

        public AesEncryptor​(String key)
        Custom key constructor
        Parameters:
        key - the custom key
    • Method Detail

      • encrypt

        public String encrypt​(String value)
        Description copied from interface: Encryptor
        Encrypt a clear text String.
        Specified by:
        encrypt in interface Encryptor
        Parameters:
        value - The clear text attribute
        Returns:
        The encrypted attribute, or null
      • encrypt

        public String encrypt​(String value,
                              byte[] iv)
        Description copied from interface: Encryptor
        Encrypt a clear text String.
        Specified by:
        encrypt in interface Encryptor
        Parameters:
        value - The clear text attribute
        iv - The IV to use, or null for the default IV
        Returns:
        The encrypted attribute, or null
      • decrypt

        public String decrypt​(String value)
        Description copied from interface: Encryptor
        Decrypt an encrypted String.
        Specified by:
        decrypt in interface Encryptor
        Parameters:
        value - The encrypted attribute in Base64 encoding
        Returns:
        The clear text attribute, or null
      • decrypt

        public String decrypt​(String value,
                              byte[] iv)
        Description copied from interface: Encryptor
        Decrypt an encrypted String.
        Specified by:
        decrypt in interface Encryptor
        Parameters:
        value - The encrypted attribute in Base64 encoding
        iv - The IV to use, or null for the default IV
        Returns:
        The clear text attribute, or null
      • setKey

        public void setKey​(String key)
        Description copied from interface: Encryptor
        Set the encryption key. This will apply the user-defined key, truncated or filled (via the default key) as needed to meet the key length specifications.
        Specified by:
        setKey in interface Encryptor
        Parameters:
        key - The encryption key