Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
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:

Constructor Summary

SSLContext(javax.net.ssl.SSLContextSpi ctxSpi, Provider provider, String protocol)

Create a new SSL context.

Method Summary

javax.net.ssl.SSLSessionContextgetClientSessionContext()

Returns the set of SSL contexts available for client connections.
static javax.net.ssl.SSLContextgetInstance(String protocol)

Get an instance of a context for the specified protocol from the first provider that implements it.
static javax.net.ssl.SSLContextgetInstance(String protocol, String provider)

Get an instance of a context for the specified protocol from the named provider.
static javax.net.ssl.SSLContextgetInstance(String protocol, Provider provider)

Get an instance of a context for the specified protocol from the specified provider.
StringgetProtocol()

Returns the protocol name of this context.
ProvidergetProvider()

Returns the provider of this implementation.
javax.net.ssl.SSLSessionContextgetServerSessionContext()

Returns the set of SSL contexts available for server connections.
javax.net.ssl.SSLServerSocketFactorygetServerSocketFactory()

Returns the factory for server SSL sockets.
javax.net.ssl.SSLSocketFactorygetSocketFactory()

Returns the factory for client SSL sockets.
voidinit(javax.net.ssl.KeyManager keyManagers, javax.net.ssl.TrustManager trustManagers, SecureRandom random)

Initializes this context and prepares it for producing socket factories.

Constructor Details

SSLContext

protected SSLContext(javax.net.ssl.SSLContextSpi ctxSpi, Provider provider, String protocol)

Create a new SSL context.

Parameters:


Method Details

getClientSessionContext

public final SSLSessionContext getClientSessionContext()

Returns the set of SSL contexts available for client connections.

Returns:


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:


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:


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:


getProtocol

public final String getProtocol()

Returns the protocol name of this context.

Returns:


getProvider

public final Provider getProvider()

Returns the provider of this implementation.

Returns:


getServerSessionContext

public final SSLSessionContext getServerSessionContext()

Returns the set of SSL contexts available for server connections.

Returns:


getServerSocketFactory

public final SSLServerSocketFactory getServerSocketFactory()

Returns the factory for server SSL sockets.

Returns:


getSocketFactory

public final SSLSocketFactory getSocketFactory()

Returns the factory for client SSL sockets.

Returns:


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: