public abstract class ERXAbstractAESCrypter extends java.lang.Object implements ERXCrypterInterface
| Modifier and Type | Field and Description |
|---|---|
static org.apache.log4j.Logger |
log |
| Constructor and Description |
|---|
ERXAbstractAESCrypter() |
| Modifier and Type | Method and Description |
|---|---|
int |
blockSize()
Returns the block size for this cipher.
|
protected javax.crypto.Cipher |
createCipher(int mode)
Creates an AES cipher for a given mode.
|
java.lang.String |
decrypt(java.lang.String cryptedText)
Decodes an AES encoded string.
|
protected javax.crypto.Cipher |
decryptCipher()
Method used to return the shared instance of the decryption cipher.
|
java.lang.String |
encrypt(java.lang.String clearText)
AES encodes a given string using the secret key specified in the
System property: er.extensions.ERXAESCipherKey.
|
protected javax.crypto.Cipher |
encryptCipher()
Method used to return the shared instance of the encryption cipher.
|
protected abstract java.security.Key |
secretKey()
Returns the secret key to use for this cipher.
|
void |
setBlockSize(int blockSize)
Sets the block size to use for this cipher.
|
public void setBlockSize(int blockSize)
blockSize - the block size to use for this cipherpublic int blockSize()
protected abstract java.security.Key secretKey()
throws java.lang.Exception
java.lang.Exceptionprotected javax.crypto.Cipher createCipher(int mode)
mode - of the cipher (encrypting or decrypting)secretKey from the above method.protected javax.crypto.Cipher encryptCipher()
protected javax.crypto.Cipher decryptCipher()
public java.lang.String decrypt(java.lang.String cryptedText)
encrypt.decrypt in interface ERXCrypterInterfacecryptedText - AES encoded string to be decodedpublic java.lang.String encrypt(java.lang.String clearText)
decrypt. The resultant string from encoding
a string is base64url encoded and safe for use in urls and cookies.encrypt in interface ERXCrypterInterfaceclearText - string to be encryptedCopyright © 2002 – 2022 Project Wonder.