# rest-crypto-spring-boot-starter **Repository Path**: wangzhiyong69/rest-crypto-spring-boot-starter ## Basic Information - **Project Name**: rest-crypto-spring-boot-starter - **Description**: SpringBoot快速集成Rest接口请求解密/响应加密,已发布到Maven中央仓库 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-20 - **Last Updated**: 2021-10-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # rest-crypto-spring-boot-starter #### 介绍 Rest Crypto for SpringBoot 快速集成Rest接口请求解密/响应加密 #### 使用说明 1. 导入POM依赖 ``` xml cn.amorou.rest.crypto rest-crypto-spring-boot-starter 最新版本 ``` 2. 为接口方法添加注解 ``` java import java.util.Map; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import cn.amorou.rest.crypto.annotation.RequestBodyDecrypt; import cn.amorou.rest.crypto.annotation.ResponseBodyEncrypt; @RestController public class TestController { @RequestBodyDecrypt //请求数据解密 @ResponseBodyEncrypt //响应数据加密 @RequestMapping("/") public Map index(@RequestBody(required = false) Map params) { System.out.println(params); return params; } } ``` #### 参数说明 |参数|名称|默认值|备注| |---|---|---|---| |**rest.crypto.algorithms**|加密算法,可选[AES]|AES|目前仅支持AES-CBC-128| |**rest.crypto.charset**|Crypto encoding|UTF-8|编码字符集| |**rest.crypto.aes-key**|AES加密密钥||必须| |**rest.crypto.aes-iv**|AES 向量,长度16位||必须|