SSLContextSpi (Java SE 9 & JDK 9 ) (original) (raw)
- javax.net.ssl.SSLContextSpi
public abstract class SSLContextSpi
extends Object
This class defines the Service Provider Interface (SPI) for the SSLContext
class.
All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a particular SSL context.
Since:
1.4
See Also:
SSLContext
Constructor Summary
Constructors
Constructor Description SSLContextSpi() Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
Modifier and Type Method Description protected abstract SSLEngine engineCreateSSLEngine() Creates a new SSLEngine using this context. protected abstract SSLEngine engineCreateSSLEngine(String host, int port) Creates a SSLEngine using this context. protected abstract SSLSessionContext engineGetClientSessionContext() Returns a client SSLSessionContext object for this context. protected SSLParameters engineGetDefaultSSLParameters() Returns a copy of the SSLParameters indicating the default settings for this SSL context. protected abstract SSLSessionContext engineGetServerSessionContext() Returns a server SSLSessionContext object for this context. protected abstract SSLServerSocketFactory engineGetServerSocketFactory() Returns a ServerSocketFactory object for this context. protected abstract SSLSocketFactory engineGetSocketFactory() Returns a SocketFactory object for this context. protected SSLParameters engineGetSupportedSSLParameters() Returns a copy of the SSLParameters indicating the maximum supported settings for this SSL context. protected abstract void engineInit(KeyManager[] km,TrustManager[] tm,SecureRandom sr) Initializes this context. * ### Methods inherited from class java.lang.[Object](../../../java/lang/Object.html "class in java.lang") `[clone](../../../java/lang/Object.html#clone--), [equals](../../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../../java/lang/Object.html#finalize--), [getClass](../../../java/lang/Object.html#getClass--), [hashCode](../../../java/lang/Object.html#hashCode--), [notify](../../../java/lang/Object.html#notify--), [notifyAll](../../../java/lang/Object.html#notifyAll--), [toString](../../../java/lang/Object.html#toString--), [wait](../../../java/lang/Object.html#wait--), [wait](../../../java/lang/Object.html#wait-long-), [wait](../../../java/lang/Object.html#wait-long-int-)`
Constructor Detail
* #### SSLContextSpi public SSLContextSpi()
Method Detail
* #### engineInit protected abstract void engineInit([KeyManager](../../../javax/net/ssl/KeyManager.html "interface in javax.net.ssl")[] km, [TrustManager](../../../javax/net/ssl/TrustManager.html "interface in javax.net.ssl")[] tm, [SecureRandom](../../../java/security/SecureRandom.html "class in java.security") sr) throws [KeyManagementException](../../../java/security/KeyManagementException.html "class in java.security") Initializes this context. Parameters: `km` \- the sources of authentication keys `tm` \- the sources of peer authentication trust decisions `sr` \- the source of randomness Throws: `[KeyManagementException](../../../java/security/KeyManagementException.html "class in java.security")` \- if this operation fails See Also: [SSLContext.init(KeyManager \[\], TrustManager \[\], SecureRandom)](../../../javax/net/ssl/SSLContext.html#init-javax.net.ssl.KeyManager:A-javax.net.ssl.TrustManager:A-java.security.SecureRandom-) * #### engineGetSocketFactory protected abstract [SSLSocketFactory](../../../javax/net/ssl/SSLSocketFactory.html "class in javax.net.ssl") engineGetSocketFactory() Returns a `SocketFactory` object for this context. Returns: the `SocketFactory` object Throws: `[UnsupportedOperationException](../../../java/lang/UnsupportedOperationException.html "class in java.lang")` \- if the underlying provider does not implement the operation. `[IllegalStateException](../../../java/lang/IllegalStateException.html "class in java.lang")` \- if the SSLContextImpl requires initialization and the `engineInit()` has not been called See Also: [SSLContext.getSocketFactory()](../../../javax/net/ssl/SSLContext.html#getSocketFactory--) * #### engineGetServerSocketFactory protected abstract [SSLServerSocketFactory](../../../javax/net/ssl/SSLServerSocketFactory.html "class in javax.net.ssl") engineGetServerSocketFactory() Returns a `ServerSocketFactory` object for this context. Returns: the `ServerSocketFactory` object Throws: `[UnsupportedOperationException](../../../java/lang/UnsupportedOperationException.html "class in java.lang")` \- if the underlying provider does not implement the operation. `[IllegalStateException](../../../java/lang/IllegalStateException.html "class in java.lang")` \- if the SSLContextImpl requires initialization and the `engineInit()` has not been called See Also: [SSLContext.getServerSocketFactory()](../../../javax/net/ssl/SSLContext.html#getServerSocketFactory--) * #### engineCreateSSLEngine protected abstract [SSLEngine](../../../javax/net/ssl/SSLEngine.html "class in javax.net.ssl") engineCreateSSLEngine() Creates a new `SSLEngine` using this context. Applications using this factory method are providing no hints for an internal session reuse strategy. If hints are desired,[engineCreateSSLEngine(String, int)](../../../javax/net/ssl/SSLContextSpi.html#engineCreateSSLEngine-java.lang.String-int-) should be used instead. Some cipher suites (such as Kerberos) require remote hostname information, in which case this factory method should not be used. Returns: the `SSLEngine` Object Throws: `[IllegalStateException](../../../java/lang/IllegalStateException.html "class in java.lang")` \- if the SSLContextImpl requires initialization and the `engineInit()` has not been called Since: 1.5 See Also: [SSLContext.createSSLEngine()](../../../javax/net/ssl/SSLContext.html#createSSLEngine--) * #### engineCreateSSLEngine protected abstract [SSLEngine](../../../javax/net/ssl/SSLEngine.html "class in javax.net.ssl") engineCreateSSLEngine([String](../../../java/lang/String.html "class in java.lang") host, int port) Creates a `SSLEngine` using this context. Applications using this factory method are providing hints for an internal session reuse strategy. Some cipher suites (such as Kerberos) require remote hostname information, in which case peerHost needs to be specified. Parameters: `host` \- the non-authoritative name of the host `port` \- the non-authoritative port Returns: the `SSLEngine` Object Throws: `[IllegalStateException](../../../java/lang/IllegalStateException.html "class in java.lang")` \- if the SSLContextImpl requires initialization and the `engineInit()` has not been called Since: 1.5 See Also: [SSLContext.createSSLEngine(String, int)](../../../javax/net/ssl/SSLContext.html#createSSLEngine-java.lang.String-int-) * #### engineGetServerSessionContext protected abstract [SSLSessionContext](../../../javax/net/ssl/SSLSessionContext.html "interface in javax.net.ssl") engineGetServerSessionContext() Returns a server `SSLSessionContext` object for this context. Returns: the `SSLSessionContext` object See Also: [SSLContext.getServerSessionContext()](../../../javax/net/ssl/SSLContext.html#getServerSessionContext--) * #### engineGetClientSessionContext protected abstract [SSLSessionContext](../../../javax/net/ssl/SSLSessionContext.html "interface in javax.net.ssl") engineGetClientSessionContext() Returns a client `SSLSessionContext` object for this context. Returns: the `SSLSessionContext` object See Also: [SSLContext.getClientSessionContext()](../../../javax/net/ssl/SSLContext.html#getClientSessionContext--) * #### engineGetDefaultSSLParameters protected [SSLParameters](../../../javax/net/ssl/SSLParameters.html "class in javax.net.ssl") engineGetDefaultSSLParameters() Returns a copy of the SSLParameters indicating the default settings for this SSL context. The parameters will always have the ciphersuite and protocols arrays set to non-null values. The default implementation obtains the parameters from an SSLSocket created by calling the[SocketFactory.createSocket()](../../../javax/net/SocketFactory.html#createSocket--) method of this context's SocketFactory. Returns: a copy of the SSLParameters object with the default settings Throws: `[UnsupportedOperationException](../../../java/lang/UnsupportedOperationException.html "class in java.lang")` \- if the default SSL parameters could not be obtained. Since: 1.6 * #### engineGetSupportedSSLParameters protected [SSLParameters](../../../javax/net/ssl/SSLParameters.html "class in javax.net.ssl") engineGetSupportedSSLParameters() Returns a copy of the SSLParameters indicating the maximum supported settings for this SSL context. The parameters will always have the ciphersuite and protocols arrays set to non-null values. The default implementation obtains the parameters from an SSLSocket created by calling the[SocketFactory.createSocket()](../../../javax/net/SocketFactory.html#createSocket--) method of this context's SocketFactory. Returns: a copy of the SSLParameters object with the maximum supported settings Throws: `[UnsupportedOperationException](../../../java/lang/UnsupportedOperationException.html "class in java.lang")` \- if the supported SSL parameters could not be obtained. Since: 1.6
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.