public abstract class ERXAbstractAESCrypter extends Object implements ERXCrypterInterface
Constructor and Description |
---|
ERXAbstractAESCrypter() |
Modifier and Type | Method and Description |
---|---|
int |
blockSize()
Returns the block size for this cipher.
|
protected Cipher |
createCipher(int mode)
Creates an AES cipher for a given mode.
|
String |
decrypt(String cryptedText)
Decodes an AES encoded string.
|
protected Cipher |
decryptCipher()
Method used to return the shared instance of the decryption cipher.
|
String |
encrypt(String clearText)
AES encodes a given string using the secret key specified in the
System property: er.extensions.ERXAESCipherKey.
|
protected Cipher |
encryptCipher()
Method used to return the shared instance of the encryption cipher.
|
protected abstract 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 Key secretKey() throws Exception
Exception
protected Cipher createCipher(int mode)
mode
- of the cipher (encrypting or decrypting)secretKey
from the above method.protected Cipher encryptCipher()
protected Cipher decryptCipher()
public String decrypt(String cryptedText)
encrypt
.decrypt
in interface ERXCrypterInterface
cryptedText
- AES encoded string to be decodedpublic String encrypt(String clearText)
decrypt
. The resultant string from encoding
a string is base64url encoded and safe for use in urls and cookies.encrypt
in interface ERXCrypterInterface
clearText
- string to be encryptedCopyright © 2002 – 2024 Project Wonder.