ISigner.cs 1.4 KB

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