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.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final int | |
| private static final Logger | |
| private SecretKey | |
| private Charset |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static byte[] | Returns: a byte array of array1||array2first byte array to be concatenated array1, byte[] second byte array to be concatenated array2)This method concatenates two byte arrays |
| public String | |
| public String | |
| private void |
| CIPHER_CODE | back to summary |
|---|---|
| private static final String CIPHER_CODE | |
| KEY_ALGORITHM | back to summary |
|---|---|
| private static final String KEY_ALGORITHM | |
| KEY_LENGTH | back to summary |
|---|---|
| private static final int KEY_LENGTH | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| sk | back to summary |
|---|---|
| private SecretKey sk | |
| utf8 | back to summary |
|---|---|
| private Charset utf8 | |
| ByteArrayGuardAESCTR | back to summary |
|---|---|
| public ByteArrayGuardAESCTR() | |
| concatBytes | back to summary |
|---|---|
| private static byte[] concatBytes(byte[] array1, byte[] array2) This method concatenates two byte arrays
| |
| decrypt | back to summary |
|---|---|
| public String decrypt(String value) throws InvalidKeyException | |
| encrypt | back to summary |
|---|---|
| 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 | | |
| setupKeyAndCharset | back to summary |
|---|---|
| private void setupKeyAndCharset() | |