Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public abstract class

SSLContextSpi

extends Object
java.lang.Object
   ↳ javax.net.ssl.SSLContextSpi

Class Overview

The Service Provider Interface (SPI) for the SSLContext class.

Summary

Public Constructors
SSLContextSpi ()
Creates a new SSLContextSpi instance.
Protected Methods
abstract SSLEngine engineCreateSSLEngine ( String host, int port)
Creates an SSLEngine instance from this context with the specified hostname and port.
abstract SSLEngine engineCreateSSLEngine ()
Creates an SSLEngine instance from this context.
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.
SSLParameters engineGetDefaultSSLParameters ()
Returns a new SSLParameters instance that includes the default SSL handshake parameters values including cipher suites, protocols, and client authentication.
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.
abstract SSLServerSocketFactory engineGetServerSocketFactory ()
Returns a server socket factory for this instance.
abstract SSLSocketFactory engineGetSocketFactory ()
Returns a socket factory for this instance.
SSLParameters engineGetSupportedSSLParameters ()
Returns a new SSLParameters instance that includes all supported cipher suites and protocols.
abstract void engineInit ( KeyManager[] km, TrustManager[] tm, SecureRandom sr)
Initializes this SSLContext instance.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SSLContextSpi ()

Added in API level 1

Creates a new SSLContextSpi instance.

Protected Methods

protected abstract SSLEngine engineCreateSSLEngine ( String host, int port)

Added in API level 1

Creates an SSLEngine instance from this context with the specified hostname and port.

Parameters
host the name of the host
port the port
Returns
  • an SSLEngine instance from this context.
Throws
UnsupportedOperationException if the provider does not support the operation.

protected abstract SSLEngine engineCreateSSLEngine ()

Added in API level 1

Creates an SSLEngine instance from this context.

Returns
  • an SSLEngine instance from this context.
Throws
UnsupportedOperationException if the provider does not support the operation.

protected abstract SSLSessionContext engineGetClientSessionContext ()

Added in API level 1

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 null if the underlying provider does not provide an implementation of the SSLSessionContext interface.

protected SSLParameters engineGetDefaultSSLParameters ()

Added in API level 9

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.

protected abstract SSLSessionContext engineGetServerSessionContext ()

Added in API level 1

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 null if the underlying provider does not provide an implementation of the SSLSessionContext interface.

protected abstract SSLServerSocketFactory engineGetServerSocketFactory ()

Added in API level 1

Returns a server socket factory for this instance.

Returns
  • a server socket factory for this instance.

protected abstract SSLSocketFactory engineGetSocketFactory ()

Added in API level 1

Returns a socket factory for this instance.

Returns
  • a socket factory for this instance.

protected SSLParameters engineGetSupportedSSLParameters ()

Added in API level 9

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.

protected abstract void engineInit ( KeyManager[] km, TrustManager[] tm, SecureRandom sr)

Added in API level 1

Initializes this SSLContext instance. 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 or null .
tm the trust decision sources or null .
sr the randomness source or null.
Throws
KeyManagementException if initializing this instance fails.