Package javax.net.ssl
Class SSLContextSpi
- java.lang.Object
-
- javax.net.ssl.SSLContextSpi
-
- Direct Known Subclasses:
OpenSSLContextImpl
public abstract class SSLContextSpi extends Object
The Service Provider Interface (SPI) for theSSLContextclass.
-
-
Constructor Summary
Constructors Constructor Description SSLContextSpi()Creates a newSSLContextSpiinstance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract SSLEngineengineCreateSSLEngine()Creates anSSLEngineinstance from this context.protected abstract SSLEngineengineCreateSSLEngine(String host, int port)Creates anSSLEngineinstance from this context with the specified hostname and port.protected abstract SSLSessionContextengineGetClientSessionContext()Returns the SSL session context that encapsulates the set of SSL sessions that can be used for the client side of the SSL handshake.protected SSLParametersengineGetDefaultSSLParameters()Returns a new SSLParameters instance that includes the default SSL handshake parameters values including cipher suites, protocols, and client authentication.protected abstract SSLSessionContextengineGetServerSessionContext()Returns the SSL session context that encapsulates the set of SSL sessions that can be used for the server side of the SSL handshake.protected abstract SSLServerSocketFactoryengineGetServerSocketFactory()Returns a server socket factory for this instance.protected abstract SSLSocketFactoryengineGetSocketFactory()Returns a socket factory for this instance.protected SSLParametersengineGetSupportedSSLParameters()Returns a new SSLParameters instance that includes all supported cipher suites and protocols.protected abstract voidengineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr)Initializes thisSSLContextinstance.
-
-
-
Method Detail
-
engineInit
protected abstract void engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr) throws KeyManagementException
Initializes thisSSLContextinstance. All of the arguments are optional, and the security providers will be searched for the required implementations of the needed algorithms.- Parameters:
km- the key sources ornull.tm- the trust decision sources ornull.sr- the randomness source ornull.- Throws:
KeyManagementException- if initializing this instance fails.
-
engineGetSocketFactory
protected abstract SSLSocketFactory engineGetSocketFactory()
Returns a socket factory for this instance.- Returns:
- a socket factory for this instance.
-
engineGetServerSocketFactory
protected abstract SSLServerSocketFactory engineGetServerSocketFactory()
Returns a server socket factory for this instance.- Returns:
- a server socket factory for this instance.
-
engineCreateSSLEngine
protected abstract SSLEngine engineCreateSSLEngine(String host, int port)
Creates anSSLEngineinstance from this context with the specified hostname and port.- Parameters:
host- the name of the hostport- the port- Returns:
- an
SSLEngineinstance from this context. - Throws:
UnsupportedOperationException- if the provider does not support the operation.
-
engineCreateSSLEngine
protected abstract SSLEngine engineCreateSSLEngine()
Creates anSSLEngineinstance from this context.- Returns:
- an
SSLEngineinstance from this context. - Throws:
UnsupportedOperationException- if the provider does not support the operation.
-
engineGetServerSessionContext
protected abstract SSLSessionContext engineGetServerSessionContext()
Returns the SSL session context that encapsulates the set of SSL sessions that can be used for the server side of the SSL handshake.- Returns:
- the SSL server session context for this context or
nullif the underlying provider does not provide an implementation of theSSLSessionContextinterface.
-
engineGetClientSessionContext
protected abstract SSLSessionContext engineGetClientSessionContext()
Returns the SSL session context that encapsulates the set of SSL sessions that can be used for the client side of the SSL handshake.- Returns:
- the SSL client session context for this context or
nullif the underlying provider does not provide an implementation of theSSLSessionContextinterface.
-
engineGetDefaultSSLParameters
protected SSLParameters engineGetDefaultSSLParameters()
Returns a new SSLParameters instance that includes the default SSL handshake parameters values including cipher suites, protocols, and client authentication.The default implementation returns an SSLParameters with values based an SSLSocket created from this instances SocketFactory.
- Since:
- 1.6
-
engineGetSupportedSSLParameters
protected SSLParameters engineGetSupportedSSLParameters()
Returns a new SSLParameters instance that includes all supported cipher suites and protocols.The default implementation returns an SSLParameters with values based an SSLSocket created from this instances SocketFactory.
- Since:
- 1.6
-
-