Class TextEncryptorBindHandler

  • All Implemented Interfaces:
    org.springframework.boot.context.properties.bind.BindHandler

    public class TextEncryptorBindHandler
    extends org.springframework.boot.context.properties.bind.AbstractBindHandler
    BindHandler that uses a TextEncryptor to decrypt text if properly prefixed with {cipher}.
    Since:
    3.0.0
    Author:
    Marcin Grzejszczak
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static String ENCRYPTED_PROPERTY_PREFIX
      Prefix indicating an encrypted value.
      • Fields inherited from interface org.springframework.boot.context.properties.bind.BindHandler

        DEFAULT
    • Constructor Summary

      Constructors 
      Constructor Description
      TextEncryptorBindHandler​(org.springframework.security.crypto.encrypt.TextEncryptor textEncryptor, KeyProperties keyProperties)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Object onSuccess​(org.springframework.boot.context.properties.source.ConfigurationPropertyName name, org.springframework.boot.context.properties.bind.Bindable<?> target, org.springframework.boot.context.properties.bind.BindContext context, Object result)  
      • Methods inherited from class org.springframework.boot.context.properties.bind.AbstractBindHandler

        onFailure, onFinish, onStart
      • Methods inherited from interface org.springframework.boot.context.properties.bind.BindHandler

        onCreate
    • Field Detail

      • ENCRYPTED_PROPERTY_PREFIX

        protected static final String ENCRYPTED_PROPERTY_PREFIX
        Prefix indicating an encrypted value.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextEncryptorBindHandler

        public TextEncryptorBindHandler​(org.springframework.security.crypto.encrypt.TextEncryptor textEncryptor,
                                        KeyProperties keyProperties)
    • Method Detail

      • onSuccess

        public Object onSuccess​(org.springframework.boot.context.properties.source.ConfigurationPropertyName name,
                                org.springframework.boot.context.properties.bind.Bindable<?> target,
                                org.springframework.boot.context.properties.bind.BindContext context,
                                Object result)
        Specified by:
        onSuccess in interface org.springframework.boot.context.properties.bind.BindHandler
        Overrides:
        onSuccess in class org.springframework.boot.context.properties.bind.AbstractBindHandler