Class ByteArrayGuardAESCTR

java.lang.Object
com.sun.faces.util.ByteArrayGuardAESCTR

public final class ByteArrayGuardAESCTR extends Object

This utility class is to provide both encryption and decryption Ciphers to ResponseStateManager implementations wishing to provide encryption support.

The algorithm used to encrypt byte array is AES with CBC.

Original author Inderjeet Singh, J2EE Blue Prints Team. Modified to suit Faces needs.

  • Constructor Details

    • ByteArrayGuardAESCTR

      public ByteArrayGuardAESCTR()
  • Method Details

    • encrypt

      public String encrypt(String value)
      This method: Encrypts bytes using a cipher. Generates MAC for intialization vector of the cipher Generates MAC for encrypted data Returns a byte array consisting of the following concatenated together: |MAC for cnrypted Data | MAC for Init Vector | Encrypted Data |
      Parameters:
      value - The value to be encrypted.
      Returns:
      the encrypted value.
    • decrypt

      public String decrypt(String value) throws InvalidKeyException
      Throws:
      InvalidKeyException