BcTls13Verifier.cs 919 B

123456789101112131415161718192021222324252627282930313233343536
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  6. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO;
  7. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto.Impl.BC
  8. {
  9. internal sealed class BcTls13Verifier
  10. : Tls13Verifier
  11. {
  12. private readonly SignerSink m_output;
  13. internal BcTls13Verifier(ISigner verifier)
  14. {
  15. if (verifier == null)
  16. throw new ArgumentNullException("verifier");
  17. this.m_output = new SignerSink(verifier);
  18. }
  19. public Stream Stream
  20. {
  21. get { return m_output; }
  22. }
  23. public bool VerifySignature(byte[] signature)
  24. {
  25. return m_output.Signer.VerifySignature(signature);
  26. }
  27. }
  28. }
  29. #pragma warning restore
  30. #endif