org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>@Configuration @Import(EncryptablePropertyResolverConfiguration.class) public class EnableEncryptablePropertiesConfiguration extends Object implements org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
Configuration class that registers a BeanFactoryPostProcessor that wraps all PropertySource defined in the Environment
with EncryptablePropertySourceWrapper and defines a default StringEncryptor for decrypting properties
that can be configured through the same properties it wraps.
The StringEncryptor bean is only defined when no other
bean of type StringEncryptor is present in the Application Context, thus allowing for custom definition if required.
The default StringEncryptor can be configured through the following properties:
| Key | Required | Default Value |
| jasypt.encryptor.password | True | - |
| jasypt.encryptor.algorithm | False | PBEWithMD5AndDES |
| jasypt.encryptor.keyObtentionIterations | False | 1000 |
| jasypt.encryptor.poolSize | False | 1 |
| jasypt.encryptor.providerName | False | SunJCE |
| jasypt.encryptor.saltGeneratorClassname | False | org.jasypt.salt.RandomSaltGenerator |
| jasypt.encryptor.stringOutputType | False | base64 |
For mor information about the configuration properties
StringPBEConfig| Constructor | Description |
|---|---|
EnableEncryptablePropertiesConfiguration() |
| Modifier and Type | Method | Description |
|---|---|---|
static EnableEncryptablePropertiesBeanFactoryPostProcessor |
enableEncryptablePropertySourcesPostProcessor(org.springframework.core.env.ConfigurableEnvironment environment) |
|
void |
initialize(org.springframework.context.ConfigurableApplicationContext applicationContext) |
public EnableEncryptablePropertiesConfiguration()
@Bean public static EnableEncryptablePropertiesBeanFactoryPostProcessor enableEncryptablePropertySourcesPostProcessor(org.springframework.core.env.ConfigurableEnvironment environment)
public void initialize(org.springframework.context.ConfigurableApplicationContext applicationContext)
initialize in interface org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>Copyright © 2018. All rights reserved.