系列文章: 1、环境搭建及测试- - -附免费视频教程
专栏14篇,参看:http://tyronblog.com/tags/school-o2o
GitHub地址:https://github.com/tyronczt/imooc-o2o
线上演示地址:http://o2o.tyronblog.com:8090/o2o/front/index
项目中将关键配置信息,如数据库登录信息进行DES加密,以加强系统的安全性。
DESUtil
DES是一种对称加密算法, 所谓对称加密算法就是指使用相同的密钥; 该工具类主要是对关键配置信息进行加密和解密。 主要代码参考:DESUtil.java
EncryptPropertyPlaceholderConfigurer
继承PropertyPlaceholderConfigurer,重写convertProperty,明确要加密的内容。 主要代码参考:EncryptPropertyPlaceholderConfigurer.java
修改配置文件
<!-- 1.配置数据库相关参数properties的属性:${url} -->
<bean class="com.tyron.o2o.util.EncryptPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
<property name="fileEncoding" value="UTF-8"/>
</bean>
详情配置参看:spring-dao.xml
本文由 tyron 创作,采用 知识共享署名4.0
国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Sep 18,2019