From f78bb44ad1e658ab90a4525f1306acf7c7dc2ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berenguel?= Date: Fri, 27 Oct 2023 14:30:23 -0300 Subject: [PATCH] #1855: installs the AmazonCorrettoCryptoProvider if it is available --- .../src/main/java/iped/engine/core/Manager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/iped-engine/src/main/java/iped/engine/core/Manager.java b/iped-engine/src/main/java/iped/engine/core/Manager.java index b3afd9c432..e155967812 100644 --- a/iped-engine/src/main/java/iped/engine/core/Manager.java +++ b/iped-engine/src/main/java/iped/engine/core/Manager.java @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Method; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -158,6 +159,16 @@ public class Manager { private static final String appWinExeFileName = "IPED-SearchApp.exe"; static { + + // installs the AmazonCorrettoCryptoProvider if it is available + try { + Class clazz = Class.forName("com.amazon.corretto.crypto.provider.AmazonCorrettoCryptoProvider"); + Method method = clazz.getMethod("install"); + method.invoke(null); + } catch (Exception e) { + LOGGER.debug("AmazonCorrettoCryptoProvider not installed", e); + } + if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { Security.addProvider(new BouncyCastleProvider()); }