Table of Contents

Class TlsClientProtocol

Namespace
Org.BouncyCastle.Tls
Assembly
BouncyCastle.Cryptography.dll
public class TlsClientProtocol : TlsProtocol, TlsCloseable
Inheritance
TlsClientProtocol
Implements
Inherited Members

Constructors

TlsClientProtocol()

Constructor for non-blocking mode.

public TlsClientProtocol()

Remarks

When data is received, use OfferInput(byte[]) to provide the received ciphertext, then use ReadInput(byte[], int, int) to read the corresponding cleartext.

Similarly, when data needs to be sent, use WriteApplicationData(byte[], int, int) to provide the cleartext, then use ReadOutput(byte[], int, int) to get the corresponding ciphertext.

TlsClientProtocol(Stream)

Constructor for blocking mode.

public TlsClientProtocol(Stream stream)

Parameters

stream Stream

The Stream of data to/from the server.

TlsClientProtocol(Stream, Stream)

Constructor for blocking mode.

public TlsClientProtocol(Stream input, Stream output)

Parameters

input Stream

The Stream of data from the server.

output Stream

The Stream of data to the server.

Fields

m_authentication

protected TlsAuthentication m_authentication

Field Value

TlsAuthentication

m_certificateRequest

protected CertificateRequest m_certificateRequest

Field Value

CertificateRequest

m_certificateStatus

protected CertificateStatus m_certificateStatus

Field Value

CertificateStatus

m_clientAgreements

protected IDictionary<int, TlsAgreement> m_clientAgreements

Field Value

IDictionary<int, TlsAgreement>

m_clientHello

protected ClientHello m_clientHello

Field Value

ClientHello

m_keyExchange

protected TlsKeyExchange m_keyExchange

Field Value

TlsKeyExchange

m_tlsClient

protected TlsClient m_tlsClient

Field Value

TlsClient

Properties

Context

protected override TlsContext Context { get; }

Property Value

TlsContext

Peer

protected override TlsPeer Peer { get; }

Property Value

TlsPeer

Methods

BeginHandshake()

protected override void BeginHandshake()

Exceptions

IOException

CleanupHandshake()

protected override void CleanupHandshake()

Connect(TlsClient)

Initiates a TLS handshake in the role of client.

public virtual void Connect(TlsClient tlsClient)

Parameters

tlsClient TlsClient

The TlsClient to use for the handshake.

Remarks

In blocking mode, this will not return until the handshake is complete. In non-blocking mode, use NotifyHandshakeComplete() to receive a callback when the handshake is complete.

Exceptions

IOException

If in blocking mode and handshake was not successful.

Handle13HandshakeMessage(short, HandshakeMessageInput)

protected virtual void Handle13HandshakeMessage(short type, HandshakeMessageInput buf)

Parameters

type short
buf HandshakeMessageInput

Exceptions

IOException

HandleHandshakeMessage(short, HandshakeMessageInput)

protected override void HandleHandshakeMessage(short type, HandshakeMessageInput buf)

Parameters

type short
buf HandshakeMessageInput

Exceptions

IOException

HandleServerCertificate()

protected virtual void HandleServerCertificate()

Exceptions

IOException

HandleSupplementalData(IList<SupplementalDataEntry>)

protected virtual void HandleSupplementalData(IList<SupplementalDataEntry> serverSupplementalData)

Parameters

serverSupplementalData IList<SupplementalDataEntry>

Exceptions

IOException

Process13HelloRetryRequest(ServerHello)

protected virtual void Process13HelloRetryRequest(ServerHello helloRetryRequest)

Parameters

helloRetryRequest ServerHello

Exceptions

IOException

Process13ServerHello(ServerHello, bool)

protected virtual void Process13ServerHello(ServerHello serverHello, bool afterHelloRetryRequest)

Parameters

serverHello ServerHello
afterHelloRetryRequest bool

Exceptions

IOException

Process13ServerHelloCoda(ServerHello, bool)

protected virtual void Process13ServerHelloCoda(ServerHello serverHello, bool afterHelloRetryRequest)

Parameters

serverHello ServerHello
afterHelloRetryRequest bool

Exceptions

IOException

ProcessServerHello(ServerHello)

protected virtual void ProcessServerHello(ServerHello serverHello)

Parameters

serverHello ServerHello

Exceptions

IOException

Receive13CertificateRequest(MemoryStream, bool)

protected virtual void Receive13CertificateRequest(MemoryStream buf, bool postHandshakeAuth)

Parameters

buf MemoryStream
postHandshakeAuth bool

Exceptions

IOException

Receive13EncryptedExtensions(MemoryStream)

protected virtual void Receive13EncryptedExtensions(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

Receive13NewSessionTicket(MemoryStream)

protected virtual void Receive13NewSessionTicket(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

Receive13ServerCertificate(MemoryStream)

protected virtual void Receive13ServerCertificate(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

Receive13ServerCertificateVerify(MemoryStream)

protected virtual void Receive13ServerCertificateVerify(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

Receive13ServerFinished(MemoryStream)

protected virtual void Receive13ServerFinished(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

ReceiveCertificateRequest(MemoryStream)

protected virtual void ReceiveCertificateRequest(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

ReceiveNewSessionTicket(MemoryStream)

protected virtual void ReceiveNewSessionTicket(MemoryStream buf)

Parameters

buf MemoryStream

Exceptions

IOException

ReceiveServerHelloMessage(MemoryStream)

protected virtual ServerHello ReceiveServerHelloMessage(MemoryStream buf)

Parameters

buf MemoryStream

Returns

ServerHello

Exceptions

IOException

Send13ClientHelloRetry()

protected virtual void Send13ClientHelloRetry()

Exceptions

IOException

SendCertificateVerifyMessage(DigitallySigned)

protected virtual void SendCertificateVerifyMessage(DigitallySigned certificateVerify)

Parameters

certificateVerify DigitallySigned

Exceptions

IOException

SendClientHello()

protected virtual void SendClientHello()

Exceptions

IOException

SendClientHelloMessage()

protected virtual void SendClientHelloMessage()

Exceptions

IOException

SendClientKeyExchange()

protected virtual void SendClientKeyExchange()

Exceptions

IOException

Skip13CertificateRequest()

protected virtual void Skip13CertificateRequest()

Exceptions

IOException

Skip13ServerCertificate()

protected virtual void Skip13ServerCertificate()

Exceptions

IOException