Skip to content

Latest commit

 

History

History

spring-boot-encrypt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Purpose

演示如何结合jasypt-spring-boot实现Apollo中存储加密配置

Instructions

  1. 在Apollo配置中心创建AppId为spring-boot-encrypt的项目

  2. 在默认的application下做如下配置(可以通过文本模式直接复制、粘贴下面的内容):

    jasypt.encryptor.password = klklklklklklklkl
    test.input = ENC(Ore69lUopDHL5R8Bw/G3bQ==)
    test.input1 = ckl
  3. 运行com.ctrip.framework.apollo.use.cases.spring.boot.encrypt.Application启动Demo

  4. 程序会输出解密后的明文配置

  5. 使用EncryptUtil小工具输出加密后的配置,加解密的keyjasypt.encryptor.password自己指定,添加配置时使用ENC()包含配置,如加密配置为xxx,则ENC(xxx)