[FIX] Deprecation warning

This commit is contained in:
Gravita 2021-10-15 21:29:26 +07:00
parent d9a8e161f1
commit 7d8975041f
2 changed files with 3 additions and 3 deletions

View file

@ -72,7 +72,7 @@ public static void main(String[] args) throws Exception {
{ {
LauncherTrustManager.CheckClassResult result = certificateManager.checkClass(LaunchServer.class); LauncherTrustManager.CheckClassResult result = certificateManager.checkClass(LaunchServer.class);
if (result.type == LauncherTrustManager.CheckClassResultType.SUCCESS) { if (result.type == LauncherTrustManager.CheckClassResultType.SUCCESS) {
logger.info("LaunchServer signed by {}", result.endCertificate.getSubjectDN().getName()); logger.info("LaunchServer signed by {}", result.endCertificate.getSubjectX500Principal().getName());
} else if (result.type == LauncherTrustManager.CheckClassResultType.NOT_SIGNED) { } else if (result.type == LauncherTrustManager.CheckClassResultType.NOT_SIGNED) {
// None // None
} else { } else {

View file

@ -47,11 +47,11 @@ public void invoke(String... args) {
private void printCheckStatusInfo(LauncherTrustManager.CheckClassResult checkStatus) { private void printCheckStatusInfo(LauncherTrustManager.CheckClassResult checkStatus) {
if (checkStatus != null && checkStatus.endCertificate != null) { if (checkStatus != null && checkStatus.endCertificate != null) {
X509Certificate cert = checkStatus.endCertificate; X509Certificate cert = checkStatus.endCertificate;
logger.info("[MODULE CERT] Module signer: {}", cert.getSubjectDN().getName()); logger.info("[MODULE CERT] Module signer: {}", cert.getSubjectX500Principal().getName());
} }
if (checkStatus != null && checkStatus.rootCertificate != null) { if (checkStatus != null && checkStatus.rootCertificate != null) {
X509Certificate cert = checkStatus.rootCertificate; X509Certificate cert = checkStatus.rootCertificate;
logger.info("[MODULE CERT] Module signer CA: {}", cert.getSubjectDN().getName()); logger.info("[MODULE CERT] Module signer CA: {}", cert.getSubjectX500Principal().getName());
} }
} }
} }