Class StringEncryptorConfig

java.lang.Object
org.hawaiiframework.crypto.StringEncryptorConfig

@Configuration public class StringEncryptorConfig extends Object
Config class to set up the StringEncryptor for encrypted properties.

This is moved to a separate class to make sure the StringEncryptor, which we're overriding here to use the HawaiiStringEncryptor is created before any encrypted properties are accessed. Otherwise, Jasypt will fall back to its default StringEncryptor.

  • Constructor Details

    • StringEncryptorConfig

      public StringEncryptorConfig()
  • Method Details

    • stringEncryptor

      @Bean("jasyptStringEncryptor") public org.jasypt.encryption.StringEncryptor stringEncryptor()
      Creates a StringEncryptor to decrypt encrypted property values.

      The environment variable identified by encryptionInit contains the key and the init vector.

      Returns:
      a new HawaiiStringEncryptor
    • setEncryptionInitProperty

      public void setEncryptionInitProperty(String encryptionInitProperty)