我可以使用 jasypt 使用 EncryptableProperties 加密和解密 .properties 文件中的凭据。既然我想使用我自己的算法或像“SHA-512”这样的算法,如何在 EncryptableProperties 中实现它?
有没有办法在 EncryptableProperties 上使用 ConfigurablePasswordEncryptor 或 StrongPasswordEncryptor 而不是我的 StringEncryptor 或 TextEncryptor。
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword("OrderMod");
Properties props = new EncryptableProperties(encryptor);
props.load(new FileInputStream("mime.properties"));
String password = props.getProperty("password");
System.out.println("password:: "+password);