Created
June 9, 2011 12:54
-
-
Save javaduke/1016673 to your computer and use it in GitHub Desktop.
Jasypt configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- --> | |
<!-- Configuration for encryptor, based on environment variables. --> | |
<!-- --> | |
<!-- In this example, the encryption password will be read from an --> | |
<!-- environment variable called "MULE_ENCRYPTION_PASSWORD" which, once --> | |
<!-- the application has been started, could be safely unset. --> | |
<!-- --> | |
<spring:bean id="environmentVariablesConfiguration" | |
class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig"> | |
<spring:property name="algorithm" value="PBEWithMD5AndDES" /> | |
<spring:property name="passwordEnvName" value="MULE_ENCRYPTION_PASSWORD" /> | |
</spring:bean> | |
<!-- --> | |
<!-- The will be the encryptor used for decrypting configuration values. --> | |
<!-- --> | |
<spring:bean id="configurationEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"> | |
<spring:property name="config" ref="environmentVariablesConfiguration" /> | |
</spring:bean> | |
<!-- --> | |
<!-- The EncryptablePropertyPlaceholderConfigurer will read the --> | |
<!-- .properties files and make their values accessible as ${var} --> | |
<!-- --> | |
<!-- Our "configurationEncryptor" bean (which implements --> | |
<!-- org.jasypt.encryption.StringEncryptor) is set as a constructor arg. --> | |
<!-- --> | |
<spring:bean id="propertyConfigurer" | |
class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer"> | |
<spring:constructor-arg ref="configurationEncryptor" /> | |
<spring:property name="locations"> | |
<spring:list> | |
<spring:value>credentials.properties</spring:value> | |
</spring:list> | |
</spring:property> | |
</spring:bean> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment