diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherKeyStore.java b/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherKeyStore.java deleted file mode 100644 index fa3acb42..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherKeyStore.java +++ /dev/null @@ -1,19 +0,0 @@ -package pro.gravit.launcher.ssl; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; - -public class LauncherKeyStore { - public static KeyStore getKeyStore(String keystore, String password) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { - KeyStore ks = KeyStore.getInstance("JKS"); - try (InputStream ksIs = new FileInputStream(keystore)) { - ks.load(ksIs, password.toCharArray()); - } - return ks; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherSSLContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherSSLContext.java deleted file mode 100644 index 40439578..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherSSLContext.java +++ /dev/null @@ -1,42 +0,0 @@ -package pro.gravit.launcher.ssl; - -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.UnrecoverableKeyException; - -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLServerSocketFactory; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; - -public class LauncherSSLContext { - public SSLServerSocketFactory ssf; - public SSLSocketFactory sf; - - public LauncherSSLContext(KeyStore ks, String keypassword) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException, KeyManagementException { - TrustManager[] trustAllCerts = new TrustManager[]{ - new LauncherTrustManager() - }; - KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory - .getDefaultAlgorithm()); - kmf.init(ks, keypassword.toCharArray()); - SSLContext sc = SSLContext.getInstance("TLSv1.2"); - sc.init(kmf.getKeyManagers(), trustAllCerts, new SecureRandom()); - ssf = sc.getServerSocketFactory(); - sf = sc.getSocketFactory(); - } - - public LauncherSSLContext() throws NoSuchAlgorithmException, KeyManagementException { - TrustManager[] trustAllCerts = new TrustManager[]{ - new LauncherTrustManager() - }; - SSLContext sc = SSLContext.getInstance("TLSv1.2"); - sc.init(null, trustAllCerts, new SecureRandom()); - ssf = null; - sf = sc.getSocketFactory(); - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherTrustManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherTrustManager.java deleted file mode 100644 index 48389921..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/ssl/LauncherTrustManager.java +++ /dev/null @@ -1,15 +0,0 @@ -package pro.gravit.launcher.ssl; - -import javax.net.ssl.X509TrustManager; - -public class LauncherTrustManager implements X509TrustManager { - public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) { - } - - public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) { - } - - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return null; - } -}