Package org.bouncycastle.crypto.tls
Class TlsClientProtocol
- java.lang.Object
-
- org.bouncycastle.crypto.tls.TlsProtocol
-
- org.bouncycastle.crypto.tls.TlsClientProtocol
-
- All Implemented Interfaces:
TlsCloseable
public class TlsClientProtocol extends TlsProtocol
Deprecated.Migrate to the (D)TLS API in org.bouncycastle.tls (bctls jar).
-
-
Field Summary
Fields Modifier and Type Field Description protected TlsAuthenticationauthenticationDeprecated.protected CertificateRequestcertificateRequestDeprecated.protected CertificateStatuscertificateStatusDeprecated.protected TlsKeyExchangekeyExchangeDeprecated.protected byte[]selectedSessionIDDeprecated.protected TlsClienttlsClientDeprecated.-
Fields inherited from class org.bouncycastle.crypto.tls.TlsProtocol
ADS_MODE_0_N, ADS_MODE_0_N_FIRSTONLY, ADS_MODE_1_Nsub1, allowCertificateStatus, blocking, clientExtensions, connection_state, CS_CERTIFICATE_REQUEST, CS_CERTIFICATE_STATUS, CS_CERTIFICATE_VERIFY, CS_CLIENT_CERTIFICATE, CS_CLIENT_FINISHED, CS_CLIENT_HELLO, CS_CLIENT_KEY_EXCHANGE, CS_CLIENT_SUPPLEMENTAL_DATA, CS_END, CS_SERVER_CERTIFICATE, CS_SERVER_FINISHED, CS_SERVER_HELLO, CS_SERVER_HELLO_DONE, CS_SERVER_KEY_EXCHANGE, CS_SERVER_SESSION_TICKET, CS_SERVER_SUPPLEMENTAL_DATA, CS_START, expectSessionTicket, EXT_RenegotiationInfo, EXT_SessionTicket, inputBuffers, offeredCipherSuites, offeredCompressionMethods, outputBuffer, peerCertificate, receivedChangeCipherSpec, resumedSession, secure_renegotiation, secureRandom, securityParameters, serverExtensions, sessionParameters, tlsSession
-
-
Constructor Summary
Constructors Constructor Description TlsClientProtocol(java.io.InputStream input, java.io.OutputStream output, java.security.SecureRandom secureRandom)Deprecated.Constructor for blocking mode.TlsClientProtocol(java.security.SecureRandom secureRandom)Deprecated.Constructor for non-blocking mode.
When data is received, useTlsProtocol.offerInput(byte[])to provide the received ciphertext, then useTlsProtocol.readInput(byte[], int, int)to read the corresponding cleartext.
Similarly, when data needs to be sent, useTlsProtocol.offerOutput(byte[], int, int)to provide the cleartext, then useTlsProtocol.readOutput(byte[], int, int)to get the corresponding ciphertext.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcleanupHandshake()Deprecated.voidconnect(TlsClient tlsClient)Deprecated.Initiates a TLS handshake in the role of client.
In blocking mode, this will not return until the handshake is complete.protected TlsContextgetContext()Deprecated.protected TlsPeergetPeer()Deprecated.protected voidhandleHandshakeMessage(short type, java.io.ByteArrayInputStream buf)Deprecated.protected voidhandleSupplementalData(java.util.Vector serverSupplementalData)Deprecated.protected voidreceiveNewSessionTicketMessage(java.io.ByteArrayInputStream buf)Deprecated.protected voidreceiveServerHelloMessage(java.io.ByteArrayInputStream buf)Deprecated.protected voidsendCertificateVerifyMessage(DigitallySigned certificateVerify)Deprecated.protected voidsendClientHelloMessage()Deprecated.protected voidsendClientKeyExchangeMessage()Deprecated.-
Methods inherited from class org.bouncycastle.crypto.tls.TlsProtocol
applicationDataAvailable, applyMaxFragmentLengthExtension, assertEmpty, blockForHandshake, checkReceivedChangeCipherSpec, close, closeInput, completeHandshake, createRandomBlock, createRenegotiationInfo, createVerifyData, establishMasterSecret, flush, getAvailableInputBytes, getAvailableOutputBytes, getCurrentPRFHash, getInputStream, getOutputStream, getPRFAlgorithm, handleAlertMessage, handleAlertWarningMessage, handleChangeCipherSpecMessage, handleClose, handleException, handleFailure, invalidateSession, isClosed, offerInput, offerInput, offerOutput, processFinishedMessage, processMaxFragmentLengthExtension, processRecord, raiseAlertFatal, raiseAlertWarning, readApplicationData, readExtensions, readInput, readOutput, readSupplementalDataMessage, refuseRenegotiation, safeCheckRecordHeader, safeReadRecord, safeWriteRecord, sendCertificateMessage, sendChangeCipherSpecMessage, sendFinishedMessage, sendSupplementalDataMessage, setAppDataSplitMode, writeData, writeExtensions, writeHandshakeMessage, writeSelectedExtensions, writeSupplementalData
-
-
-
-
Field Detail
-
tlsClient
protected TlsClient tlsClient
Deprecated.
-
selectedSessionID
protected byte[] selectedSessionID
Deprecated.
-
keyExchange
protected TlsKeyExchange keyExchange
Deprecated.
-
authentication
protected TlsAuthentication authentication
Deprecated.
-
certificateStatus
protected CertificateStatus certificateStatus
Deprecated.
-
certificateRequest
protected CertificateRequest certificateRequest
Deprecated.
-
-
Constructor Detail
-
TlsClientProtocol
public TlsClientProtocol(java.io.InputStream input, java.io.OutputStream output, java.security.SecureRandom secureRandom)Deprecated.Constructor for blocking mode.- Parameters:
input- The stream of data from the serveroutput- The stream of data to the serversecureRandom- Random number generator for various cryptographic functions
-
TlsClientProtocol
public TlsClientProtocol(java.security.SecureRandom secureRandom)
Deprecated.Constructor for non-blocking mode.
When data is received, useTlsProtocol.offerInput(byte[])to provide the received ciphertext, then useTlsProtocol.readInput(byte[], int, int)to read the corresponding cleartext.
Similarly, when data needs to be sent, useTlsProtocol.offerOutput(byte[], int, int)to provide the cleartext, then useTlsProtocol.readOutput(byte[], int, int)to get the corresponding ciphertext.- Parameters:
secureRandom- Random number generator for various cryptographic functions
-
-
Method Detail
-
connect
public void connect(TlsClient tlsClient) throws java.io.IOException
Deprecated.Initiates a TLS handshake in the role of client.
In blocking mode, this will not return until the handshake is complete. In non-blocking mode, useTlsPeer.notifyHandshakeComplete()to receive a callback when the handshake is complete.- Parameters:
tlsClient- TheTlsClientto use for the handshake.- Throws:
java.io.IOException- If in blocking mode and handshake was not successful.
-
cleanupHandshake
protected void cleanupHandshake()
Deprecated.- Overrides:
cleanupHandshakein classTlsProtocol
-
getContext
protected TlsContext getContext()
Deprecated.- Specified by:
getContextin classTlsProtocol
-
getPeer
protected TlsPeer getPeer()
Deprecated.- Specified by:
getPeerin classTlsProtocol
-
handleHandshakeMessage
protected void handleHandshakeMessage(short type, java.io.ByteArrayInputStream buf) throws java.io.IOExceptionDeprecated.- Specified by:
handleHandshakeMessagein classTlsProtocol- Throws:
java.io.IOException
-
handleSupplementalData
protected void handleSupplementalData(java.util.Vector serverSupplementalData) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
receiveNewSessionTicketMessage
protected void receiveNewSessionTicketMessage(java.io.ByteArrayInputStream buf) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
receiveServerHelloMessage
protected void receiveServerHelloMessage(java.io.ByteArrayInputStream buf) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
sendCertificateVerifyMessage
protected void sendCertificateVerifyMessage(DigitallySigned certificateVerify) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendClientHelloMessage
protected void sendClientHelloMessage() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
sendClientKeyExchangeMessage
protected void sendClientKeyExchangeMessage() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
-