Package org.hawaiiframework.crypto
Class HawaiiStringEncryptor
java.lang.Object
org.hawaiiframework.crypto.HawaiiStringEncryptor
- All Implemented Interfaces:
org.jasypt.encryption.StringEncryptor
- Direct Known Subclasses:
HawaiiUrlSafeStringEncryptor
Implementation of Jasypt's
StringEncryptor
interface. This class registers the Bouncy Castle JCE Provider.- Since:
- 2.0.0
- See Also:
-
StringEncryptor
BouncyCastleProvider
-
Constructor Summary
ConstructorDescriptionHawaiiStringEncryptor
(String key, String initVector) Creates a newHawaiiStringEncryptor
with the given key and init vector. -
Method Summary
-
Constructor Details
-
HawaiiStringEncryptor
Creates a newHawaiiStringEncryptor
with the given key and init vector.- Parameters:
key
- the key used for encryption/decryptioninitVector
- the init vector used for encryption/decryption
-
-
Method Details
-
encrypt
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
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
-