java.lang.Object
org.apache.wicket.util.crypt.AbstractCrypt
- All Implemented Interfaces:
ICrypt
- Direct Known Subclasses:
SunJceCrypt
,TrivialCrypt
Abstract base class for JCE based ICrypt implementations.
- Author:
- Juergen Donnerstag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract byte[]
crypt
(byte[] input, int mode) Crypts the given byte arrayfinal String
decryptUrlSafe
(String text) Decrypts a string into a string.final String
encryptUrlSafe
(String plainText) Encrypt a string into a string using URL safe Base64 encoding.getKey()
Get encryption private keyvoid
Set encryption private key
-
Constructor Details
-
AbstractCrypt
public AbstractCrypt()Constructor
-
-
Method Details
-
decryptUrlSafe
Decrypts a string into a string.- Specified by:
decryptUrlSafe
in interfaceICrypt
- Parameters:
text
- text to decrypt- Returns:
- the decrypted text
-
encryptUrlSafe
Encrypt a string into a string using URL safe Base64 encoding.- Specified by:
encryptUrlSafe
in interfaceICrypt
- Parameters:
plainText
- text to encrypt- Returns:
- encrypted string
-
getKey
Get encryption private key- Returns:
- encryption private key
-
setKey
Set encryption private key- Parameters:
key
- private key to make de-/encryption unique
-
crypt
Crypts the given byte array- Parameters:
input
- byte array to be cryptedmode
- crypt mode- Returns:
- the input crypted. Null in case of an error
- Throws:
GeneralSecurityException
-