javax.net.ssl
Class SSLContext
java.lang.Object
|
+--javax.net.ssl.SSLContext
public class SSLContext
extends java.lang.Object
A "meta-factory" for protocol-specific socket and server socket
factories. This class serves as a clearinghouse for socket
factories and cached session contexts for a particular protocol,
such as SSLv3.
Author:- Casey Marshall (rsdio@metastatic.org)
SSLContext
protected SSLContext(javax.net.ssl.SSLContextSpi ctxSpi, Provider provider, String protocol)
Create a new SSL context.
Parameters:
getClientSessionContext
public final SSLSessionContext getClientSessionContext()
Returns the set of SSL contexts available for client connections.
Returns:
- The set of SSL contexts available for client connections.
getInstance
public static final SSLContext getInstance(String protocol)
Get an instance of a context for the specified protocol from the
first provider that implements it.
Parameters:
Returns:
Throws:
- If no provider implements the given
protocol.
getInstance
public static final SSLContext getInstance(String protocol, Provider provider)
Get an instance of a context for the specified protocol from the
specified provider.
Parameters:
Returns:
Throws:
- If the provider does not
implement the given protocol.
- If provider is null.
getInstance
public static final SSLContext getInstance(String protocol, String provider)
Get an instance of a context for the specified protocol from the
named provider.
Parameters:
Returns:
Throws:
- If the provider does not
implement the given protocol.
- If the named provider does not
exist.
- If provider is null.
getProtocol
public final String getProtocol()
Returns the protocol name of this context.
Returns:
- The protocol name of this context.
getProvider
public final Provider getProvider()
Returns the provider of this implementation.
Returns:
- The provider of this implementation.
getServerSessionContext
public final SSLSessionContext getServerSessionContext()
Returns the set of SSL contexts available for server connections.
Returns:
- The set of SSL contexts available for server connections.
getServerSocketFactory
public final SSLServerSocketFactory getServerSocketFactory()
Returns the factory for server SSL sockets.
Returns:
- The factory for server SSL sockets.
getSocketFactory
public final SSLSocketFactory getSocketFactory()
Returns the factory for client SSL sockets.
Returns:
- The factory for client SSL sockets.
init
public final void init(javax.net.ssl.KeyManager keyManagers, javax.net.ssl.TrustManager trustManagers, SecureRandom random)
Initializes this context and prepares it for producing socket
factories. All of the parameters are optional; default values are
used if left unspecified.
Parameters:
Throws:
- If initialization fails.