Class ShiroAesDataEncrypter

  • All Implemented Interfaces:
    DataEncrypter

    public class ShiroAesDataEncrypter
    extends Object
    implements DataEncrypter
    A DataEncrypter based on the Shiro library and AES encryption.
    Since:
    6.1.0
    Author:
    Jerome Leleu
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Constructor Detail

      • ShiroAesDataEncrypter

        public ShiroAesDataEncrypter​(byte[] key)
      • ShiroAesDataEncrypter

        public ShiroAesDataEncrypter()
    • Method Detail

      • decrypt

        public byte[] decrypt​(byte[] encryptedBytes)
        Description copied from interface: DataEncrypter
        Decrypt the data.
        Specified by:
        decrypt in interface DataEncrypter
        Parameters:
        encryptedBytes - the encrypted bytes
        Returns:
        decrypted bytes
      • encrypt

        public byte[] encrypt​(byte[] rawBytes)
        Description copied from interface: DataEncrypter
        Encrypt the data.
        Specified by:
        encrypt in interface DataEncrypter
        Parameters:
        rawBytes - the raw bytes
        Returns:
        encrypted bytes