Class AesCipher

    • Constructor Detail

      • AesCipher

        public AesCipher​(Topping topping)
    • Method Detail

      • init

        public void init​(java.security.Key key)
        Description copied from interface: FloodgateCipher
        Initializes the instance by giving it the key it needs to encrypt or decrypt data
        Specified by:
        init in interface FloodgateCipher
        Parameters:
        key - the key used to encrypt and decrypt data
      • encrypt

        public byte[] encrypt​(byte[] data)
                       throws java.lang.Exception
        Description copied from interface: FloodgateCipher
        Encrypts the given data using the Key provided in FloodgateCipher.init(Key)
        Specified by:
        encrypt in interface FloodgateCipher
        Parameters:
        data - the data to encrypt
        Returns:
        the encrypted data
        Throws:
        java.lang.Exception - when the encryption failed
      • decrypt

        public byte[] decrypt​(byte[] cipherTextWithIv)
                       throws java.lang.Exception
        Description copied from interface: FloodgateCipher
        Decrypts the given data using the Key provided in FloodgateCipher.init(Key)
        Specified by:
        decrypt in interface FloodgateCipher
        Parameters:
        cipherTextWithIv - the data to decrypt
        Returns:
        the decrypted data
        Throws:
        java.lang.Exception - when the decrypting failed