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 JSF needs.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final int | |
| private IvParameterSpec | |
| private static final String | |
| private static final int | |
| private static final Logger | |
| private SecretKey | |
| private Charset |
| Access | Constructor and Description |
|---|---|
| public |
| CIPHER_CODE | back to summary |
|---|---|
| private static final String CIPHER_CODE | |
| IV_LENGTH | back to summary |
|---|---|
| private static final int IV_LENGTH | |
| ivspec | back to summary |
|---|---|
| private IvParameterSpec ivspec | |
| 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() | |
| 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() | |