|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.gv.egovernment.moa.util.SSLUtils
Utility for connecting to server applications via SSL.
Constructor Summary | |
SSLUtils()
|
Method Summary | |
static com.sun.net.ssl.KeyManager[] |
getKeyManagers(KeyStore clientKeyStore,
String clientKeyStorePassword)
Gets the KeyManager s from a default KeyManagerFactory ,
initialized from the given client key store. |
static com.sun.net.ssl.KeyManager[] |
getKeyManagers(String clientKeyStoreType,
String clientKeyStoreURL,
String clientKeyStorePassword)
Loads the client key store from file and gets the KeyManager s from a default KeyManagerFactory ,
initialized from the given client key store. |
static com.sun.net.ssl.SSLContext |
getSSLContext(KeyStore trustStore,
String clientKeyStoreType,
String clientKeyStoreURL,
String clientKeyStorePassword)
Creates an SSLContext initialized for the
given trust store and keystore. |
static javax.net.ssl.SSLSocketFactory |
getSSLSocketFactory(KeyStore trustStore,
String clientKeyStoreType,
String clientKeyStoreURL,
String clientKeyStorePassword)
Creates an SSLSocketFactory which utilizes the
given trust store and keystore. |
static javax.net.ssl.SSLSocketFactory |
getSSLSocketFactory(String trustStoreType,
InputStream trustStoreInputStream,
String trustStorePassword)
Creates an SSLSocketFactory which utilizes the given trust store. |
protected static com.sun.net.ssl.TrustManager[] |
getTrustManagers(KeyStore trustStore)
Gets the TrustManager s from a default TrustManagerFactory ,
initialized from the given trust store. |
protected static com.sun.net.ssl.TrustManager[] |
getTrustManagers(String trustStoreType,
InputStream trustStoreInputStream,
String trustStorePassword)
Loads the trust store from an input stream and gets the TrustManager s from a default TrustManagerFactory ,
initialized from the given trust store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SSLUtils()
Method Detail |
public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(String trustStoreType, InputStream trustStoreInputStream, String trustStorePassword) throws IOException, GeneralSecurityException
SSLSocketFactory
which utilizes the given trust store.trustStoreType
- key store type of trust storetrustStoreInputStream
- input stream for reading JKS trust store containing
trusted server certificates; if null
, the default
trust store will be utilizedtrustStorePassword
- if provided, it will be used to check
the integrity of the trust store; if omitted, it will not be checkedSSLSocketFactory
to be used by an HttpsURLConnection
IOException
- thrown while reading from the input streamGeneralSecurityException
- thrown while creating the socket factorypublic static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(KeyStore trustStore, String clientKeyStoreType, String clientKeyStoreURL, String clientKeyStorePassword) throws IOException, GeneralSecurityException
SSLSocketFactory
which utilizes the
given trust store and keystore.trustStore
- trust store containing trusted server certificates;
if null
, the default trust store will be utilizedclientKeyStoreType
- key store type of clientKeyStore
clientKeyStoreURL
- URL of key store containing keys to be used for
client authentication; if null
, the default key store will be utilizedclientKeyStorePassword
- if provided, it will be used to check
the integrity of the client key store; if omitted, it will not be checkedSSLSocketFactory
to be used by an HttpsURLConnection
IOException
- thrown while reading key store fileGeneralSecurityException
- thrown while creating the socket factorypublic static com.sun.net.ssl.SSLContext getSSLContext(KeyStore trustStore, String clientKeyStoreType, String clientKeyStoreURL, String clientKeyStorePassword) throws IOException, GeneralSecurityException
SSLContext
initialized for the
given trust store and keystore.trustStore
- trust store containing trusted server certificates;
if null
, the default trust store will be utilizedclientKeyStoreType
- key store type of clientKeyStore
clientKeyStoreURL
- URL of key store containing keys to be used for
client authentication; if null
, the default key store will be utilizedclientKeyStorePassword
- if provided, it will be used to check
the integrity of the client key store; if omitted, it will not be checkedSSLContext
to be used for creating an SSLSocketFactory
IOException
- thrown while reading key store fileGeneralSecurityException
- thrown while creating the SSL contextprotected static com.sun.net.ssl.TrustManager[] getTrustManagers(String trustStoreType, InputStream trustStoreInputStream, String trustStorePassword) throws IOException, GeneralSecurityException
TrustManager
s from a default TrustManagerFactory
,
initialized from the given trust store.trustStoreType
- key store type of trust storetrustStoreInputStream
- input stream for reading JKS trust store containing
trusted server certificates; if null
, the default
trust store will be utilizedtrustStorePassword
- if provided, it will be used to check
the integrity of the trust store; if omitted, it will not be checkedTrustManager
s to be used for creating an
SSLSocketFactory
utilizing the given trust storeIOException
- thrown while reading from the input streamGeneralSecurityException
- thrown while initializing the
default TrustManagerFactory
protected static com.sun.net.ssl.TrustManager[] getTrustManagers(KeyStore trustStore) throws GeneralSecurityException
TrustManager
s from a default TrustManagerFactory
,
initialized from the given trust store.trustStore
- the trust store to usetrustStorePassword
- password protecting the given trust storeTrustManager
s to be used for creating an
SSLSocketFactory
utilizing the given trust storeGeneralSecurityException
- thrown while initializing the
default TrustManagerFactory
public static com.sun.net.ssl.KeyManager[] getKeyManagers(String clientKeyStoreType, String clientKeyStoreURL, String clientKeyStorePassword) throws IOException, GeneralSecurityException
KeyManager
s from a default KeyManagerFactory
,
initialized from the given client key store.clientKeyStoreType
- key store type of clientKeyStore
clientKeyStoreURL
- URL of key store containing keys to be used for
client authentication; if null
, the default key store will be utilizedclientKeyStorePassword
- password used to check the integrity of the client key store;
if null
, it will not be checkedKeyManager
s to be used for creating an
SSLSocketFactory
utilizing the given client key storeIOException
- thrown while reading from the key store fileGeneralSecurityException
- thrown while initializing the
default KeyManagerFactory
public static com.sun.net.ssl.KeyManager[] getKeyManagers(KeyStore clientKeyStore, String clientKeyStorePassword) throws GeneralSecurityException
KeyManager
s from a default KeyManagerFactory
,
initialized from the given client key store.clientKeyStore
- client key storeclientKeyStorePassword
- if provided, it will be used to check
the integrity of the client key store; if omitted, it will not be checkedKeyManager
s to be used for creating an
SSLSocketFactory
utilizing the given client key storeGeneralSecurityException
- thrown while initializing the
default KeyManagerFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |