引用代码库
<dependency><groupId>com.github.ulisesbocchio</groupId><artifactId>jasypt-spring-boot-starter</artifactId><version>3.0.5</version></dependency>
配置启动
@EnableEncryptableProperties
public class CephS3TransferApplication {
配置文件
jasypt:encryptor:algorithm: PBEWithMD5AndDESpassword: 1111111iv-generator-classname: org.jasypt.iv.NoIvGenerator # 一定要配置不然报错
Failed to bind properties under 'key' to java.lang.String:
Reason: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.datasource.password' to java.lang.String
Unable to decrypt property: ENC(LPlBnj/3sx) resolved to: ENC(LPlBnj/xx==). Decryption of Properties failed, make sure encryption/decryption passwords match