From c803494779af92c8f70b224e7abdb95e1729b977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Kr=C3=A1l?= Date: Mon, 15 Jun 2020 11:37:07 +0200 Subject: [PATCH] Decrypt AES method made visible (#2003) Signed-off-by: David Kral --- .../java/io/helidon/config/encryption/EncryptionUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/encryption/src/main/java/io/helidon/config/encryption/EncryptionUtil.java b/config/encryption/src/main/java/io/helidon/config/encryption/EncryptionUtil.java index 7ac4fa9a3..dca0dff6c 100644 --- a/config/encryption/src/main/java/io/helidon/config/encryption/EncryptionUtil.java +++ b/config/encryption/src/main/java/io/helidon/config/encryption/EncryptionUtil.java @@ -201,13 +201,14 @@ public final class EncryptionUtil { } /** - * + * Decrypt using legacy AES. + * Will only decrypt messages encrypted with previously used AES method. * * @param masterPassword master password * @param encryptedBase64 encrypted secret, base64 encoded * @return Decrypted secret */ - static String decryptAesLegacy(char[] masterPassword, String encryptedBase64) { + public static String decryptAesLegacy(char[] masterPassword, String encryptedBase64) { Objects.requireNonNull(masterPassword, "Password must be provided for encryption"); Objects.requireNonNull(encryptedBase64, "Encrypted bytes must be provided for decryption (base64 encoded)"); @@ -248,7 +249,7 @@ public final class EncryptionUtil { * @return Decrypted secret * @throws ConfigEncryptionException if something bad happens during decryption (e.g. wrong password) */ - static String decryptAes(char[] masterPassword, String encryptedBase64) throws ConfigEncryptionException { + public static String decryptAes(char[] masterPassword, String encryptedBase64) throws ConfigEncryptionException { Objects.requireNonNull(masterPassword, "Password must be provided for encryption"); Objects.requireNonNull(encryptedBase64, "Encrypted bytes must be provided for decryption (base64 encoded)");