com.ibm.net.ssl
Class SSLContext

java.lang.Object
  |
  +--com.ibm.net.ssl.SSLContext

public class SSLContext
extends java.lang.Object


Method Summary
static SSLContext getInstance(java.lang.String protocol)
          Generates a SSLContext object that implements the specified secure socket protocol.
static SSLContext getInstance(java.lang.String protocol, java.lang.String provider)
          Generates a SSLContext object that implements the specified secure socket protocol.
 java.lang.String getProtocol()
          Returns the protocol name of this SSLContext object.
 java.security.Provider getProvider()
          Returns the provider of this SSLContext object.
 SSLServerSocketFactory getServerSocketFactory()
          Returns a ServerSocketFactory object for this context.
 SSLSocketFactory getSocketFactory()
          Returns a SocketFactory object for this context.
 void init(KeyManager[] km, TrustManager[] tm, java.security.SecureRandom random)
          Initializes this context.
 void init(java.lang.String tokenType, java.lang.String token, java.lang.String password)
          Initializes this context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SSLContext getInstance(java.lang.String protocol)
                              throws java.security.NoSuchAlgorithmException
Generates a SSLContext object that implements the specified secure socket protocol.
Parameters:
protocol - the standard name of the requested protocol.
Returns:
the new SSLContext object
Throws:
java.security.NoSuchAlgorithmException - if the specified protocol is not available in the default provider package or any of the other provider packages that were searched.

getInstance

public static SSLContext getInstance(java.lang.String protocol,
                                     java.lang.String provider)
                              throws java.security.NoSuchAlgorithmException,
                                     java.security.NoSuchProviderException
Generates a SSLContext object that implements the specified secure socket protocol.
Parameters:
protocol - the standard name of the requested protocol.
provider - the name of the provider
Returns:
the new SSLContext object
Throws:
java.security.NoSuchAlgorithmException - if the specified protocol is not available from the specified provider.
java.security.NoSuchProviderException - if the specified provider has not been configured.

getProtocol

public final java.lang.String getProtocol()
Returns the protocol name of this SSLContext object.

This is the same name that was specified in one of the getInstance calls that created this SSLContext object.

Returns:
the protocol name of this SSLContext object.

getProvider

public final java.security.Provider getProvider()
Returns the provider of this SSLContext object.
Returns:
the provider of this SSLContext object.

init

public final void init(KeyManager[] km,
                       TrustManager[] tm,
                       java.security.SecureRandom random)
                throws java.security.KeyManagementException
Initializes this context.
Parameters:
km - the sources of authentication keys
tm - the sources of peer authentication trust decisions
random - the source of randomness for this generator

init

public final void init(java.lang.String tokenType,
                       java.lang.String token,
                       java.lang.String password)
                throws java.security.KeyManagementException
Initializes this context. This method can be called several times to use multiple secure tokens containing certificates, keys, and CRLs in a SSLContext. A secure token can be protected by a password.
Parameters:
tokenType - the type of the token. The following types are supported: PKCS#7, PKCS#11, PKCS#12, MSCAPI(only on Windows platforms).
token - the token. The token specifies the file name for PKCS#7, PKCS#12 tokens and the library name for PKCS#11, MSCAPI tokens.
password - the password to unlock a protected token, null otherwise.

getSocketFactory

public final SSLSocketFactory getSocketFactory()
Returns a SocketFactory object for this context.
Returns:
the factory

getServerSocketFactory

public final SSLServerSocketFactory getServerSocketFactory()
Returns a ServerSocketFactory object for this context.
Returns:
the factory