|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
javax.net.ssl
|
Constructor Summary | |
---|---|
protected |
SSLContext(SSLContextSpi contextSpi,
Provider provider,
String protocol)
Creates an SSLContext object. |
Method Summary | |
---|---|
SSLEngine |
createSSLEngine()
Creates a new SSLEngine using this context. |
SSLEngine |
createSSLEngine(String peerHost,
int peerPort)
Creates a new SSLEngine using this context using
advisory peer information. |
SSLSessionContext |
getClientSessionContext()
Returns the client session context, which represents the set of SSL sessions available for use during the handshake phase of client-side SSL sockets. |
static SSLContext |
getInstance(String protocol)
Generates a SSLContext object that implements the
specified secure socket protocol. |
static SSLContext |
getInstance(String protocol,
Provider provider)
Generates a SSLContext object that implements the
specified secure socket protocol from the specified provider. |
static SSLContext |
getInstance(String protocol,
String provider)
Generates a SSLContext object that implements the
specified secure socket protocol from the specified provider. |
String |
getProtocol()
Returns the protocol name of this SSLContext object. |
Provider |
getProvider()
Returns the provider of this SSLContext object. |
SSLSessionContext |
getServerSessionContext()
Returns the server session context, which represents the set of SSL sessions available for use during the handshake phase of server-side SSL sockets. |
SSLServerSocketFactory |
getServerSocketFactory()
Returns a ServerSocketFactory object for
this context. |
SSLSocketFactory |
getSocketFactory()
Returns a SocketFactory object for this
context. |
void |
init(KeyManager[] km,
TrustManager[] tm,
SecureRandom random)
Initializes this context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SSLContext(SSLContextSpi contextSpi, Provider provider, String protocol)
contextSpi
- the delegateprovider
- the providerprotocol
- the protocolMethod Detail |
---|
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException
SSLContext
object that implements the
specified secure socket protocol.
If the default provider package provides an implementation of the
requested key management algorithm, an instance of
SSLContext
containing that implementation is
returned. If the algorithm is not available in the default provider
package, other provider packages are searched.
protocol
- the standard name of the requested protocol.
SSLContext
object
NoSuchAlgorithmException
- if the specified protocol is not
available in the default provider package or any of the
other provider packages that were searched.public static SSLContext getInstance(String protocol, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
SSLContext
object that implements the
specified secure socket protocol from the specified provider.
protocol
- the standard name of the requested protocol.provider
- the name of the provider
SSLContext
object
NoSuchAlgorithmException
- if the specified protocol is not
available from the specified provider.
NoSuchProviderException
- if the specified provider has not
been configured.
IllegalArgumentException
- if the provider name is null or empty.public static SSLContext getInstance(String protocol, Provider provider) throws NoSuchAlgorithmException
SSLContext
object that implements the
specified secure socket protocol from the specified provider.
protocol
- the standard name of the requested protocol.provider
- an instance of the provider
SSLContext
object
NoSuchAlgorithmException
- if the specified protocol is not
available from the specified provider.
IllegalArgumentException
- if the provider name is null.public final String getProtocol()
SSLContext
object.
This is the same name that was specified in one of the
getInstance
calls that created this
SSLContext
object.
SSLContext
object.public final Provider getProvider()
SSLContext
object.
SSLContext
objectpublic final void init(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws KeyManagementException
Only the first instance of a particular key and/or trust manager implementation type in the array is used. (For example, only the first javax.net.ssl.X509KeyManager in the array will be used.)
km
- the sources of authentication keys or nulltm
- the sources of peer authentication trust decisions or nullrandom
- the source of randomness for this generator or null
KeyManagementException
- if this operation failspublic final SSLSocketFactory getSocketFactory()
SocketFactory
object for this
context.
SocketFactory
objectpublic final SSLServerSocketFactory getServerSocketFactory()
ServerSocketFactory
object for
this context.
ServerSocketFactory
objectpublic final SSLEngine createSSLEngine()
SSLEngine
using this context.
Applications using this factory method are providing no hints
for an internal session reuse strategy. If hints are desired,
createSSLEngine(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.
SSLEngine
object
UnsupportedOperationException
- if the underlying provider
does not implement the operation.public final SSLEngine createSSLEngine(String peerHost, int peerPort)
SSLEngine
using this context using
advisory peer information.
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.
peerHost
- the non-authoritative name of the hostpeerPort
- the non-authoritative port
SSLEngine
object
UnsupportedOperationException
- if the underlying provider
does not implement the operation.public final SSLSessionContext getServerSessionContext()
This context may be unavailable in some environments, in which case this method returns null. For example, when the underlying SSL provider does not provide an implementation of SSLSessionContext interface, this method returns null. A non-null session context is returned otherwise.
public final SSLSessionContext getClientSessionContext()
This context may be unavailable in some environments, in which case this method returns null. For example, when the underlying SSL provider does not provide an implementation of SSLSessionContext interface, this method returns null. A non-null session context is returned otherwise.