Package com.sun.faces.util
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
toResponseStateManager
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 Summary
Constructors Constructor Description ByteArrayGuardAESCTR()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
decrypt(String value)
String
encrypt(String value)
This method: Encrypts bytes using a cipher.
-
-
-
Method Detail
-
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
-
-