SSLContext (Java SE 15 & JDK 15) (original) (raw)


public class SSLContext extends Object

Instances of this class represent a secure socket protocol implementation which acts as a factory for secure socket factories or SSLEngines. This class is initialized with an optional set of key and trust managers and source of secure random bytes.

Every implementation of the Java platform is required to support the following standard SSLContext protocol:

This protocol is described in the SSLContext section of the Java Security Standard Algorithm Names Specification. Consult the release documentation for your implementation to see if any other protocols are supported.

Since:

1.4

Constructors

Modifier Constructor Description
protected SSLContext​(SSLContextSpi contextSpi,Provider provider,String protocol) Creates an SSLContext object.
Modifier and Type Method Description
SSLEngine createSSLEngine() Creates a new SSLEngine using this context.
SSLEngine createSSLEngine​(String peerHost, int peerPort) Creates a new SSLEngine using this context using advisory peer information.
SSLSessionContext getClientSessionContext() Returns the client session context, which represents the set of SSL sessions available for use during the handshake phase of client-side SSL sockets.
static SSLContext getDefault() Returns the default SSL context.
SSLParameters getDefaultSSLParameters() Returns a copy of the SSLParameters indicating the default settings for this SSL context.
static SSLContext getInstance​(String protocol) Returns a SSLContext object that implements the specified secure socket protocol.
static SSLContext getInstance​(String protocol,String provider) Returns a SSLContext object that implements the specified secure socket protocol.
static SSLContext getInstance​(String protocol,Provider provider) Returns a SSLContext object that implements the specified secure socket protocol.
String getProtocol() Returns the protocol name of this SSLContext object.
Provider getProvider() Returns the provider of this SSLContext object.
SSLSessionContext getServerSessionContext() Returns the server session context, which represents the set of SSL sessions available for use during the handshake phase of server-side SSL sockets.
SSLServerSocketFactory getServerSocketFactory() Returns a ServerSocketFactory object for this context.
SSLSocketFactory getSocketFactory() Returns a SocketFactory object for this context.
SSLParameters getSupportedSSLParameters() Returns a copy of the SSLParameters indicating the supported settings for this SSL context.
void init​(KeyManager[] km,TrustManager[] tm,SecureRandom random) Initializes this context.
static void setDefault​(SSLContext context) Sets the default SSL context.

Methods declared in class java.lang.Object

[clone](../../../java/lang/Object.html#clone%28%29), [equals](../../../java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java/lang/Object.html#finalize%28%29), [getClass](../../../java/lang/Object.html#getClass%28%29), [hashCode](../../../java/lang/Object.html#hashCode%28%29), [notify](../../../java/lang/Object.html#notify%28%29), [notifyAll](../../../java/lang/Object.html#notifyAll%28%29), [toString](../../../java/lang/Object.html#toString%28%29), [wait](../../../java/lang/Object.html#wait%28%29), [wait](../../../java/lang/Object.html#wait%28long%29), [wait](../../../java/lang/Object.html#wait%28long,int%29)