<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.1" />

TlsPeer

public interface TlsPeer
Base interface for a (D)TLS endpoint.
TlsCrypto Crypto { get; }

Indicates whether a DTLS connection should ignore corrupt records (bad_record_mac) instead of failing the connection.

Specify the time, in milliseconds, after which a handshake packet is resent.

void Cancel()

Specify the timeout, in milliseconds, to use for the complete handshake process.

Return a TlsHeartbeat instance that will control the generation of heartbeats locally (if permitted by the remote peer), or null to not generate heartbeats. Heartbeats are described in RFC 6520.

Return the heartbeat mode applicable to the remote peer. Heartbeats are described in RFC 6520.

void NotifyAlertRaised(short alertLevel, short alertDescription, string message, Exception cause)

This method will be called when an alert is raised by the protocol.

void NotifyAlertReceived(short alertLevel, short alertDescription)

This method will be called when an alert is received from the remote peer.

void NotifyCloseHandle(TlsCloseable closehandle)

Notifies the peer that a new handshake is about to begin.

Notifies the peer that the handshake has been successfully completed.

void NotifySecureRenegotiation(bool secureRenegotiation)

RFC 5746 3.4/3.6. In case this is false, peers may want to terminate the handshake instead of continuing; see Section 4.1/4.3 for discussion.

See RFC 5246 6.2.3.2. Controls whether block cipher encryption may randomly add extra padding beyond the minimum.

draft-mathewson-no-gmtunixtime-00 2. "If existing users of a TLS implementation may rely on gmt_unix_time containing the current time, we recommend that implementors MAY provide the ability to set gmt_unix_time as an option only, off by default.".