Package org.conscrypt
Class SSLEngineImpl
java.lang.Object
javax.net.ssl.SSLEngine
org.conscrypt.SSLEngineImpl
public class SSLEngineImpl extends SSLEngine
Implementation of SSLEngine.
-
Field Summary
Fields Modifier and Type Field Description protected SSLRecordProtocolrecordProtocolprotected SSLParametersImplsslParameters -
Constructor Summary
Constructors Modifier Constructor Description protectedSSLEngineImpl(String host, int port, SSLParametersImpl sslParameters)protectedSSLEngineImpl(SSLParametersImpl sslParameters) -
Method Summary
Modifier and Type Method Description voidbeginHandshake()Starts the handshake.voidcloseInbound()Closes inbound operations of this enginevoidcloseOutbound()Closes outbound operations of this engineRunnablegetDelegatedTask()Returns handshake's delegated tasks to be runString[]getEnabledCipherSuites()This method works according to the specification of implemented class.String[]getEnabledProtocols()This method works according to the specification of implemented class.booleangetEnableSessionCreation()This method works according to the specification of implemented class.SSLEngineResult.HandshakeStatusgetHandshakeStatus()This method works according to the specification of implemented class.booleangetNeedClientAuth()This method works according to the specification of implemented class.SSLSessiongetSession()This method works according to the specification of implemented class.String[]getSupportedCipherSuites()Returns names of supported cipher suites.String[]getSupportedProtocols()This method works according to the specification of implemented class.booleangetUseClientMode()This method works according to the specification of implemented class.booleangetWantClientAuth()This method works according to the specification of implemented class.booleanisInboundDone()This method works according to the specification of implemented class.booleanisOutboundDone()This method works according to the specification of implemented class.voidsetEnabledCipherSuites(String[] suites)This method works according to the specification of implemented class.voidsetEnabledProtocols(String[] protocols)This method works according to the specification of implemented class.voidsetEnableSessionCreation(boolean flag)This method works according to the specification of implemented class.voidsetNeedClientAuth(boolean need)This method works according to the specification of implemented class.voidsetUseClientMode(boolean mode)This method works according to the specification of implemented class.voidsetWantClientAuth(boolean want)This method works according to the specification of implemented class.SSLEngineResultunwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length)Decodes one complete SSL/TLS record provided in the source buffer.SSLEngineResultwrap(ByteBuffer[] srcs, int offset, int len, ByteBuffer dst)Encodes the application data into SSL/TLS record.Methods inherited from class javax.net.ssl.SSLEngine
getPeerHost, getPeerPort, getSSLParameters, setSSLParameters, unwrap, unwrap, wrap, wrap
-
Field Details
-
recordProtocol
-
sslParameters
-
-
Constructor Details
-
SSLEngineImpl
-
SSLEngineImpl
-
-
Method Details
-
beginHandshake
Starts the handshake.- Specified by:
beginHandshakein classSSLEngine- Throws:
SSLException- See Also:
method documentation for more information
-
closeInbound
Closes inbound operations of this engine- Specified by:
closeInboundin classSSLEngine- Throws:
SSLException- See Also:
method documentation for more information
-
closeOutbound
public void closeOutbound()Closes outbound operations of this engine- Specified by:
closeOutboundin classSSLEngine- See Also:
method documentation for more information
-
getDelegatedTask
Returns handshake's delegated tasks to be run- Specified by:
getDelegatedTaskin classSSLEngine- Returns:
- the delegated task to be executed.
- See Also:
method documentation for more information
-
getSupportedCipherSuites
Returns names of supported cipher suites.- Specified by:
getSupportedCipherSuitesin classSSLEngine- Returns:
- array of strings containing the names of supported cipher suites
- See Also:
method documentation for more information
-
getEnabledCipherSuites
This method works according to the specification of implemented class.- Specified by:
getEnabledCipherSuitesin classSSLEngine- Returns:
- the SSL cipher suite names that are enabled in this engine instance.
- See Also:
method documentation for more information
-
setEnabledCipherSuites
This method works according to the specification of implemented class.- Specified by:
setEnabledCipherSuitesin classSSLEngine- Parameters:
suites- the SSL cipher suite names to be enabled.- See Also:
method documentation for more information
-
getSupportedProtocols
This method works according to the specification of implemented class.- Specified by:
getSupportedProtocolsin classSSLEngine- Returns:
- the protocol names that are supported by this engine.
- See Also:
method documentation for more information
-
getEnabledProtocols
This method works according to the specification of implemented class.- Specified by:
getEnabledProtocolsin classSSLEngine- Returns:
- the protocol version names that are enabled in this engine instance.
- See Also:
method documentation for more information
-
setEnabledProtocols
This method works according to the specification of implemented class.- Specified by:
setEnabledProtocolsin classSSLEngine- Parameters:
protocols- the protocol version names to be enabled.- See Also:
method documentation for more information
-
setUseClientMode
public void setUseClientMode(boolean mode)This method works according to the specification of implemented class.- Specified by:
setUseClientModein classSSLEngine- Parameters:
mode-trueif this engine should act in client mode,falseif not.- See Also:
method documentation for more information
-
getUseClientMode
public boolean getUseClientMode()This method works according to the specification of implemented class.- Specified by:
getUseClientModein classSSLEngine- Returns:
trueif the engine is set to do handshaking in client mode.- See Also:
method documentation for more information
-
setNeedClientAuth
public void setNeedClientAuth(boolean need)This method works according to the specification of implemented class.- Specified by:
setNeedClientAuthin classSSLEngine- Parameters:
need-trueif client authentication is required,falseif no authentication is needed.- See Also:
method documentation for more information
-
getNeedClientAuth
public boolean getNeedClientAuth()This method works according to the specification of implemented class.- Specified by:
getNeedClientAuthin classSSLEngine- Returns:
trueif this engine will require client authentication,falseif no client authentication is needed.- See Also:
method documentation for more information
-
setWantClientAuth
public void setWantClientAuth(boolean want)This method works according to the specification of implemented class.- Specified by:
setWantClientAuthin classSSLEngine- Parameters:
want-trueif client authentication should be requested,falseif no authentication is needed.- See Also:
method documentation for more information
-
getWantClientAuth
public boolean getWantClientAuth()This method works according to the specification of implemented class.- Specified by:
getWantClientAuthin classSSLEngine- Returns:
trueif client authentication will be requested,falseotherwise.- See Also:
method documentation for more information
-
setEnableSessionCreation
public void setEnableSessionCreation(boolean flag)This method works according to the specification of implemented class.- Specified by:
setEnableSessionCreationin classSSLEngine- Parameters:
flag-trueif new SSL sessions may be established,falseif existing SSL sessions must be reused.- See Also:
method documentation for more information
-
getEnableSessionCreation
public boolean getEnableSessionCreation()This method works according to the specification of implemented class.- Specified by:
getEnableSessionCreationin classSSLEngine- Returns:
trueif new session may be established,falseif existing sessions must be reused.- See Also:
method documentation for more information
-
getHandshakeStatus
This method works according to the specification of implemented class.- Specified by:
getHandshakeStatusin classSSLEngine- Returns:
- the status of the handshake of this engine instance.
- See Also:
method documentation for more information
-
getSession
This method works according to the specification of implemented class.- Specified by:
getSessionin classSSLEngine- Returns:
- the SSL session for this engine instance.
- See Also:
method documentation for more information
-
isInboundDone
public boolean isInboundDone()This method works according to the specification of implemented class.- Specified by:
isInboundDonein classSSLEngine- Returns:
trueif no more inbound data will be accepted by this engine,falseotherwise.- See Also:
method documentation for more information
-
isOutboundDone
public boolean isOutboundDone()This method works according to the specification of implemented class.- Specified by:
isOutboundDonein classSSLEngine- Returns:
trueif no more outbound data will be producted by this engine,otherwisefalse.- See Also:
method documentation for more information
-
unwrap
public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length) throws SSLExceptionDecodes one complete SSL/TLS record provided in the source buffer. If decoded record contained application data, this data will be placed in the destination buffers. For more information about TLS record fragmentation see TLS v 1 specification (http://www.ietf.org/rfc/rfc2246.txt) p 6.2.- Specified by:
unwrapin classSSLEngine- Parameters:
src- source buffer containing SSL/TLS record.dsts- destination buffers to place received 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.- Returns:
- the result object of this operation.
- Throws:
SSLException- if a problem occurred while processing the data.- See Also:
method documentation for more information
-
wrap
public SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int len, ByteBuffer dst) throws SSLExceptionEncodes the application data into SSL/TLS record. If handshake status of the engine differs from NOT_HANDSHAKING the operation can work without consuming of the source data. For more information about TLS record fragmentation see TLS v 1 specification (http://www.ietf.org/rfc/rfc2246.txt) p 6.2.- Specified by:
wrapin classSSLEngine- Parameters:
srcs- the source buffers with application data to be encoded into SSL/TLS record.offset- the offset in the destination buffers array pointing to the first buffer with the source data.len- specifies the maximum number of buffers to be procesed.dst- the destination buffer where encoded data will be placed.- Returns:
- the result object of this operation.
- Throws:
SSLException- if a problem occurred while processing the data.- See Also:
method documentation for more information
-