Jasypt Spring Boot 为 Spring Boot 项目中的属性源(property sources)提供加密支持。
有三种方法可以在项目中集成 jasypt-spring-boot:
-
如果 Spring Boot 项目中使用了 @SpringBootApplication 或者 @EnableAutoConfiguration ,在项目里添加 jasypt-spring-boot-starter 依赖会自动对项目中整个属性(包括系统属性、环境属性、命令行参数、application.properties, YAML)启动加密。
-
如果项目里没有使用 @SpringBootApplication 或者 @EnableAutoConfiguration ,可以手动在 Configuration 类上添加注解 @EnableEncryptableProperties ,来在整个环境的属性启用属性加密。
-
如果想指定加密文件,可以使用 @EncryptablePropertySource 指定单个属性源。
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>${jasypt.version}</version>
</dependency>
JasyptSpringBoot为SpringBoot项目提供属性源加密支持,通过三种方式集成:添加依赖自动配置、手动添加注解@EnableEncryptableProperties或使用@EncryptablePropertySource指定加密文件。
957

被折叠的 条评论
为什么被折叠?



