From ece7d18cf35374bf4e26d041799cda8f791c89f8 Mon Sep 17 00:00:00 2001 From: gregor Date: Mon, 7 Jul 2003 10:58:37 +0000 Subject: Initial commit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@2 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../at/gv/egovernment/moa/util/SSLUtils.html | 408 +++++++++++++++++++++ 1 file changed, 408 insertions(+) create mode 100644 spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/SSLUtils.html (limited to 'spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/SSLUtils.html') diff --git a/spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/SSLUtils.html b/spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/SSLUtils.html new file mode 100644 index 000000000..252e1a08f --- /dev/null +++ b/spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/SSLUtils.html @@ -0,0 +1,408 @@ + + + + + + +MOA SP/SS Server Internal API: Class SSLUtils + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.util +
+Class SSLUtils

+
+java.lang.Object
+  |
+  +--at.gv.egovernment.moa.util.SSLUtils
+
+
+
+
public class SSLUtils
extends Object
+ +

+Utility for connecting to server applications via SSL. +

+

+
Version:
$Id$
+
Author:
Paul Ivancsics
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
SSLUtils() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static com.sun.net.ssl.KeyManager[]getKeyManagers(KeyStore clientKeyStore, + String clientKeyStorePassword) + +
+          Gets the KeyManagers 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 + KeyManagers from a default KeyManagerFactory, + initialized from the given client key store.
+static com.sun.net.ssl.SSLContextgetSSLContext(KeyStore trustStore, + String clientKeyStoreType, + String clientKeyStoreURL, + String clientKeyStorePassword) + +
+          Creates an SSLContext initialized for the + given trust store and keystore.
+static javax.net.ssl.SSLSocketFactorygetSSLSocketFactory(KeyStore trustStore, + String clientKeyStoreType, + String clientKeyStoreURL, + String clientKeyStorePassword) + +
+          Creates an SSLSocketFactory which utilizes the + given trust store and keystore.
+static javax.net.ssl.SSLSocketFactorygetSSLSocketFactory(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 TrustManagers 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 + TrustManagers 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
+ +

+SSLUtils

+
+public SSLUtils()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSSLSocketFactory

+
+public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(String trustStoreType,
+                                                                 InputStream trustStoreInputStream,
+                                                                 String trustStorePassword)
+                                                          throws IOException,
+                                                                 GeneralSecurityException
+
+
Creates an SSLSocketFactory which utilizes the given trust store.
+
Parameters:
trustStoreType - key store type of trust store
trustStoreInputStream - input stream for reading JKS trust store containing + trusted server certificates; if null, the default + trust store will be utilized
trustStorePassword - if provided, it will be used to check + the integrity of the trust store; if omitted, it will not be checked
Returns:
SSLSocketFactory to be used by an HttpsURLConnection
Throws:
IOException - thrown while reading from the input stream
GeneralSecurityException - thrown while creating the socket factory
+
+
+
+ +

+getSSLSocketFactory

+
+public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(KeyStore trustStore,
+                                                                 String clientKeyStoreType,
+                                                                 String clientKeyStoreURL,
+                                                                 String clientKeyStorePassword)
+                                                          throws IOException,
+                                                                 GeneralSecurityException
+
+
Creates an SSLSocketFactory which utilizes the + given trust store and keystore.
+
Parameters:
trustStore - trust store containing trusted server certificates; + if null, the default trust store will be utilized
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 utilized
clientKeyStorePassword - if provided, it will be used to check + the integrity of the client key store; if omitted, it will not be checked
Returns:
SSLSocketFactory to be used by an HttpsURLConnection
Throws:
IOException - thrown while reading key store file
GeneralSecurityException - thrown while creating the socket factory
+
+
+
+ +

+getSSLContext

+
+public static com.sun.net.ssl.SSLContext getSSLContext(KeyStore trustStore,
+                                                       String clientKeyStoreType,
+                                                       String clientKeyStoreURL,
+                                                       String clientKeyStorePassword)
+                                                throws IOException,
+                                                       GeneralSecurityException
+
+
Creates an SSLContext initialized for the + given trust store and keystore.
+
Parameters:
trustStore - trust store containing trusted server certificates; + if null, the default trust store will be utilized
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 utilized
clientKeyStorePassword - if provided, it will be used to check + the integrity of the client key store; if omitted, it will not be checked
Returns:
SSLContext to be used for creating an SSLSocketFactory
Throws:
IOException - thrown while reading key store file
GeneralSecurityException - thrown while creating the SSL context
+
+
+
+ +

+getTrustManagers

+
+protected static com.sun.net.ssl.TrustManager[] getTrustManagers(String trustStoreType,
+                                                                 InputStream trustStoreInputStream,
+                                                                 String trustStorePassword)
+                                                          throws IOException,
+                                                                 GeneralSecurityException
+
+
Loads the trust store from an input stream and gets the + TrustManagers from a default TrustManagerFactory, + initialized from the given trust store.
+
Parameters:
trustStoreType - key store type of trust store
trustStoreInputStream - input stream for reading JKS trust store containing + trusted server certificates; if null, the default + trust store will be utilized
trustStorePassword - if provided, it will be used to check + the integrity of the trust store; if omitted, it will not be checked
Returns:
TrustManagers to be used for creating an + SSLSocketFactory utilizing the given trust store
Throws:
IOException - thrown while reading from the input stream
GeneralSecurityException - thrown while initializing the + default TrustManagerFactory
+
+
+
+ +

+getTrustManagers

+
+protected static com.sun.net.ssl.TrustManager[] getTrustManagers(KeyStore trustStore)
+                                                          throws GeneralSecurityException
+
+
Gets the TrustManagers from a default TrustManagerFactory, + initialized from the given trust store.
+
Parameters:
trustStore - the trust store to use
trustStorePassword - password protecting the given trust store
Returns:
TrustManagers to be used for creating an + SSLSocketFactory utilizing the given trust store
Throws:
GeneralSecurityException - thrown while initializing the + default TrustManagerFactory
+
+
+
+ +

+getKeyManagers

+
+public static com.sun.net.ssl.KeyManager[] getKeyManagers(String clientKeyStoreType,
+                                                          String clientKeyStoreURL,
+                                                          String clientKeyStorePassword)
+                                                   throws IOException,
+                                                          GeneralSecurityException
+
+
Loads the client key store from file and gets the + KeyManagers from a default KeyManagerFactory, + initialized from the given client key store.
+
Parameters:
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 utilized
clientKeyStorePassword - password used to check the integrity of the client key store; + if null, it will not be checked
Returns:
KeyManagers to be used for creating an + SSLSocketFactory utilizing the given client key store
Throws:
IOException - thrown while reading from the key store file
GeneralSecurityException - thrown while initializing the + default KeyManagerFactory
+
+
+
+ +

+getKeyManagers

+
+public static com.sun.net.ssl.KeyManager[] getKeyManagers(KeyStore clientKeyStore,
+                                                          String clientKeyStorePassword)
+                                                   throws GeneralSecurityException
+
+
Gets the KeyManagers from a default KeyManagerFactory, + initialized from the given client key store.
+
Parameters:
clientKeyStore - client key store
clientKeyStorePassword - if provided, it will be used to check + the integrity of the client key store; if omitted, it will not be checked
Returns:
KeyManagers to be used for creating an + SSLSocketFactory utilizing the given client key store
Throws:
GeneralSecurityException - thrown while initializing the + default KeyManagerFactory
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + -- cgit v1.2.3