Jasypt Spring BootSpring Boot 項目屬性源加密
Jasypt Spring Boot 為 Spring Boot 項目中的屬性源(property sources)提供加密支持。
有三種方法可以在項目中集成 jasypt-spring-boot:
如果 Spring Boot 項目中使用了 @SpringBootApplication 或者 @EnableAutoConfiguration ,在項目里添加jasypt-spring-boot-starter 依賴會自動對項目中整個屬性(包括系統屬性、環(huán)境屬性、命令行參數、application.properties, yaml)啟動加密。
如果項目里沒有使用 @SpringBootApplication 或者 @EnableAutoConfiguration ,可以手動在 Configuration 類上添加注解 @EnableEncryptableProperties ,來在整個環(huán)境的屬性啟用屬性加密。
如果想指定加密文件,可以使用 @EncryptablePropertySource 指定單個屬性源。
評論
圖片
表情
