将加密的属性传递给spring context [英] Passing encrypted properties to spring context
问题描述
这里的挑战是我不想给清除用户,密码,网址到Web服务器团队。只是一个加密的密码,并在使用之前弹簧解密。
有没有这样的东西?我知道我可以编写一些东西,但是它已经完成了吗?
谢谢
通过使用org.jasypt.properties.EncryptableProperties对象,应用程序将能够正确读取和使用.properties文件,如下所示:
datasource.driver = com.mysql.jdbc.Driver
datasource.url = jdbc:mysql:// localhost / reportsdb
datasource.username = reportsUser
datasource.password = ENC(G6N718UuyPE5bHyWKyuLQSm02auQPUtm)
请注意,数据库密码已加密(实际上,任何其他属性也可以加密,与数据库配置是否相关)。
更多信息:
http://www.jasypt.org/encrypting-configuration.html
I never seen this but I wondering if somebody has come across. Having a web server which access a database. I want to pass the database password encrypted and have spring context decrypting it before setting the datasource. I know the spring security can do some of this like using a salt file in the web server, etc.
The challenge here is that I don't want to give a clear user,password,url to the web server team. Just an encrypted password and have spring decrypted before using it.
Is there something like this already? I know I could code something but is it already done?
Thanks
By using an org.jasypt.properties.EncryptableProperties object, an application would be able to correctly read and use a .properties file like this:
datasource.driver=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost/reportsdb
datasource.username=reportsUser
datasource.password=ENC(G6N718UuyPE5bHyWKyuLQSm02auQPUtm)
Note that the database password is encrypted (in fact, any other property could also be encrypted, be it related with database configuration or not).
More information :
http://www.jasypt.org/encrypting-configuration.html
这篇关于将加密的属性传递给spring context的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!