Table of Contents

Interface TlsClient

Namespace
Org.BouncyCastle.Tls
Assembly
BouncyCastle.Cryptography.dll
public interface TlsClient : TlsPeer
Inherited Members

Methods

GetAuthentication()

TlsAuthentication GetAuthentication()

Returns

TlsAuthentication

Exceptions

IOException

GetClientExtensions()

IDictionary<int, byte[]> GetClientExtensions()

Returns

IDictionary<int, byte[]>

(Int32 -> byte[])

Exceptions

IOException

GetClientSupplementalData()

IList<SupplementalDataEntry> GetClientSupplementalData()

Returns

IList<SupplementalDataEntry>

(SupplementalDataEntry)

Exceptions

IOException

GetDHGroupVerifier()

TlsDHGroupVerifier GetDHGroupVerifier()

Returns

TlsDHGroupVerifier

Exceptions

IOException

GetEarlyKeyShareGroups()

If this client is offering TLS 1.3 or higher, this method may be called to determine for which groups a key share should be included in the initial ClientHello.

IList<int> GetEarlyKeyShareGroups()

Returns

IList<int>

an IList<T> of named group values, possibly empty or null.

Remarks

Groups that were not included in the supported_groups extension (by GetClientExtensions() will be ignored. The protocol will then add a suitable key_share extension to the ClientHello extensions.

GetExternalPsks()

Return the external PSKs to offer in the ClientHello.

IList<TlsPskExternal> GetExternalPsks()

Returns

IList<TlsPskExternal>

an IList<T> of TlsPskExternal instances, or null if none should be offered.

Remarks

This will only be called when TLS 1.3 or higher is amongst the offered protocol versions.

GetPskIdentity()

TlsPskIdentity GetPskIdentity()

Returns

TlsPskIdentity

Exceptions

IOException

GetSessionToResume()

Return the session this client wants to resume, if any.

TlsSession GetSessionToResume()

Returns

TlsSession

A TlsSession representing the resumable session to be used for this connection, or null to use a new session.

Remarks

Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated.

See Also

GetSrpConfigVerifier()

TlsSrpConfigVerifier GetSrpConfigVerifier()

Returns

TlsSrpConfigVerifier

Exceptions

IOException

GetSrpIdentity()

TlsSrpIdentity GetSrpIdentity()

Returns

TlsSrpIdentity

Exceptions

IOException

Init(TlsClientContext)

void Init(TlsClientContext context)

Parameters

context TlsClientContext

IsFallback()

bool IsFallback()

Returns

bool

NotifyNewSessionTicket(NewSessionTicket)

RFC 5077 3.3. NewSessionTicket Handshake Message

void NotifyNewSessionTicket(NewSessionTicket newSessionTicket)

Parameters

newSessionTicket NewSessionTicket

The ticket.

Remarks

This method will be called (only) when a NewSessionTicket handshake message is received. The ticket is opaque to the client and clients MUST NOT examine the ticket under the assumption that it complies with e.g. RFC 5077 4. "Recommended Ticket Construction".

Exceptions

IOException

NotifySelectedCipherSuite(int)

void NotifySelectedCipherSuite(int selectedCipherSuite)

Parameters

selectedCipherSuite int

NotifySelectedPsk(TlsPsk)

void NotifySelectedPsk(TlsPsk selectedPsk)

Parameters

selectedPsk TlsPsk

Exceptions

IOException

NotifyServerVersion(ProtocolVersion)

void NotifyServerVersion(ProtocolVersion selectedVersion)

Parameters

selectedVersion ProtocolVersion

Exceptions

IOException

NotifySessionID(byte[])

Notifies the client of the session_id sent in the ServerHello.

void NotifySessionID(byte[] sessionID)

Parameters

sessionID byte[]
See Also

NotifySessionToResume(TlsSession)

Notifies the client of the session that will be offered in ClientHello for resumption, if any.

void NotifySessionToResume(TlsSession session)

Parameters

session TlsSession

The TlsSession representing the resumable session to be offered for this connection, or null if there is none.

Remarks

This will be either the session returned from {@link #getSessionToResume()} or null if that session was unusable. NOTE: the actual negotiated session_id is notified by NotifySessionID(byte[]).

See Also

ProcessServerExtensions(IDictionary<int, byte[]>)

The protocol implementation validates that any server extensions received correspond to client extensions sent.

void ProcessServerExtensions(IDictionary<int, byte[]> serverExtensions)

Parameters

serverExtensions IDictionary<int, byte[]>

(Int32 -> byte[])

Remarks

If further processing of the server extensions is needed, it can be done in this callback. NOTE: This is not called for session resumption handshakes.

Exceptions

IOException

ProcessServerSupplementalData(IList<SupplementalDataEntry>)

void ProcessServerSupplementalData(IList<SupplementalDataEntry> serverSupplementalData)

Parameters

serverSupplementalData IList<SupplementalDataEntry>

(SupplementalDataEntry)

Exceptions

IOException