Class AbstractJceCrypt
- java.lang.Object
-
- org.apache.wicket.core.util.crypt.AbstractJceCrypt
-
- All Implemented Interfaces:
ICrypt
- Direct Known Subclasses:
AESCrypt
public abstract class AbstractJceCrypt extends Object implements ICrypt
Base class for JCE based ICrypt implementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractJceCrypt()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract byte[]
decrypt(byte[] encrypted)
Decrypts an encrypted byte array.String
decryptUrlSafe(String text)
Decrypts a string into a string.protected abstract byte[]
encrypt(byte[] plainBytes)
Encrypts the given text into a byte array.String
encryptUrlSafe(String plainText)
Encrypt a string into a string using URL safe Base64 encoding.void
setKey(String key)
Sets private encryption key.
-
-
-
Constructor Detail
-
AbstractJceCrypt
public AbstractJceCrypt()
-
-
Method Detail
-
decryptUrlSafe
public final String decryptUrlSafe(String text)
Decrypts a string into a string.- Specified by:
decryptUrlSafe
in interfaceICrypt
- Parameters:
text
- text to decrypt- Returns:
- the decrypted text
-
encryptUrlSafe
public final String encryptUrlSafe(String plainText)
Encrypt a string into a string using URL safe Base64 encoding.- Specified by:
encryptUrlSafe
in interfaceICrypt
- Parameters:
plainText
- text to encrypt- Returns:
- encrypted string
-
decrypt
protected abstract byte[] decrypt(byte[] encrypted)
Decrypts an encrypted byte array.- Parameters:
encrypted
- byte array to decrypt- Returns:
- the decrypted text
-
encrypt
protected abstract byte[] encrypt(byte[] plainBytes)
Encrypts the given text into a byte array.- Parameters:
plainBytes
- text to encrypt- Returns:
- the string encrypted
-
-