TlsAgreement.cs 1.1 KB

12345678910111213141516171819202122232425262728
  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.Tls.Crypto
  6. {
  7. /// <summary>Base interface for ephemeral key agreement calculator.</summary>
  8. public interface TlsAgreement
  9. {
  10. /// <summary>Generate an ephemeral key pair, returning the encoding of the public key.</summary>
  11. /// <returns>a byte encoding of the public key.</returns>
  12. /// <exception cref="IOException"/>
  13. byte[] GenerateEphemeral();
  14. /// <summary>Pass in the public key for the peer to the agreement calculator.</summary>
  15. /// <param name="peerValue">a byte encoding of the peer public key.</param>
  16. /// <exception cref="IOException"/>
  17. void ReceivePeerValue(byte[] peerValue);
  18. /// <summary>Calculate the agreed secret based on the calculator's current state.</summary>
  19. /// <returns>the calculated secret.</returns>
  20. /// <exception cref="IOException"/>
  21. TlsSecret CalculateSecret();
  22. }
  23. }
  24. #pragma warning restore
  25. #endif