TlsKeyExchange.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto;
  6. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls
  7. {
  8. /// <summary>A generic interface for key exchange implementations in (D)TLS.</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. short[] GetClientCertificateTypes();
  26. /// <exception cref="IOException"/>
  27. void SkipClientCredentials();
  28. /// <exception cref="IOException"/>
  29. void ProcessClientCredentials(TlsCredentials clientCredentials);
  30. /// <exception cref="IOException"/>
  31. void ProcessClientCertificate(Certificate clientCertificate);
  32. /// <exception cref="IOException"/>
  33. void GenerateClientKeyExchange(Stream output);
  34. /// <exception cref="IOException"/>
  35. void ProcessClientKeyExchange(Stream input);
  36. bool RequiresCertificateVerify { get; }
  37. /// <exception cref="IOException"/>
  38. TlsSecret GeneratePreMasterSecret();
  39. }
  40. }
  41. #pragma warning restore
  42. #endif