ISigner.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.Text;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
  6. {
  7. public interface ISigner
  8. {
  9. /**
  10. * Return the name of the algorithm the signer implements.
  11. *
  12. * @return the name of the algorithm the signer implements.
  13. */
  14. string AlgorithmName { get; }
  15. /**
  16. * Initialise the signer for signing or verification.
  17. *
  18. * @param forSigning true if for signing, false otherwise
  19. * @param param necessary parameters.
  20. */
  21. void Init(bool forSigning, ICipherParameters parameters);
  22. /**
  23. * update the internal digest with the byte b
  24. */
  25. void Update(byte input);
  26. /**
  27. * update the internal digest with the byte array in
  28. */
  29. void BlockUpdate(byte[] input, int inOff, int length);
  30. /**
  31. * Generate a signature for the message we've been loaded with using
  32. * the key we were initialised with.
  33. */
  34. byte[] GenerateSignature();
  35. /**
  36. * return true if the internal state represents the signature described
  37. * in the passed in array.
  38. */
  39. bool VerifySignature(byte[] signature);
  40. /**
  41. * reset the internal state
  42. */
  43. void Reset();
  44. }
  45. }
  46. #pragma warning restore
  47. #endif