TlsCredentialedSigner.cs 1.2 KB

123456789101112131415161718192021222324252627282930
  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>Support interface for generating a signature based on our private credentials.</summary>
  9. public interface TlsCredentialedSigner
  10. : TlsCredentials
  11. {
  12. /// <summary>Generate a signature against the passed in hash.</summary>
  13. /// <param name="hash">a message digest calculated across the message the signature is to apply to.</param>
  14. /// <returns>an encoded signature.</returns>
  15. /// <exception cref="IOException">if the hash cannot be processed, or there is an issue with the private
  16. /// credentials.</exception>
  17. byte[] GenerateRawSignature(byte[] hash);
  18. /// <summary>Return the algorithm IDs for the signature algorithm and the associated hash it uses.</summary>
  19. /// <returns>the full algorithm details for the signature.</returns>
  20. SignatureAndHashAlgorithm SignatureAndHashAlgorithm { get; }
  21. /// <exception cref="IOException"/>
  22. TlsStreamSigner GetStreamSigner();
  23. }
  24. }
  25. #pragma warning restore
  26. #endif