Skip to content

This project add support to jasypt-spring which utlize aws KMS for encrypt / decrypt

License

Notifications You must be signed in to change notification settings

mustangxu/jasypt-spring-aws-kms-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project add support to jasypt-spring utilizing aws KMS for encrypt / decrypt

CodeQL Qodana Maven Publish Maven Release snyk

Maven Central

Usage

  1. import lib in maven
<dependency>
    <groupId>com.jayxu</groupId>
    <artifactId>jasypt-spring-aws-kms-starter</artifactId>
    <version>{version}</version>
</dependency>
  1. define aws.kms.defaultKeyId in bootstrap config file, else the default Jasypt StringEncryptor will be used
  2. config aws aws_access_key_id, aws_secret_access_key, region properly according to this article
  3. you can use multiple keyIds in one project:
ENC(xxxxxxxxxx) // will use aws.kms.defaultKeyId to decrypt, same as ENC([${aws.kms.defaultKeyId}]xxxxxxxxxx)
ENC([another-key-id]xxxxxxxxxx) // will use another-key-id to decrypt

Tools

  1. start nacos-demo project as a spring boot project
  2. open htttp://localhost:8088/swagger-ui.html in browser
  3. the default-controller provides several tools for encrypt / decrypt by KMS (or default Jasypt StringEncryptor)