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

用安卓做网站外贸公司名字大全

用安卓做网站,外贸公司名字大全,美图秀秀网页版,海报设计图片简单文章目录 前言一、集成 Jasypt1. pom 依赖2. yml 依赖 3. 加密工具类3. 使用二、常见问题1. application.yml 失效问题2. 配置热更新失败问题 前言 jasypt 官方地址#xff1a;https://github.com/ulisesbocchio/jasypt-spring-boot Jasypt可以为Springboot加密的信息很多https://github.com/ulisesbocchio/jasypt-spring-boot Jasypt可以为Springboot加密的信息很多主要有 System Property 系统变量。Envirnment Property 环境变量。Command Line argument 命令行参数。Application.properties 应用配置文件。Yaml properties 应用配置文件。other custom property sources 其它配置文件。 一、集成 Jasypt 1. pom 依赖 !-- jasyptyml加密 -- dependencygroupIdcom.github.ulisesbocchio/groupIdartifactIdjasypt-spring-boot-starter/artifactIdversion3.0.5/version /dependency2. yml 依赖 jasypt:encryptor:password: encpassword # 加密盐值自定义algorithm: PBEWithMD5AndDES # 加密算法3.0.5以下版本默认PBEWithMD5AndDES即DES加密算法-32位密文3.0.5及以上版本默认PBEWITHHMACSHA512ANDAES_256即AES加密算法-64位密文iv-generator-classname: org.jasypt.iv.NoIvGenerator # 加密偏移生成器3. 加密工具类 使用如下工具类对密码进行加密获取密文。 import lombok.extern.slf4j.Slf4j; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;/*** jasyptyml加密工具** author whiteen* date 2024-06-20 00:00:00*/ Slf4j public class JasyptUtil {/*** DES加密** param original 待加密内容* param password 加密盐值* return 加密密文* author whiteen* date 2024-06-20 00:00:00*/public static String encryptByDes(String original, String password) {StandardPBEStringEncryptor encryptor new StandardPBEStringEncryptor();SimpleStringPBEConfig config new SimpleStringPBEConfig();// 设置盐值config.setPassword(password);config.setAlgorithm(PBEWithMD5AndDES);config.setIvGeneratorClassName(org.jasypt.iv.NoIvGenerator);encryptor.setConfig(config);// 加密return encryptor.encrypt(original);}/*** AES加密** param original 待加密内容* param password 加密盐值* return 加密密文* author whiteen* date 2024-06-20 00:00:00*/public static String encryptByAes(String original, String password) {StandardPBEStringEncryptor encryptor new StandardPBEStringEncryptor();SimpleStringPBEConfig config new SimpleStringPBEConfig();// 设置盐值config.setPassword(password);config.setAlgorithm(PBEWITHHMACSHA512ANDAES_256);config.setIvGeneratorClassName(org.jasypt.iv.RandomIvGenerator);encryptor.setConfig(config);// 加密return encryptor.encrypt(original);}/*** DES解密** param original 待解密内容* param password 加密盐值* return 加密明文* author whiteen* date 2024-06-20 00:00:00*/public static String decryptByDes(String original, String password) {StandardPBEStringEncryptor encryptor new StandardPBEStringEncryptor();SimpleStringPBEConfig config new SimpleStringPBEConfig();// 设置盐值config.setPassword(password);config.setAlgorithm(PBEWithMD5AndDES);config.setIvGeneratorClassName(org.jasypt.iv.NoIvGenerator);encryptor.setConfig(config);// 解密return encryptor.decrypt(original);}/*** AES解密** param original 待解密内容* param password 加密盐值* return 加密明文* author whiteen* date 2024-06-20 00:00:00*/public static String decryptByAes(String original, String password) {StandardPBEStringEncryptor encryptor new StandardPBEStringEncryptor();SimpleStringPBEConfig config new SimpleStringPBEConfig();// 设置盐值config.setPassword(password);config.setAlgorithm(PBEWITHHMACSHA512ANDAES_256);config.setIvGeneratorClassName(org.jasypt.iv.RandomIvGenerator);encryptor.setConfig(config);// 解密return encryptor.decrypt(original);}public static void main(String[] args) {// 待加密内容String original original;// 加密盐值String password encpassword;// DES加密String encryptedDes encryptByDes(original, password);log.info(DES密⽂: {}, encryptedDes);// DES解密String decryptedDes decryptByDes(encryptedDes, password);log.info(DES明⽂: {}, decryptedDes);// AES加密String encryptedAes encryptByAes(original, password);log.info(AES密⽂: {}, encryptedAes);// AES解密String decryptedAes decryptByAes(encryptedAes, password);log.info(AES明⽂: {}, decryptedAes);}} 3. 使用 password: ENC(${ORACLE_PWD:password})二、常见问题 1. application.yml 失效问题 如果你的项目存在 boostrap.yml 配置文件在引入 jasypt-spring-boot-starter 之后发现 application.yml 与 application-dev.yml 配置没有生效需要在 boostrap.yml 中设置 jasypt.encryptor.bootstrap 属性为 false禁用对 boostrap 配置文件的加密支持就可以解决 application.yml 与 application-dev.yml 配置失效的问题。 说明 当 jasypt 和 springcloud 一起使用时bootstrap 的配置会失效。追踪代码发现spring 在启动 bootstrap 容器后当把 bootstrap 容器的 environment 合并到子容器时只同步了 OriginTrackedMapPropertySource 类型 BootstrapApplicationListener此时所有的 PropertySource 都已经被包装为 EncryptablePropertySourceWrapper所以会导致 bootstrap 的配置不会合并到子容器。 2. 配置热更新失败问题 在 yml 配置文件中设置环境变量报错。 参考 apollo 跟 jasypt-spring-boot-2.1.0.jar 不兼容问题 https://github.com/apolloconfig/apollo/issues/2162 升级 jasypt-spring-boot-starter 到 3.0.5 及以上版本可以解决配置热更新问题再新增 algorithm 和 iv-generator-classname 两个配置即可 !-- jasyptyml加密 -- dependencygroupIdcom.github.ulisesbocchio/groupIdartifactIdjasypt-spring-boot-starter/artifactIdversion3.0.5/version /dependencyjasypt:encryptor:password: encpassword # 加密盐值自定义algorithm: PBEWithMD5AndDES # 加密算法3.0.5以下版本默认PBEWithMD5AndDES即DES加密算法-32位密文3.0.5及以上版本默认PBEWITHHMACSHA512ANDAES_256即AES加密算法-64位密文iv-generator-classname: org.jasypt.iv.NoIvGenerator # 加密偏移生成器这样就可以在 yml 配置文件中设置环境变量 password: ENC(${ORACLE_PWD:BBO5rGF40iSg5oG36MT5aEwpdrOe5f2})
http://www.hkea.cn/news/14467561/

相关文章:

  • 东莞万江网站制作网站做的长图能导出吗
  • 白水网站建设青岛seo博客
  • 求一个做健身餐的网站网络营销网站 功能
  • 网站开发 有哪些优化功能四川建设集团有限公司网站
  • 淄博网站设计方案seo推广关键词公司
  • 中国十大购物网站排行榜滨江做网站
  • 门户手机网站开发从化做网站开发
  • 毕业设计资源网站金融网站模板免费下载
  • 网站建设 海拉尔网站项目的流程
  • 网站开发工程师公司兰州微信小程序制作公司
  • 珠海公司网站域名注册黄骅市属于沧州吗
  • 平顶山做网站优化数棋网站建设
  • 汕头网站建设找千素网阿里云主机做网站
  • 怎么推广我的网站免费详情页模板网站
  • 网站预订模板怎么做营销网站定制公司
  • 巩义旅游网站设计公司设计网站源代码
  • 做网站先做前台还是后台谷歌网站地图生成
  • 网站优化排名易下拉软件网店美工课本
  • 怎样把域名和做的网站连接不上大规模网站
  • dtcms网站开发订单详情页面设计
  • 网站建设个人工作总结扬州网络推广公司
  • 网站开发工具最好用昆明seo排名外包
  • 自己建的网站可以用笔记本做服务器吗软件开发培训学校哪的好
  • 天津建设网站安管人员成绩查询企业网站分类举例
  • 陕西有色建设有限公司网站格尔木有做网站的吗
  • 车陂手机网站建设电话弹幕网站开发难么
  • 北京城乡与建设厅官方网站查询wordpress设计菜单
  • 用html网站登录界面怎么做360建筑网撤销自己的简历怎么撤销
  • 外贸网站建设公司青岛宁波网站怎么建设
  • 装修网站官网甘肃网站建设