#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) using System; using System.Collections; using System.IO; namespace Org.BouncyCastle.Crypto.Tls { public interface TlsClient : TlsPeer { System.Collections.Generic.List HostNames { get; set; } /// /// Called at the start of a new TLS session, before any other methods. /// /// /// A /// void Init(TlsClientContext context); /// Return the session this client wants to resume, if any. /// Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated. /// /// A representing the resumable session to be used for this connection, /// or null to use a new session. /// TlsSession GetSessionToResume(); /// /// Return the to use for the TLSPlaintext.version field prior to /// receiving the server version. NOTE: This method is not called for DTLS. /// /// /// See RFC 5246 E.1.: "TLS clients that wish to negotiate with older servers MAY send any value /// {03,XX} as the record layer version number. Typical values would be {03,00}, the lowest /// version number supported by the client, and the value of ClientHello.client_version. No /// single value will guarantee interoperability with all old servers, but this is a complex /// topic beyond the scope of this document." /// /// The to use. ProtocolVersion ClientHelloRecordLayerVersion { get; } ProtocolVersion ClientVersion { get; } bool IsFallback { get; } /// /// Get the list of cipher suites that this client supports. /// /// /// An array of values, each specifying a supported cipher suite. /// int[] GetCipherSuites(); /// /// Get the list of compression methods that this client supports. /// /// /// An array of values, each specifying a supported compression method. /// byte[] GetCompressionMethods(); /// /// Get the (optional) table of client extensions to be included in (extended) client hello. /// /// /// A (Int32 -> byte[]). May be null. /// /// IDictionary GetClientExtensions(); /// void NotifyServerVersion(ProtocolVersion selectedVersion); /// /// Notifies the client of the session_id sent in the ServerHello. /// /// An array of void NotifySessionID(byte[] sessionID); /// /// Report the cipher suite that was selected by the server. /// /// /// The protocol handler validates this value against the offered cipher suites /// /// /// /// A /// void NotifySelectedCipherSuite(int selectedCipherSuite); /// /// Report the compression method that was selected by the server. /// /// /// The protocol handler validates this value against the offered compression methods /// /// /// /// A /// void NotifySelectedCompressionMethod(byte selectedCompressionMethod); /// /// Report the extensions from an extended server hello. /// /// /// Will only be called if we returned a non-null result from . /// /// /// A (Int32 -> byte[]) /// void ProcessServerExtensions(IDictionary serverExtensions); /// A list of /// void ProcessServerSupplementalData(IList serverSupplementalData); /// /// Return an implementation of to negotiate the key exchange /// part of the protocol. /// /// /// A /// /// TlsKeyExchange GetKeyExchange(); /// /// Return an implementation of to handle authentication /// part of the protocol. /// /// TlsAuthentication GetAuthentication(); /// A list of /// IList GetClientSupplementalData(); /// RFC 5077 3.3. NewSessionTicket Handshake Message /// /// 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. /// /// The ticket /// void NotifyNewSessionTicket(NewSessionTicket newSessionTicket); } } #endif