diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java index 22204cf1..e65b913d 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java @@ -7,6 +7,7 @@ import java.lang.management.RuntimeMXBean; import java.net.MalformedURLException; import java.net.URL; +import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.Collection; import java.util.Locale; @@ -110,6 +111,13 @@ public static URL[] getClassPathURL() { return list; } + public static X509Certificate[] getCertificates(Class clazz) + { + Object[] signers = clazz.getSigners(); + if(signers == null) return new X509Certificate[] {}; + return Arrays.stream(signers).filter((c) -> c instanceof X509Certificate).map((c) -> (X509Certificate) c).toArray(X509Certificate[]::new); + } + public static void checkStackTrace(Class mainClass) { LogHelper.debug("Testing stacktrace"); Exception e = new Exception("Testing stacktrace");