Package org.hawaiiframework.crypto
Class HawaiiStringEncryptor
- java.lang.Object
-
- org.hawaiiframework.crypto.HawaiiStringEncryptor
-
- All Implemented Interfaces:
org.jasypt.encryption.StringEncryptor
- Direct Known Subclasses:
HawaiiUrlSafeStringEncryptor
public class HawaiiStringEncryptor extends Object implements org.jasypt.encryption.StringEncryptor
Implementation of Jasypt'sStringEncryptorinterface. This class registers the Bouncy Castle JCE Provider.- Since:
- 2.0.0
- Author:
- Wouter Eerdekens
- See Also:
StringEncryptor,BouncyCastleProvider
-
-
Constructor Summary
Constructors Constructor Description HawaiiStringEncryptor(String key, String initVector)Creates a newHawaiiStringEncryptorwith the given key and init vector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdecrypt(String encryptedMessage)Decrypt the encrypted input message.Stringencrypt(String message)Encrypt the input message.protected CipherinitCipher(int mode, String key, String initVector)
-
-
-
Method Detail
-
encrypt
public String encrypt(String message)
Encrypt the input message.- Specified by:
encryptin interfaceorg.jasypt.encryption.StringEncryptor- Parameters:
message- the message to be encrypted- Returns:
- the result of encryption
- Throws:
HawaiiException- when an error occurs.
-
decrypt
public String decrypt(String encryptedMessage)
Decrypt the encrypted input message.- Specified by:
decryptin interfaceorg.jasypt.encryption.StringEncryptor- Parameters:
encryptedMessage- the message to be decrypted- Returns:
- the result of decryption
- Throws:
HawaiiException- when an error occurs.
-
initCipher
protected Cipher initCipher(int mode, String key, String initVector) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
-