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's StringEncryptor interface. This class registers the Bouncy Castle JCE Provider.
Since:
2.0.0
See Also:
  • StringEncryptor
  • BouncyCastleProvider
  • Constructor Details

    • HawaiiStringEncryptor

      public HawaiiStringEncryptor(String key, String initVector)
      Creates a new HawaiiStringEncryptor with the given key and init vector.
      Parameters:
      key - the key used for encryption/decryption
      initVector - the init vector used for encryption/decryption
  • Method Details

    • encrypt

      public String encrypt(String message)
      Encrypt the input message.
      Specified by:
      encrypt in interface org.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 interface org.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
      Create a cypher with the mode, key and init vector.
      Throws:
      GeneralSecurityException