TlsKeyExchange.cs 1.7 KB

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