TlsAuthentication.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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.Crypto.Tls
  6. {
  7. public interface TlsAuthentication
  8. {
  9. /// <summary>
  10. /// Called by the protocol handler to report the server certificate.
  11. /// </summary>
  12. /// <remarks>
  13. /// This method is responsible for certificate verification and validation
  14. /// </remarks>
  15. /// <param name="serverCertificate">The server <see cref="Certificate"/> received</param>
  16. /// <exception cref="IOException"></exception>
  17. void NotifyServerCertificate(Certificate serverCertificate);
  18. /// <summary>
  19. /// Return client credentials in response to server's certificate request
  20. /// </summary>
  21. /// <param name="certificateRequest">
  22. /// A <see cref="CertificateRequest"/> containing server certificate request details
  23. /// </param>
  24. /// <returns>
  25. /// A <see cref="TlsCredentials"/> to be used for client authentication
  26. /// (or <c>null</c> for no client authentication)
  27. /// </returns>
  28. /// <exception cref="IOException"></exception>
  29. TlsCredentials GetClientCredentials(TlsContext context, CertificateRequest certificateRequest);
  30. }
  31. }
  32. #pragma warning restore
  33. #endif