TlsAuthentication.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using System.IO;
  4. namespace Org.BouncyCastle.Crypto.Tls
  5. {
  6. public interface TlsAuthentication
  7. {
  8. /// <summary>
  9. /// Called by the protocol handler to report the server certificate.
  10. /// </summary>
  11. /// <remarks>
  12. /// This method is responsible for certificate verification and validation
  13. /// </remarks>
  14. /// <param name="serverCertificate">The server <see cref="Certificate"/> received</param>
  15. /// <exception cref="IOException"></exception>
  16. void NotifyServerCertificate(Certificate serverCertificate);
  17. /// <summary>
  18. /// Return client credentials in response to server's certificate request
  19. /// </summary>
  20. /// <param name="certificateRequest">
  21. /// A <see cref="CertificateRequest"/> containing server certificate request details
  22. /// </param>
  23. /// <returns>
  24. /// A <see cref="TlsCredentials"/> to be used for client authentication
  25. /// (or <c>null</c> for no client authentication)
  26. /// </returns>
  27. /// <exception cref="IOException"></exception>
  28. TlsCredentials GetClientCredentials(TlsContext context, CertificateRequest certificateRequest);
  29. }
  30. }
  31. #endif