中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

java 做直播網(wǎng)站有哪些軟件有哪些最新app推廣項目平臺

java 做直播網(wǎng)站有哪些軟件有哪些,最新app推廣項目平臺,wordpress最佳插件,排名優(yōu)化怎么做文章目錄 一、介紹二、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庫,它允許開發(fā)人員以最小的努力為他/她的項目添加基本的加密功能,而無需深入了解密碼學(xué)的工作原理。

  • High-security, standards-based encryption techniques, both for unidirectional and bidirectional encryption. Encrypt passwords, texts, numbers, binaries…
    基于標(biāo)準(zhǔn)的高安全性加密技術(shù),適用于單向和雙向加密。加密密碼,文本,數(shù)字,二進(jìn)制文件…
  • 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).
    用于加密應(yīng)用程序(即數(shù)據(jù)源)配置的集成功能。
  • Specific features for high-performance encryption in multi-processor/multi-core systems.
    多處理器/多核系統(tǒng)中高性能加密的特定功能。
  • 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" /><!-- 如果想獲得系統(tǒng)環(huán)境變量 --><!-- <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掃描配置文件,對配置文件里加密數(shù)據(jù)進(jìn)行解密-->
<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://m.risenshineclean.com/news/63607.html

相關(guān)文章:

  • 廈門市網(wǎng)站建設(shè)寧波專業(yè)seo服務(wù)
  • wordpress頁面添加圖片優(yōu)化排名案例
  • 石家莊做網(wǎng)站多少錢百度注冊頁面
  • 深圳做棋牌網(wǎng)站建設(shè)哪家公司收費合理網(wǎng)絡(luò)營銷外包
  • 廣州網(wǎng)絡(luò)推廣有限公司滎陽seo推廣
  • 自己怎么做網(wǎng)站賣車bt種子bt天堂
  • 電子政務(wù)網(wǎng)站建設(shè)公司排行榜引擎搜索網(wǎng)站
  • 物理結(jié)構(gòu)網(wǎng)站怎么看app的下載網(wǎng)址
  • 網(wǎng)站建設(shè)新聞資訊無錫seo網(wǎng)站排名
  • 電腦視頻制作軟件seo在線優(yōu)化
  • qq開放平臺網(wǎng)站開發(fā)申請不通過的原因制作網(wǎng)站推廣
  • 什么網(wǎng)站可以做美食寧波網(wǎng)絡(luò)營銷推廣咨詢報價
  • 深圳網(wǎng)站營銷推廣公司電話網(wǎng)絡(luò)推廣怎么找客戶資源
  • ??悼h城鄉(xiāng)建設(shè)路網(wǎng)站怎么有自己的網(wǎng)站
  • 網(wǎng)站建設(shè)的客戶在哪里山西seo關(guān)鍵詞優(yōu)化軟件搜索
  • 深圳網(wǎng)站建設(shè)(信科網(wǎng)絡(luò))大數(shù)據(jù)營銷軟件
  • jizhicmsseo排名是什么意思
  • 在常熟市公司網(wǎng)站建設(shè)哪家好蘇州seo安嚴(yán)博客
  • 長沙網(wǎng)頁設(shè)計工資一般多少企業(yè)seo如何優(yōu)化
  • 請人做網(wǎng)站得多少錢雅詩蘭黛網(wǎng)絡(luò)營銷策劃書
  • 網(wǎng)站開發(fā)者取色工具ai智能搜索引擎
  • 地圖網(wǎng)站怎么做的廣告投放平臺
  • 洛陽做網(wǎng)站的百度上海分公司
  • 做短視頻網(wǎng)站需要審批搜索關(guān)鍵詞網(wǎng)站
  • php網(wǎng)站開發(fā)看什么書拼多多seo 優(yōu)化軟件
  • 關(guān)于電商運營的知識點百度關(guān)鍵詞seo排名軟件
  • 哪個網(wǎng)站可以做淘寶代碼百度號碼認(rèn)證平臺官網(wǎng)
  • 南通公司做網(wǎng)站百度人工客服
  • 短網(wǎng)址生成器有哪些網(wǎng)站seo優(yōu)化方案項目策劃書
  • 諸暨網(wǎng)站制作seo公司賺錢嗎