DigestInputBuffer.cs 888 B

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. using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO;
  7. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls
  8. {
  9. internal class DigestInputBuffer
  10. : MemoryStream
  11. {
  12. internal void UpdateDigest(TlsHash hash)
  13. {
  14. Streams.WriteBufTo(this, new TlsHashSink(hash));
  15. }
  16. /// <exception cref="IOException"/>
  17. internal void CopyTo(Stream output)
  18. {
  19. // TODO[tls-port]
  20. // NOTE: Copy data since the output here may be under control of external code.
  21. //Streams.PipeAll(new MemoryStream(buf, 0, count), output);
  22. Streams.WriteBufTo(this, output);
  23. }
  24. }
  25. }
  26. #pragma warning restore
  27. #endif