made encryption much more general

This commit is contained in:
Lorenz Hohermuth 2025-05-16 16:51:08 +02:00
parent 2926b5a9f4
commit cfabd4e7ff
1 changed files with 0 additions and 16 deletions

View File

@ -39,22 +39,6 @@ public class EncryptUtil {
return decryptString(data, secretKey);
}
private String changeRelevantValues(JsonNode content, Function<String, String> encryptOrDecrypt) {
if (!content.isObject()) return null;
ObjectNode objContent = (ObjectNode) content;
String passwordTextValue = objContent.get("password").textValue();
objContent.put("password", encryptOrDecrypt.apply(passwordTextValue));
String userNameTextValue = objContent.get("userName").textValue();
objContent.put("userName", encryptOrDecrypt.apply(userNameTextValue));
String urlTextValue = objContent.get("url").textValue();
objContent.put("url", encryptOrDecrypt.apply(urlTextValue));
return objContent.toPrettyString();
}
public static String encryptString(String plainText, SecretKey key) {
try {