Inherited by ERXAESCrypter.

Classes | |
| class | ThreadLocalCipher |
Public Member Functions | |
| int | blockSize () |
| String | decrypt (String cryptedText) |
| String | encrypt (String clearText) |
| ERXAbstractAESCrypter () | |
| void | setBlockSize (int blockSize) |
Static Public Attributes | |
| static final Logger | log = Logger.getLogger(ERXCrypto.class) |
Protected Member Functions | |
| Cipher | createCipher (int mode) |
| Cipher | decryptCipher () |
| Cipher | encryptCipher () |
| abstract Key | secretKey () throws Exception |
Private Member Functions | |
| Key | _secretKey () |
Private Attributes | |
| int | _blockSize |
| ThreadLocalCipher | _decryptCipher |
| ThreadLocalCipher | _encryptCipher |
| Key | _secretKey |
| Key _secretKey | ( | ) | [private] |
| int blockSize | ( | ) |
Returns the block size for this cipher.
| Cipher createCipher | ( | int | mode | ) | [protected] |
Creates an AES cipher for a given mode. The two possible modes for a cipher are: ENCRYPT and DECRYPT.
| mode | of the cipher (encrypting or decrypting) |
secretKey from the above method.
Decodes an AES encoded string. Note that the originally encoded string should have been encoded with the same secret key as is used for the decoding cipher or else you are going to get garbage. To encode a string have a look at encrypt.
| cryptedText | AES encoded string to be decoded |
Implements ERXCrypterInterface.
| Cipher decryptCipher | ( | ) | [protected] |
Method used to return the shared instance of the decryption cipher.
AES encodes a given string using the secret key specified in the System property: er.extensions.ERXAESCipherKey. The AES cipher is a two way cipher meaning that given the secret key you can de-cipher what the original string is. For one-way encryption look at methods dealing with the SHA algorithm. To decode an AES encoded string use the method: decrypt. The resultant string from encoding a string is base64url encoded and safe for use in urls and cookies.
| clearText | string to be encrypted |
Implements ERXCrypterInterface.
| Cipher encryptCipher | ( | ) | [protected] |
Method used to return the shared instance of the encryption cipher.
| abstract Key secretKey | ( | ) | throws Exception [protected, pure virtual] |
Returns the secret key to use for this cipher.
Implemented in ERXAESCrypter.
| void setBlockSize | ( | int | blockSize | ) |
Sets the block size to use for this cipher.
| blockSize | the block size to use for this cipher |
int _blockSize [private] |
Block size of encrypted strings
ThreadLocalCipher _decryptCipher [private] |
Used to cache the decryption cipher
ThreadLocalCipher _encryptCipher [private] |
Used to cache the encryption cipher
Key _secretKey [private] |
Used to cache the secret key
final Logger log = Logger.getLogger(ERXCrypto.class) [static] |
1.5.8