public class MySSLContextSpi.tmpSSLEngine extends SSLEngine
Constructor and Description |
---|
MySSLContextSpi.tmpSSLEngine() |
MySSLContextSpi.tmpSSLEngine(String host,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
beginHandshake()
Initiates a handshake on this engine.
|
void |
closeInbound()
Notifies this engine instance that no more inbound network data will be
sent to this engine.
|
void |
closeOutbound()
Notifies this engine instance that no more outbound application data will
be sent to this engine.
|
Runnable |
getDelegatedTask()
Returns a delegate task for this engine instance.
|
String[] |
getEnabledCipherSuites()
Returns the SSL cipher suite names that are enabled in this engine
instance.
|
String[] |
getEnabledProtocols()
Returns the protocol version names that are enabled in this engine
instance.
|
boolean |
getEnableSessionCreation()
Returns whether new SSL sessions may be established by this engine.
|
SSLEngineResult.HandshakeStatus |
getHandshakeStatus()
Returns the status of the handshake of this engine instance.
|
boolean |
getNeedClientAuth()
Returns whether this engine instance will require client authentication.
|
String |
getPeerHost()
Returns the name of the peer host.
|
int |
getPeerPort()
Returns the port number of the peer host.
|
SSLSession |
getSession()
Returns the SSL session for this engine instance.
|
String[] |
getSupportedCipherSuites()
Returns the SSL cipher suite names that are supported by this engine.
|
String[] |
getSupportedProtocols()
Returns the protocol names that are supported by this engine.
|
boolean |
getUseClientMode()
Returns whether this engine is set to act in client mode when
handshaking.
|
boolean |
getWantClientAuth()
Returns whether this engine will request client authentication.
|
boolean |
isInboundDone()
Returns whether no more inbound data will be accepted by this engine.
|
boolean |
isOutboundDone()
Returns whether no more outbound data will be produced by this engine.
|
void |
setEnabledCipherSuites(String[] suites)
Sets the SSL cipher suite names that should be enabled in this engine
instance.
|
void |
setEnabledProtocols(String[] protocols)
Sets the protocol version names that should be enabled in this engine
instance.
|
void |
setEnableSessionCreation(boolean flag)
Sets whether new SSL sessions may be established by this engine instance.
|
void |
setNeedClientAuth(boolean need)
Sets whether this engine must require client authentication.
|
void |
setUseClientMode(boolean mode)
Sets whether this engine should act in client (or server) mode when
handshaking.
|
void |
setWantClientAuth(boolean want)
Sets whether this engine should request client authentication.
|
SSLEngineResult |
unwrap(ByteBuffer src,
ByteBuffer[] dsts,
int offset,
int length)
Decodes the incoming network data buffer into application data buffers.
|
SSLEngineResult |
wrap(ByteBuffer[] srcs,
int offset,
int length,
ByteBuffer dst)
Encodes the outgoing application data buffers into the network data
buffer.
|
getSSLParameters, setSSLParameters, unwrap, unwrap, wrap, wrap
public MySSLContextSpi.tmpSSLEngine()
public MySSLContextSpi.tmpSSLEngine(String host, int port)
public String getPeerHost()
SSLEngine
getPeerHost
in class SSLEngine
null
if none is available.public int getPeerPort()
SSLEngine
getPeerPort
in class SSLEngine
-1
is none is
available.public void beginHandshake() throws SSLException
SSLEngine
Calling this method is not needed for the initial handshake: it will be
called by wrap
or unwrap
if the initial handshake has not
been started yet.
beginHandshake
in class SSLEngine
SSLException
- if starting the handshake fails.public void closeInbound() throws SSLException
SSLEngine
closeInbound
in class SSLEngine
SSLException
- if this engine did not receive a needed protocol specific
close notification message from the peer.public void closeOutbound()
SSLEngine
closeOutbound
in class SSLEngine
public Runnable getDelegatedTask()
SSLEngine
SSLEngineResult
instances returned by this engine may indicate
that a delegated task result is needed. In this case the
run
method of the returned Runnable
delegated task must be called.getDelegatedTask
in class SSLEngine
null
if none are available.public String[] getEnabledCipherSuites()
SSLEngine
getEnabledCipherSuites
in class SSLEngine
public String[] getEnabledProtocols()
SSLEngine
getEnabledProtocols
in class SSLEngine
public boolean getEnableSessionCreation()
SSLEngine
getEnableSessionCreation
in class SSLEngine
true
if new session may be established, false
if
existing sessions must be reused.public SSLEngineResult.HandshakeStatus getHandshakeStatus()
SSLEngine
getHandshakeStatus
in class SSLEngine
public boolean getNeedClientAuth()
SSLEngine
getNeedClientAuth
in class SSLEngine
true
if this engine will require client authentication,
false
if no client authentication is needed.public SSLSession getSession()
SSLEngine
getSession
in class SSLEngine
public String[] getSupportedCipherSuites()
SSLEngine
SSLEngine.setEnabledCipherSuites(String[])
.getSupportedCipherSuites
in class SSLEngine
public String[] getSupportedProtocols()
SSLEngine
SSLEngine.setEnabledProtocols(String[])
.getSupportedProtocols
in class SSLEngine
public boolean getUseClientMode()
SSLEngine
getUseClientMode
in class SSLEngine
true
if the engine is set to do handshaking in client
mode.public boolean getWantClientAuth()
SSLEngine
getWantClientAuth
in class SSLEngine
true
if client authentication will be requested,
false
otherwise.public boolean isInboundDone()
SSLEngine
isInboundDone
in class SSLEngine
true
if no more inbound data will be accepted by this
engine, false
otherwise.public boolean isOutboundDone()
SSLEngine
isOutboundDone
in class SSLEngine
true
if no more outbound data will be producted by this
engine, otherwise
false.public void setEnabledCipherSuites(String[] suites)
SSLEngine
getSupportedCipherSuites()
are allowed.setEnabledCipherSuites
in class SSLEngine
suites
- the SSL cipher suite names to be enabled.public void setEnabledProtocols(String[] protocols)
SSLEngine
getSupportedProtocols()
are
allowed.setEnabledProtocols
in class SSLEngine
protocols
- the protocol version names to be enabled.public void setEnableSessionCreation(boolean flag)
SSLEngine
setEnableSessionCreation
in class SSLEngine
flag
- true
if new SSL sessions may be established,
false
if existing SSL sessions must be reused.public void setNeedClientAuth(boolean need)
SSLEngine
SSLEngine.setWantClientAuth(boolean)
.setNeedClientAuth
in class SSLEngine
need
- true
if client authentication is required,
false
if no authentication is needed.public void setUseClientMode(boolean mode)
SSLEngine
setUseClientMode
in class SSLEngine
mode
- true
if this engine should act in client mode,
false
if not.public void setWantClientAuth(boolean want)
SSLEngine
SSLEngine.setNeedClientAuth(boolean)
.setWantClientAuth
in class SSLEngine
want
- true
if client authentication should be requested,
false
if no authentication is needed.public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length) throws SSLException
SSLEngine
unwrap
in class SSLEngine
src
- the buffer with incoming network datadsts
- the array of destination buffers for incoming application
data.offset
- the offset in the array of destination buffers to which data
is to be transferred.length
- the maximum number of destination buffers to be used.SSLException
- if a problem occurred while processing the data.public SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int length, ByteBuffer dst) throws SSLException
SSLEngine
wrap
in class SSLEngine
srcs
- the array of source buffers of outgoing application data.offset
- the offset in the array of source buffers from which data is
to be retrieved.length
- the maximum number of source buffers to be used.dst
- the destination buffer for network data.SSLException
- if a problem occurred while processing the data.