这个组件可以对参数,返回值进行加解密,目前支持 RSA 非对称加解密,AES 对称加解密,
以及对参数防篡改签名 + body AES 对称加解密的综合加密方式。
使用简单,引用jar
<dependency>
<groupId>io.gitee.itxinmeng</groupId>
<artifactId>mx-encrypt-spring-boot-starter</artifactId>
<version>1.0.2</version>
</dependency>
application.yml 配制加密方式
custom:
encrypt:
method: AES #加密方法【支持AES,RSA,SIGN_AND_AES】
secret: passwordapp08954 #AES密钥
添加注解,对接口进行加解密
@Decrypt
@Encrypt
@RequestMapping("/encrypt")
public AjaxResult encrypt(@RequestBody JSONObject req){
log.info("decrypt params:({})",req);
return AjaxResult.success();
}