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

张家界做网站简单网站设计模板

张家界做网站,简单网站设计模板,齐家网装修平台,做团购网站商品从哪里找文章目录 一、介绍二、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配置jasyptStringEncryptor3、配置文件使用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依赖 dependencygroupIdorg.jasypt/groupIdartifactIdjasypt-spring31/artifactIdversion1.9.3/version /dependency dependencygroupIdorg.jasypt/groupIdartifactIdjasypt/artifactIdversion1.9.3/version /dependency2、application.xml的配置 bean idenvironmentVariablesConfigurationclassorg.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig!--加密方法--property namealgorithm valuePBEWithMD5AndDES /!--密码--property namepassword valuemysqlPwd /!-- 如果想获得系统环境变量 --!-- property namepassword value#{systemEnvironment[ENV_VARIABLE_NAME]}/ -- /bean !-- 配置加密器将用于解密 -- bean idconfigurationEncryptor classorg.jasypt.encryption.pbe.StandardPBEStringEncryptorproperty nameconfig refenvironmentVariablesConfiguration / /bean !--jasypt扫描配置文件对配置文件里加密数据进行解密-- bean idpropertyConfigurer classorg.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurerconstructor-arg refconfigurationEncryptor /property namelocationslistvalueclasspath:myconfig.properties/valuevalueclasspath:application.properties/value/list/property /bean !--给bean的属性解密并赋值-- bean idmyBean classcom.example.MyBeanproperty namepwd value${datasource.username}/property nameuser value${datasource.password}/ /bean3、配置文件使用 使用 ENC(密文) datasource.driver_classcom.mysql.jdbc.Driver datasource.urljdbc:mysql://localhost:3306/mydatabase datasource.usernameENC(aXZJTKwF6Vt147qUJOrMuT3NDV4y0NzG) datasource.passwordENC(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 -- dependencygroupIdcom.github.ulisesbocchio/groupIdartifactIdjasypt-spring-boot-starter/artifactIdversion3.0.5/version /dependency2、 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_classcom.mysql.jdbc.Driver datasource.urljdbc:mysql://localhost:3306/mydatabase datasource.usernameENC(aXZJTKwF6Vt147qUJOrMuT3NDV4y0NzG) datasource.passwordENC(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://www.hkea.cn/news/14333882/

相关文章:

  • 青岛做网站需要多少钱正邦设计电话
  • 河北邯郸建网站360建筑网的内容百度可以查到吗
  • 网站防止攻击10种禁用免费app
  • 建设软件资源网站做特产的网站的分析
  • 网站做曲线的源代码岳阳公司做网站
  • 网站发布到互联网上的步骤手机网站左右滑动效果
  • 给我做网站的人老是给我留点尾巴最近10个新闻
  • 网站后台支持的字体网页制作步骤是什么
  • 外卖网站怎么做销量无货源网店哪个平台好
  • 关键词 优化 网站网站没更新
  • 自己做网站怎么搜索图文制作app
  • 用ipad写wordpress昆山网站优化
  • 学校网站建设新闻做知识付费哪个平台好做
  • 什么网站 是cms系统下载门户网站开发是什么
  • 网站更新 缓存星子网
  • 做赚钱问卷调查的网站好无水印logo在线制作免费
  • 肇庆建设局网站网络服务商网站
  • 网站建设包六个网站及app开发招聘
  • 阜宁网站制作服务商如何建网站卖东西
  • 阿里巴巴国际站入驻费用企业邮箱怎么看
  • 网站域名申请怎么做香奈儿网站建设目标
  • 网站怎么挣钱昭通市网站建设
  • 做冻品海鲜比较大的网站有哪些2021最新免费的推广引流软件
  • 南通网站建设公司哪个好国内网页加速器
  • 营销型网站规划步骤软件工程师证书报考网站
  • 淮安市建设局网站首页seo优化厂商
  • 外卖网站建设的策划书企业名称自主申报
  • 建筑网站制作wordpress 营销页面
  • 网站建设培训总结做网站要多少钱联系方式
  • 网站模板图片网站设置密码进入