Score
0
Watch 45 Star 140 Fork 50

憧憬Licoy / encrypt-body-spring-boot-starterJavaApache-2.0

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
SpringBoot控制器统一的响应体编码/加密与请求体解密的注解处理方式,支持MD5/SHA/AES/DES/RSA spread retract

Clone or download
Loading...
README_EN.md

简体中文 | English

This English document is translated by Google Translate. If you are willing to assist us with the documentation, please submit the relevant Pull Request.

Introduction

encrypt-body-spring-boot-starter it is a unified processing method for response body encryption and request body decryption of SpringBoot controller, and supports MD5/SHA/AES/DES/RSA.

Encryption and decryption support

  • There are ways to encrypt:
      • MD5
      • SHA-224 / 256 / 384 / 512
      • AES
      • DES
      • RSA
  • There are ways to decrypt:
      • AES
      • DES
      • RSA

Usage method

  • Introducing dependencies in pom.xml
<dependency>
    <groupId>cn.licoy</groupId>
    <artifactId>encrypt-body-spring-boot-starter</artifactId>
    <version>1.0.2.RELEASE</version>
</dependency>
  • Add the @EnableEncryptBody annotation to the Application class corresponding to the project, for example:
@EnableEncryptBody
@SpringBootApplication
public class Application {
    
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}
  • Parameter configuration Configure the parameters in the project's application.yml or application.properties file, for example:
encrypt:  
    body:
      aes-key: 12345678 #AES encryption key
      des-key: 12345678 #DES encryption key
  • Encrypt the controller response body
@Controller
@RequestMapping("/test")
public class TestController {

    @GetMapping
    @ResponseBody
    @EncryptBody(value = EncryptBodyMethod.AES)
    public String test(){
        return "hello world";
    }

}

Or use @RestController to encrypt the method response body of the entire controller:

@RestController
@EncryptBody
@RequestMapping("/test")
public class TestController {

    @GetMapping
    public String test(){
        return "hello world";
    }

}

Annotated list

Discuss

Open source agreement

Apache 2.0

Comments ( 7 )

Sign in for post a comment

Java
1
https://gitee.com/licoy/encrypt-body-spring-boot-starter.git
git@gitee.com:licoy/encrypt-body-spring-boot-starter.git
licoy
encrypt-body-spring-boot-starter
encrypt-body-spring-boot-starter
master

Help Search