Annotation Type EnableEncryptableProperties
-
@Target(TYPE) @Retention(RUNTIME) @Import(EnableEncryptablePropertiesConfiguration.class) public @interface EnableEncryptableProperties
Annotation that enables Jasypt for properties decryption by annotating
Configurationclasses. Only one occurrence of this annotation is needed.This works well in conjunction with the
PropertySourceannotation. For instance:@SpringBootApplication @EnableEncryptableProperties @PropertySource(name="EncryptedProperties", "classpath:app.properties") public class MySpringBootApp { public static void main(String[] args) { SpringApplication.run(MySpringBootApp.class, args); } }The above code will then enable encryptable properties within all
PropertySources defined in the environment, not only the ones defined with thePropertySourceannotation, but also all system properties, command line properties, and those auto-magically picked up from application.properties and application.yml if they exist.This Configuration class basically registers a
BeanFactoryPostProcessorthat wraps allPropertySourcedefined in theEnvironmentwithEncryptablePropertySourceWrapperand defines a defaultStringEncryptorfor decrypting properties that can be configured through the same properties it wraps.For more information on how to declare encrypted properties, encrypt them, and encryption configuration go to http://jasypt.org
- Version:
- $Id: $Id
- Author:
- Ulises Bocchio
- See Also:
EnableEncryptablePropertiesConfiguration,EnableEncryptablePropertiesBeanFactoryPostProcessor,EncryptablePropertySourceWrapper,PropertySource