public class TlsClientProtocol extends TlsProtocol
| Modifier and Type | Field and Description |
|---|---|
protected TlsAuthentication |
authentication |
protected CertificateRequest |
certificateRequest |
protected CertificateStatus |
certificateStatus |
protected java.util.Hashtable |
clientAgreements |
protected TlsKeyExchange |
keyExchange |
protected TlsClient |
tlsClient |
ADS_MODE_0_N, ADS_MODE_0_N_FIRSTONLY, ADS_MODE_1_Nsub1, allowCertificateStatus, blocking, clientExtensions, connection_state, CS_CLIENT_CERTIFICATE, CS_CLIENT_CERTIFICATE_VERIFY, CS_CLIENT_END_OF_EARLY_DATA, CS_CLIENT_FINISHED, CS_CLIENT_HELLO, CS_CLIENT_HELLO_RETRY, CS_CLIENT_KEY_EXCHANGE, CS_CLIENT_SUPPLEMENTAL_DATA, CS_END, CS_SERVER_CERTIFICATE, CS_SERVER_CERTIFICATE_REQUEST, CS_SERVER_CERTIFICATE_STATUS, CS_SERVER_CERTIFICATE_VERIFY, CS_SERVER_ENCRYPTED_EXTENSIONS, CS_SERVER_FINISHED, CS_SERVER_HELLO, CS_SERVER_HELLO_DONE, CS_SERVER_HELLO_RETRY_REQUEST, CS_SERVER_KEY_EXCHANGE, CS_SERVER_SESSION_TICKET, CS_SERVER_SUPPLEMENTAL_DATA, CS_START, expectSessionTicket, EXT_RenegotiationInfo, EXT_SessionTicket, inputBuffers, offeredCipherSuites, outputBuffer, receivedChangeCipherSpec, resumedSession, serverExtensions, sessionMasterSecret, sessionParameters, tlsSession| Constructor and Description |
|---|
TlsClientProtocol()
Constructor for non-blocking mode.
When data is received, use TlsProtocol.offerInput(byte[]) to provide the received ciphertext,
then use TlsProtocol.readInput(byte[], int, int) to read the corresponding cleartext.Similarly, when data needs to be sent, use TlsProtocol.writeApplicationData(byte[], int, int) to
provide the cleartext, then use TlsProtocol.readOutput(byte[], int, int) to get the
corresponding ciphertext. |
TlsClientProtocol(java.io.InputStream input,
java.io.OutputStream output)
Constructor for blocking mode.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginHandshake(boolean renegotiation) |
protected void |
cleanupHandshake() |
void |
connect(TlsClient tlsClient)
Initiates a TLS handshake in the role of client.
In blocking mode, this will not return until the handshake is complete. |
protected TlsContext |
getContext() |
protected TlsPeer |
getPeer() |
protected void |
handle13HandshakeMessage(short type,
org.bouncycastle.tls.HandshakeMessageInput buf) |
protected void |
handleHandshakeMessage(short type,
org.bouncycastle.tls.HandshakeMessageInput buf) |
protected void |
handleServerCertificate() |
protected void |
handleSupplementalData(java.util.Vector serverSupplementalData) |
protected void |
process13HelloRetryRequest(ServerHello serverHello) |
protected void |
process13ServerHello(ServerHello serverHello,
boolean afterHelloRetryRequest) |
protected void |
processServerHelloMessage(ServerHello serverHello) |
protected void |
receive13CertificateRequest(java.io.ByteArrayInputStream buf) |
protected void |
receive13EncryptedExtensions(java.io.ByteArrayInputStream buf) |
protected void |
receive13NewSessionTicket(java.io.ByteArrayInputStream buf) |
protected void |
receive13ServerCertificate(java.io.ByteArrayInputStream buf) |
protected void |
receive13ServerCertificateVerify(java.io.ByteArrayInputStream buf) |
protected void |
receive13ServerFinished(java.io.ByteArrayInputStream buf) |
protected void |
receive13ServerKeyUpdate(java.io.ByteArrayInputStream buf) |
protected void |
receiveNewSessionTicketMessage(java.io.ByteArrayInputStream buf) |
protected void |
send13ClientHelloRetryMessage() |
protected void |
sendCertificateVerifyMessage(DigitallySigned certificateVerify) |
protected void |
sendClientHelloMessage() |
protected void |
sendClientKeyExchangeMessage() |
protected void |
skip13CertificateRequest() |
protected void |
skip13ServerCertificate() |
applicationDataAvailable, applyMaxFragmentLengthExtension, assertEmpty, blockForHandshake, checkReceivedChangeCipherSpec, close, closeConnection, closeInput, completeHandshake, createRandomBlock, createRenegotiationInfo, establishMasterSecret, flush, getAppDataSplitMode, getApplicationDataLimit, getAvailableInputBytes, getAvailableOutputBytes, getInputStream, getOutputStream, getPRFAlgorithm, getRenegotiationPolicy, handleAlertMessage, handleAlertWarningMessage, handleChangeCipherSpecMessage, handleClose, handleException, handleFailure, handleRenegotiation, invalidateSession, isClosed, isHandshaking, isLegacyConnectionState, isResumableHandshake, isTLSv13ConnectionState, offerInput, offerInput, previewInputRecord, previewOutputRecord, processFinishedMessage, processMaxFragmentLengthExtension, processRecord, raiseAlertFatal, raiseAlertWarning, readApplicationData, readExtensions, readExtensionsData, readInput, readOutput, readSupplementalDataMessage, refuseRenegotiation, resumeHandshake, safePreviewRecordHeader, safeReadFullRecord, safeReadRecord, safeWriteRecord, sendCertificateMessage, sendChangeCipherSpecMessage, sendFinishedMessage, sendSupplementalDataMessage, setAppDataSplitMode, setResumableHandshake, writeApplicationData, writeExtensions, writeHandshakeMessage, writeSelectedExtensions, writeSupplementalDataprotected TlsClient tlsClient
protected java.util.Hashtable clientAgreements
protected TlsKeyExchange keyExchange
protected TlsAuthentication authentication
protected CertificateStatus certificateStatus
protected CertificateRequest certificateRequest
public TlsClientProtocol()
TlsProtocol.offerInput(byte[]) to provide the received ciphertext,
then use TlsProtocol.readInput(byte[], int, int) to read the corresponding cleartext.TlsProtocol.writeApplicationData(byte[], int, int) to
provide the cleartext, then use TlsProtocol.readOutput(byte[], int, int) to get the
corresponding ciphertext.public TlsClientProtocol(java.io.InputStream input,
java.io.OutputStream output)
input - The stream of data from the serveroutput - The stream of data to the serverpublic void connect(TlsClient tlsClient) throws java.io.IOException
TlsPeer.notifyHandshakeComplete() to
receive a callback when the handshake is complete.tlsClient - The TlsClient to use for the handshake.java.io.IOException - If in blocking mode and handshake was not successful.protected void beginHandshake(boolean renegotiation)
throws java.io.IOException
beginHandshake in class TlsProtocoljava.io.IOExceptionprotected void cleanupHandshake()
cleanupHandshake in class TlsProtocolprotected TlsContext getContext()
getContext in class TlsProtocolprotected TlsPeer getPeer()
getPeer in class TlsProtocolprotected void handle13HandshakeMessage(short type,
org.bouncycastle.tls.HandshakeMessageInput buf)
throws java.io.IOException
java.io.IOExceptionprotected void handleHandshakeMessage(short type,
org.bouncycastle.tls.HandshakeMessageInput buf)
throws java.io.IOException
handleHandshakeMessage in class TlsProtocoljava.io.IOExceptionprotected void handleServerCertificate()
throws java.io.IOException
java.io.IOExceptionprotected void handleSupplementalData(java.util.Vector serverSupplementalData)
throws java.io.IOException
java.io.IOExceptionprotected void process13HelloRetryRequest(ServerHello serverHello) throws java.io.IOException
java.io.IOExceptionprotected void process13ServerHello(ServerHello serverHello, boolean afterHelloRetryRequest) throws java.io.IOException
java.io.IOExceptionprotected void processServerHelloMessage(ServerHello serverHello) throws java.io.IOException
java.io.IOExceptionprotected void receive13CertificateRequest(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receive13EncryptedExtensions(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receive13NewSessionTicket(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receive13ServerCertificate(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receive13ServerCertificateVerify(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receive13ServerFinished(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receive13ServerKeyUpdate(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void receiveNewSessionTicketMessage(java.io.ByteArrayInputStream buf)
throws java.io.IOException
java.io.IOExceptionprotected void send13ClientHelloRetryMessage()
throws java.io.IOException
java.io.IOExceptionprotected void sendCertificateVerifyMessage(DigitallySigned certificateVerify) throws java.io.IOException
java.io.IOExceptionprotected void sendClientHelloMessage()
throws java.io.IOException
java.io.IOExceptionprotected void sendClientKeyExchangeMessage()
throws java.io.IOException
java.io.IOExceptionprotected void skip13CertificateRequest()
throws java.io.IOException
java.io.IOExceptionprotected void skip13ServerCertificate()
throws java.io.IOException
java.io.IOException