TlsKeyExchange.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. /// <summary>
  8. /// A generic interface for key exchange implementations in (D)TLS.
  9. /// </summary>
  10. public interface TlsKeyExchange
  11. {
  12. void Init(TlsContext context);
  13. /// <exception cref="IOException"/>
  14. void SkipServerCredentials();
  15. /// <exception cref="IOException"/>
  16. void ProcessServerCredentials(TlsCredentials serverCredentials);
  17. /// <exception cref="IOException"/>
  18. void ProcessServerCertificate(Certificate serverCertificate);
  19. bool RequiresServerKeyExchange { get; }
  20. /// <exception cref="IOException"/>
  21. byte[] GenerateServerKeyExchange();
  22. /// <exception cref="IOException"/>
  23. void SkipServerKeyExchange();
  24. /// <exception cref="IOException"/>
  25. void ProcessServerKeyExchange(Stream input);
  26. /// <exception cref="IOException"/>
  27. void ValidateCertificateRequest(CertificateRequest certificateRequest);
  28. /// <exception cref="IOException"/>
  29. void SkipClientCredentials();
  30. /// <exception cref="IOException"/>
  31. void ProcessClientCredentials(TlsCredentials clientCredentials);
  32. /// <exception cref="IOException"/>
  33. void ProcessClientCertificate(Certificate clientCertificate);
  34. /// <exception cref="IOException"/>
  35. void GenerateClientKeyExchange(Stream output);
  36. /// <exception cref="IOException"/>
  37. void ProcessClientKeyExchange(Stream input);
  38. /// <exception cref="IOException"/>
  39. byte[] GeneratePremasterSecret();
  40. }
  41. }
  42. #pragma warning restore
  43. #endif