Most visited

Recently visited

Added in API level 1

SSLContextSpi

public abstract class SSLContextSpi
extends Object

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


该类定义了 SSLContext类的 ( SPI )。

这个类中的所有抽象方法必须由希望提供特定SSL上下文的实现的每个加密服务提供者来实现。

也可以看看:

摘要(Summary)

Public constructors

SSLContextSpi()

Protected methods

abstract SSLEngine engineCreateSSLEngine()

使用此上下文创建新的 SSLEngine

abstract SSLEngine engineCreateSSLEngine(String host, int port)

使用此上下文创建一个 SSLEngine

abstract SSLSessionContext engineGetClientSessionContext()

返回此上下文的客户端 SSLSessionContext对象。

SSLParameters engineGetDefaultSSLParameters()

返回指示此SSL上下文的默认设置的SSLParameters的副本。

abstract SSLSessionContext engineGetServerSessionContext()

返回此上下文的服务器 SSLSessionContext对象。

abstract SSLServerSocketFactory engineGetServerSocketFactory()

为此上下文返回一个 ServerSocketFactory对象。

abstract SSLSocketFactory engineGetSocketFactory()

为此上下文返回一个 SocketFactory对象。

SSLParameters engineGetSupportedSSLParameters()

返回SSLParameters的副本,指示此SSL上下文支持的最大设置。

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

初始化此上下文。

继承方法(Inherited methods)

From class java.lang.Object

Public constructors

SSLContextSpi

Added in API level 1
SSLContextSpi ()

Protected methods

engineCreateSSLEngine

Added in API level 1
SSLEngine engineCreateSSLEngine ()

使用此上下文创建新的 SSLEngine

使用这种工厂方法的应用程序没有提供内部会话重用策略的提示。 如果需要提示,应该使用engineCreateSSLEngine(String, int)

某些密码套件(如Kerberos)需要远程主机名信息,在这种情况下,不应使用此工厂方法。

返回(Returns)
SSLEngine the SSLEngine Object
抛出异常(Throws)
IllegalStateException if the SSLContextImpl requires initialization and the engineInit() has not been called

也可以看看:

engineCreateSSLEngine

Added in API level 1
SSLEngine engineCreateSSLEngine (String host, 
                int port)

使用此上下文创建一个 SSLEngine

使用此工厂方法的应用程序为内部会话重用策略提供了提示。

某些密码套件(如Kerberos)需要远程主机名信息,在这种情况下,需要指定peerHost。

参数(Parameters)
host String: the non-authoritative name of the host
port int: the non-authoritative port
返回(Returns)
SSLEngine the SSLEngine Object
抛出异常(Throws)
IllegalStateException if the SSLContextImpl requires initialization and the engineInit() has not been called

也可以看看:

engineGetClientSessionContext

Added in API level 1
SSLSessionContext engineGetClientSessionContext ()

返回此上下文的客户端 SSLSessionContext对象。

返回(Returns)
SSLSessionContext the SSLSessionContext object

也可以看看:

engineGetDefaultSSLParameters

Added in API level 9
SSLParameters engineGetDefaultSSLParameters ()

返回指示此SSL上下文的默认设置的SSLParameters的副本。

参数将始终将密码套件和协议数组设置为非空值。

默认实现从通过调用此上下文的SocketFactory的 SocketFactory.createSocket()方法创建的SSLSocket获取参数。

返回(Returns)
SSLParameters a copy of the SSLParameters object with the default settings
抛出异常(Throws)
UnsupportedOperationException if the default SSL parameters could not be obtained.

engineGetServerSessionContext

Added in API level 1
SSLSessionContext engineGetServerSessionContext ()

返回此上下文的服务器 SSLSessionContext对象。

返回(Returns)
SSLSessionContext the SSLSessionContext object

也可以看看:

engineGetServerSocketFactory

Added in API level 1
SSLServerSocketFactory engineGetServerSocketFactory ()

为此上下文返回一个 ServerSocketFactory对象。

返回(Returns)
SSLServerSocketFactory the ServerSocketFactory object
抛出异常(Throws)
IllegalStateException if the SSLContextImpl requires initialization and the engineInit() has not been called

也可以看看:

engineGetSocketFactory

Added in API level 1
SSLSocketFactory engineGetSocketFactory ()

为此上下文返回一个 SocketFactory对象。

返回(Returns)
SSLSocketFactory the SocketFactory object
抛出异常(Throws)
IllegalStateException if the SSLContextImpl requires initialization and the engineInit() has not been called

也可以看看:

engineGetSupportedSSLParameters

Added in API level 9
SSLParameters engineGetSupportedSSLParameters ()

返回SSLParameters的副本,指示此SSL上下文支持的最大设置。

参数将始终将密码套件和协议数组设置为非空值。

默认实现从通过调用此上下文的SocketFactory的 SocketFactory.createSocket()方法创建的SSLSocket获取参数。

返回(Returns)
SSLParameters a copy of the SSLParameters object with the maximum supported settings
抛出异常(Throws)
UnsupportedOperationException if the supported SSL parameters could not be obtained.

engineInit

Added in API level 1
void engineInit (KeyManager[] km, 
                TrustManager[] tm, 
                SecureRandom sr)

初始化此上下文。

参数(Parameters)
km KeyManager: the sources of authentication keys
tm TrustManager: the sources of peer authentication trust decisions
sr SecureRandom: the source of randomness
抛出异常(Throws)
KeyManagementException if this operation fails

也可以看看:

Hooray!