TlsAuthentication.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls
  6. {
  7. /// <summary>Base interface to provide TLS authentication credentials.</summary>
  8. public interface TlsAuthentication
  9. {
  10. /// <summary>Called by the protocol handler to report the server certificate.</summary>
  11. /// <remarks>
  12. /// Note: this method is responsible for certificate verification and validation.
  13. /// </remarks>
  14. /// <param name="serverCertificate">the server certificate received.</param>
  15. /// <exception cref="IOException"/>
  16. void NotifyServerCertificate(TlsServerCertificate serverCertificate);
  17. /// <summary>Return client credentials in response to server's certificate request.</summary>
  18. /// <remarks>
  19. /// The returned value may be null, or else it MUST implement <em>exactly one</em> of
  20. /// <see cref="TlsCredentialedAgreement"/>, <see cref="TlsCredentialedDecryptor"/>, or
  21. /// <see cref="TlsCredentialedSigner"/>, depending on the key exchange that was negotiated and the details of
  22. /// the <see cref="CertificateRequest"/>.
  23. /// </remarks>
  24. /// <param name="certificateRequest">details of the certificate request.</param>
  25. /// <returns>a <see cref="TlsCredentials"/> object or null for no client authentication.</returns>
  26. /// <exception cref="IOException"/>
  27. TlsCredentials GetClientCredentials(CertificateRequest certificateRequest);
  28. }
  29. }
  30. #pragma warning restore
  31. #endif