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'sStringEncryptor
interface. 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 newHawaiiStringEncryptor
with the given key and init vector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
decrypt(String encryptedMessage)
Decrypt the encrypted input message.String
encrypt(String message)
Encrypt the input message.protected Cipher
initCipher(int mode, String key, String initVector)
-
-
-
Method Detail
-
encrypt
public String encrypt(String message)
Encrypt the input message.- Specified by:
encrypt
in 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:
decrypt
in 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
-
-