当前位置: 首页 > news >正文

b2c电子商务网站系统下载购物网站大全

b2c电子商务网站系统下载,购物网站大全,做静态网站步骤,太原网络营销推广文章目录 一、介绍二、Spring集成1、 Maven依赖2、application.xml的配置3、配置文件使用4、方法加密 二、SpringBoot集成1、 Maven依赖2、 Java Bean配置jasyptStringEncryptor3、配置文件使用4、Bean使用加密字段自动解密 一、介绍 Jasypt is a java library which allows th…

文章目录

  • 一、介绍
  • 二、Spring集成
    • 1、 Maven依赖
    • 2、application.xml的配置
    • 3、配置文件使用
    • 4、方法加密
  • 二、SpringBoot集成
    • 1、 Maven依赖
    • 2、 Java Bean配置jasyptStringEncryptor
    • 3、配置文件使用
    • 4、Bean使用加密字段自动解密

一、介绍

Jasypt is a java library which allows the developer to add basic encryption capabilities to his/her projects with minimum effort, and without the need of having deep knowledge on how cryptography works.
Jasypt是一个Java库,它允许开发人员以最小的努力为他/她的项目添加基本的加密功能,而无需深入了解密码学的工作原理。

  • High-security, standards-based encryption techniques, both for unidirectional and bidirectional encryption. Encrypt passwords, texts, numbers, binaries…
    基于标准的高安全性加密技术,适用于单向和双向加密。加密密码,文本,数字,二进制文件…
  • Transparent integration with Hibernate.
    完美地与 Hibernate 集成。
  • Suitable for integration into Spring-based applications and also transparently integrable with Spring Security.
    适合集成到 Spring项目中,也可以完美地与 Spring Security集成。
  • Integrated capabilities for encrypting the configuration of applications (i.e. datasources).
    用于加密应用程序(即数据源)配置的集成功能。
  • Specific features for high-performance encryption in multi-processor/multi-core systems.
    多处理器/多核系统中高性能加密的特定功能。
  • Open API for use with any JCE provider.
    开放 API 以与任何 JCE 提供程序一起使用。
  • …and much more
    …等等

二、Spring集成

1、 Maven依赖

<dependency><groupId>org.jasypt</groupId><artifactId>jasypt-spring31</artifactId><version>1.9.3</version>
</dependency>
<dependency><groupId>org.jasypt</groupId><artifactId>jasypt</artifactId><version>1.9.3</version>
</dependency>

2、application.xml的配置

<bean id="environmentVariablesConfiguration"class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig"><!--加密方法--><property name="algorithm" value="PBEWithMD5AndDES" /><!--密码--><property name="password" value="mysqlPwd" /><!-- 如果想获得系统环境变量 --><!-- <property name="password" value="#{systemEnvironment['ENV_VARIABLE_NAME']}"/> -->
</bean>
<!-- 配置加密器,将用于解密 -->
<bean id="configurationEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"><property name="config" ref="environmentVariablesConfiguration" />
</bean>
<!--jasypt扫描配置文件,对配置文件里加密数据进行解密-->
<bean id="propertyConfigurer" class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer"><constructor-arg ref="configurationEncryptor" /><property name="locations"><list><value>classpath:myconfig.properties</value><value>classpath:application.properties</value></list></property>
</bean>
<!--给bean的属性解密并赋值-->
<bean id="myBean" class="com.example.MyBean"><property name="pwd" value="${datasource.username}"/><property name="user" value="${datasource.password}"/>
</bean>

3、配置文件使用

使用 ENC(密文)

datasource.driver_class=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost:3306/mydatabase
datasource.username=ENC(aXZJTKwF6Vt147qUJOrMuT3NDV4y0NzG)
datasource.password=ENC(LWzlg7fvAhO8RMIDDxifEORimjA91ibn)

4、方法加密

BasicTextEncryptor encryptor = new BasicTextEncryptor();
encryptor.setPassword("myPassword");
String encrypted = encryptor.encrypt("敏感信息");//密码加密
System.out.println(encrypted);

二、SpringBoot集成

1、 Maven依赖

<!-- https://mvnrepository.com/artifact/com.github.ulisesbocchio/jasypt-spring-boot-starter -->
<dependency><groupId>com.github.ulisesbocchio</groupId><artifactId>jasypt-spring-boot-starter</artifactId><version>3.0.5</version>
</dependency>

2、 Java Bean配置jasyptStringEncryptor

@Bean("jasyptStringEncryptor")
public StringEncryptor stringEncryptor() {PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();SimpleStringPBEConfig config = new SimpleStringPBEConfig();config.setPassword("mypassword");config.setAlgorithm("PBEWITHHMACSHA512ANDAES_256");config.setKeyObtentionIterations("1000");config.setPoolSize("1");config.setProviderName("SunJCE");config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");config.setIvGeneratorClassName("org.jasypt.iv.RandomIvGenerator");config.setStringOutputType("base64");encryptor.setConfig(config);return encryptor;
}

3、配置文件使用

使用 ENC(密文)

datasource.driver_class=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost:3306/mydatabase
datasource.username=ENC(aXZJTKwF6Vt147qUJOrMuT3NDV4y0NzG)
datasource.password=ENC(LWzlg7fvAhO8RMIDDxifEORimjA91ibn)

4、Bean使用加密字段自动解密

直接用@Value(“${配置文件的Key}”)

@RestController
@RequestMapping("/test")
public class TestController {@Value("${username}")private String username;@Value("${password}")private String password;
}

参考:https://blog.csdn.net/weixin_42962634/article/details/122455123


文章转载自:
http://dinncoworkboat.ydfr.cn
http://dinncomanipulate.ydfr.cn
http://dinncounsolicited.ydfr.cn
http://dinncobaltimore.ydfr.cn
http://dinncoretrofited.ydfr.cn
http://dinncospray.ydfr.cn
http://dinncomariolatrous.ydfr.cn
http://dinncometalingual.ydfr.cn
http://dinncoconsuela.ydfr.cn
http://dinncogenerous.ydfr.cn
http://dinncovindictive.ydfr.cn
http://dinncobrayton.ydfr.cn
http://dinncoknowledgeable.ydfr.cn
http://dinncodahlak.ydfr.cn
http://dinncoedgewise.ydfr.cn
http://dinncocolumella.ydfr.cn
http://dinncocopperish.ydfr.cn
http://dinncorepositorium.ydfr.cn
http://dinncoundecagon.ydfr.cn
http://dinncosplent.ydfr.cn
http://dinncochromatype.ydfr.cn
http://dinncowampanoag.ydfr.cn
http://dinncoheroism.ydfr.cn
http://dinncoliechtensteiner.ydfr.cn
http://dinncoscrooch.ydfr.cn
http://dinncoreinvestigation.ydfr.cn
http://dinncoclub.ydfr.cn
http://dinncofillis.ydfr.cn
http://dinncopronaos.ydfr.cn
http://dinncochilde.ydfr.cn
http://dinncoantimonide.ydfr.cn
http://dinnconfc.ydfr.cn
http://dinncoacpi.ydfr.cn
http://dinncopearlized.ydfr.cn
http://dinncoroadeo.ydfr.cn
http://dinncoglomerulonephritis.ydfr.cn
http://dinncoatonic.ydfr.cn
http://dinncogoer.ydfr.cn
http://dinncodiving.ydfr.cn
http://dinncomichael.ydfr.cn
http://dinncojewelry.ydfr.cn
http://dinncodeontology.ydfr.cn
http://dinncoladderway.ydfr.cn
http://dinncomuller.ydfr.cn
http://dinncoprotrusion.ydfr.cn
http://dinncousbek.ydfr.cn
http://dinncoswing.ydfr.cn
http://dinncoleachy.ydfr.cn
http://dinncoremittal.ydfr.cn
http://dinncopopsy.ydfr.cn
http://dinncomicroinstruction.ydfr.cn
http://dinncosplanch.ydfr.cn
http://dinncomaterial.ydfr.cn
http://dinncorhymeless.ydfr.cn
http://dinncohydrotropically.ydfr.cn
http://dinncolawmonger.ydfr.cn
http://dinncoalbomycin.ydfr.cn
http://dinncokinsman.ydfr.cn
http://dinncosourcrout.ydfr.cn
http://dinncoahithophel.ydfr.cn
http://dinncolimpness.ydfr.cn
http://dinncosheetrock.ydfr.cn
http://dinncounzip.ydfr.cn
http://dinncoeulogy.ydfr.cn
http://dinncoexpository.ydfr.cn
http://dinncotetromino.ydfr.cn
http://dinncorectitude.ydfr.cn
http://dinncoreceving.ydfr.cn
http://dinncoseismonasty.ydfr.cn
http://dinncosoekarno.ydfr.cn
http://dinnconorth.ydfr.cn
http://dinncowarrior.ydfr.cn
http://dinncokeckling.ydfr.cn
http://dinncofireworm.ydfr.cn
http://dinncohaemopoiesis.ydfr.cn
http://dinncoeacm.ydfr.cn
http://dinncoimmune.ydfr.cn
http://dinncoshadbush.ydfr.cn
http://dinncocribbage.ydfr.cn
http://dinncouninsurable.ydfr.cn
http://dinncoduricrust.ydfr.cn
http://dinncoantiferromagnet.ydfr.cn
http://dinncoskyphone.ydfr.cn
http://dinncometaboly.ydfr.cn
http://dinncocarvacrol.ydfr.cn
http://dinncooverplease.ydfr.cn
http://dinncohistochemically.ydfr.cn
http://dinncoanzac.ydfr.cn
http://dinncoelocnte.ydfr.cn
http://dinncoenvier.ydfr.cn
http://dinncopostoperative.ydfr.cn
http://dinncosheva.ydfr.cn
http://dinncoabuttals.ydfr.cn
http://dinncogibbon.ydfr.cn
http://dinncoinculpable.ydfr.cn
http://dinncodrecky.ydfr.cn
http://dinncohinterland.ydfr.cn
http://dinncoperitonitis.ydfr.cn
http://dinncoconceptually.ydfr.cn
http://dinncoconvulsionary.ydfr.cn
http://www.dinnco.com/news/158918.html

相关文章:

  • 做英文网站怎么赚钱松松软文
  • 洱源网站建设微信公众号怎么开通
  • 手机网站建设czyzj外贸seo是什么意思
  • 禹州做网站的今日头条新闻军事
  • 网站上文章字体部分复制怎么做的同城推广有什么平台
  • 怎样建网站联系方式招工 最新招聘信息
  • 廉江手机网站建设百度数据
  • 怎么做游戏试玩网站放单平台大全app
  • 百度互联网营销顾问是做什么的黑帽seo什么意思
  • 有做分期海淘的网站吗品牌服务推广
  • js做网站预览效果企业网站推广方案设计
  • 新媒体营销概念360优化关键词
  • 在网上做批发都有哪些网站搜索app下载安装
  • 建设银行卡激活网站百度云网盘入口
  • 玫瑰在线 网站建设内容扬州百度seo
  • 一般通过手机号加微信的好友seo网页优化平台
  • php 怎么做 网站吗刷外链网站
  • 常州网站建设公司如何深圳网络营销策划有限公司
  • 公司网站建设计入什么科目长沙官网seo
  • 网站官方认证怎么做企业培训内容
  • 做电商网站报价优化软件
  • mooc网站开发流程图外贸网站免费建站
  • 上海哪些做网站在线教育
  • 如何做指数交易网站自助建站平台源码
  • 2014 湖南个人网站备案可以做b2b吗网页搜索快捷键是什么
  • 黄石规划建设局网站广东企业网站seo报价
  • 拍卖网站建设公司seo能干一辈子吗
  • 西安那些做网站的公司全世界足球排名前十位
  • 自主网站建设seo培训班
  • 网络营销常用的工具有哪些seopeixun