Package org.conscrypt
Class OpenSSLContextImpl
- java.lang.Object
-
- javax.net.ssl.SSLContextSpi
-
- org.conscrypt.OpenSSLContextImpl
-
- Direct Known Subclasses:
DefaultSSLContextImpl,OpenSSLContextImpl.SSLv3,OpenSSLContextImpl.TLSv1,OpenSSLContextImpl.TLSv11,OpenSSLContextImpl.TLSv12
public class OpenSSLContextImpl extends SSLContextSpi
OpenSSL-backed SSLContext service provider interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenSSLContextImpl.SSLv3static classOpenSSLContextImpl.TLSv1static classOpenSSLContextImpl.TLSv11static classOpenSSLContextImpl.TLSv12
-
Field Summary
Fields Modifier and Type Field Description protected SSLParametersImplsslParameters
-
Constructor Summary
Constructors Modifier Constructor Description protectedOpenSSLContextImpl()Constuctor for the DefaultSSLContextImpl.protectedOpenSSLContextImpl(String[] algorithms)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SSLEngineengineCreateSSLEngine()Creates anSSLEngineinstance from this context.SSLEngineengineCreateSSLEngine(String host, int port)Creates anSSLEngineinstance from this context with the specified hostname and port.ClientSessionContextengineGetClientSessionContext()Returns the SSL session context that encapsulates the set of SSL sessions that can be used for the client side of the SSL handshake.ServerSessionContextengineGetServerSessionContext()Returns the SSL session context that encapsulates the set of SSL sessions that can be used for the server side of the SSL handshake.SSLServerSocketFactoryengineGetServerSocketFactory()Returns a server socket factory for this instance.SSLSocketFactoryengineGetSocketFactory()Returns a socket factory for this instance.voidengineInit(KeyManager[] kms, TrustManager[] tms, SecureRandom sr)Initializes thisSSLContextinstance.static OpenSSLContextImplgetPreferred()Allows outside callers to get the preferred SSLContext.-
Methods inherited from class javax.net.ssl.SSLContextSpi
engineGetDefaultSSLParameters, engineGetSupportedSSLParameters
-
-
-
-
Field Detail
-
sslParameters
protected SSLParametersImpl sslParameters
-
-
Constructor Detail
-
OpenSSLContextImpl
protected OpenSSLContextImpl(String[] algorithms)
-
OpenSSLContextImpl
protected OpenSSLContextImpl() throws GeneralSecurityException, IOExceptionConstuctor for the DefaultSSLContextImpl.- Parameters:
dummy- is null, used to distinguish this case from the public OpenSSLContextImpl() constructor.- Throws:
GeneralSecurityExceptionIOException
-
-
Method Detail
-
getPreferred
public static OpenSSLContextImpl getPreferred()
Allows outside callers to get the preferred SSLContext.
-
engineInit
public void engineInit(KeyManager[] kms, TrustManager[] tms, 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.- Specified by:
engineInitin classSSLContextSpi- Parameters:
kms- the key sources ornulltms- the trust decision sources ornullsr- the randomness source ornull- Throws:
KeyManagementException- if initializing this instance fails
-
engineGetSocketFactory
public SSLSocketFactory engineGetSocketFactory()
Description copied from class:SSLContextSpiReturns a socket factory for this instance.- Specified by:
engineGetSocketFactoryin classSSLContextSpi- Returns:
- a socket factory for this instance.
-
engineGetServerSocketFactory
public SSLServerSocketFactory engineGetServerSocketFactory()
Description copied from class:SSLContextSpiReturns a server socket factory for this instance.- Specified by:
engineGetServerSocketFactoryin classSSLContextSpi- Returns:
- a server socket factory for this instance.
-
engineCreateSSLEngine
public SSLEngine engineCreateSSLEngine(String host, int port)
Description copied from class:SSLContextSpiCreates anSSLEngineinstance from this context with the specified hostname and port.- Specified by:
engineCreateSSLEnginein classSSLContextSpi- Parameters:
host- the name of the hostport- the port- Returns:
- an
SSLEngineinstance from this context.
-
engineCreateSSLEngine
public SSLEngine engineCreateSSLEngine()
Description copied from class:SSLContextSpiCreates anSSLEngineinstance from this context.- Specified by:
engineCreateSSLEnginein classSSLContextSpi- Returns:
- an
SSLEngineinstance from this context.
-
engineGetServerSessionContext
public ServerSessionContext engineGetServerSessionContext()
Description copied from class:SSLContextSpiReturns the SSL session context that encapsulates the set of SSL sessions that can be used for the server side of the SSL handshake.- Specified by:
engineGetServerSessionContextin classSSLContextSpi- Returns:
- the SSL server session context for this context or
nullif the underlying provider does not provide an implementation of theSSLSessionContextinterface.
-
engineGetClientSessionContext
public ClientSessionContext engineGetClientSessionContext()
Description copied from class:SSLContextSpiReturns the SSL session context that encapsulates the set of SSL sessions that can be used for the client side of the SSL handshake.- Specified by:
engineGetClientSessionContextin classSSLContextSpi- Returns:
- the SSL client session context for this context or
nullif the underlying provider does not provide an implementation of theSSLSessionContextinterface.
-
-