Package org.apache.wicket.util.crypt
Class AbstractCrypt
- java.lang.Object
-
- org.apache.wicket.util.crypt.AbstractCrypt
-
- All Implemented Interfaces:
ICrypt
- Direct Known Subclasses:
SunJceCrypt,TrivialCrypt
public abstract class AbstractCrypt extends Object implements ICrypt
Abstract base class for JCE based ICrypt implementations.- Author:
- Juergen Donnerstag
-
-
Constructor Summary
Constructors Constructor Description AbstractCrypt()Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract byte[]crypt(byte[] input, int mode)Crypts the given byte arrayStringdecryptUrlSafe(String text)Decrypts a string into a string.StringencryptUrlSafe(String plainText)Encrypt a string into a string using URL safe Base64 encoding.StringgetKey()Get encryption private keyvoidsetKey(String key)Set encryption private key
-
-
-
Constructor Detail
-
AbstractCrypt
public AbstractCrypt()
Constructor
-
-
Method Detail
-
decryptUrlSafe
public final String decryptUrlSafe(String text)
Decrypts a string into a string.- Specified by:
decryptUrlSafein 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:
encryptUrlSafein interfaceICrypt- Parameters:
plainText- text to encrypt- Returns:
- encrypted string
-
crypt
protected abstract byte[] crypt(byte[] input, int mode) throws GeneralSecurityException
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
-
-