jlibs.core.net
Class SSLUtil

java.lang.Object
  extended by jlibs.core.net.SSLUtil

public class SSLUtil
extends Object

Author:
Santhosh Kumar Tekuti

Field Summary
static TrustManager[] DUMMY_TRUST_MANAGERS
           
 
Constructor Summary
SSLUtil()
           
 
Method Summary
static SSLContext defaultContext()
           
static KeyStore defaultKeyStore()
           
static KeyStore defaultTrustStore()
           
static String getKeyStoreLocation()
           
static char[] getKeyStorePassword()
           
static String getKeyStoreType()
           
static String getTrustStoreLocation()
           
static char[] getTrustStorePassword()
           
static String getTrustStoreType()
           
static X509Certificate[] getX509CertificateChain(String host, int port)
           
static boolean isClientHello(byte firstByte)
           
static SSLContext newContext(KeyStore keyStore, char[] keyStorePassword, String keyAlias, KeyStore trustStore)
           
static KeyStore newKeyStore(String type, String file, char[] password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMMY_TRUST_MANAGERS

public static final TrustManager[] DUMMY_TRUST_MANAGERS
Constructor Detail

SSLUtil

public SSLUtil()
Method Detail

isClientHello

public static boolean isClientHello(byte firstByte)

getX509CertificateChain

public static X509Certificate[] getX509CertificateChain(String host,
                                                        int port)
                                                 throws GeneralSecurityException,
                                                        IOException
Throws:
GeneralSecurityException
IOException

newKeyStore

public static KeyStore newKeyStore(String type,
                                   String file,
                                   char[] password)
                            throws SSLException
Throws:
SSLException

getKeyStoreType

public static String getKeyStoreType()

getKeyStoreLocation

public static String getKeyStoreLocation()

getKeyStorePassword

public static char[] getKeyStorePassword()

defaultKeyStore

public static KeyStore defaultKeyStore()
                                throws SSLException
Throws:
SSLException

getTrustStoreType

public static String getTrustStoreType()

getTrustStoreLocation

public static String getTrustStoreLocation()

getTrustStorePassword

public static char[] getTrustStorePassword()

defaultTrustStore

public static KeyStore defaultTrustStore()
                                  throws SSLException
Throws:
SSLException

newContext

public static SSLContext newContext(KeyStore keyStore,
                                    char[] keyStorePassword,
                                    String keyAlias,
                                    KeyStore trustStore)
                             throws SSLException,
                                    GeneralSecurityException
Throws:
SSLException
GeneralSecurityException

defaultContext

public static SSLContext defaultContext()
                                 throws SSLException,
                                        GeneralSecurityException
Throws:
SSLException
GeneralSecurityException


Copyright © 2018. All rights reserved.