DefaultSignatureResult.cs 734 B

12345678910111213141516171819202122232425262728293031
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators
  5. {
  6. public class DefaultSignatureResult
  7. : IBlockResult
  8. {
  9. private readonly ISigner mSigner;
  10. public DefaultSignatureResult(ISigner signer)
  11. {
  12. this.mSigner = signer;
  13. }
  14. public byte[] Collect()
  15. {
  16. return mSigner.GenerateSignature();
  17. }
  18. public int Collect(byte[] sig, int sigOff)
  19. {
  20. byte[] signature = Collect();
  21. signature.CopyTo(sig, sigOff);
  22. return signature.Length;
  23. }
  24. }
  25. }
  26. #pragma warning restore
  27. #endif