IDSA.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using Org.BouncyCastle.Math;
  4. namespace Org.BouncyCastle.Crypto
  5. {
  6. /**
  7. * interface for classes implementing the Digital Signature Algorithm
  8. */
  9. public interface IDsa
  10. {
  11. string AlgorithmName { get; }
  12. /**
  13. * initialise the signer for signature generation or signature
  14. * verification.
  15. *
  16. * @param forSigning true if we are generating a signature, false
  17. * otherwise.
  18. * @param param key parameters for signature generation.
  19. */
  20. void Init(bool forSigning, ICipherParameters parameters);
  21. /**
  22. * sign the passed in message (usually the output of a hash function).
  23. *
  24. * @param message the message to be signed.
  25. * @return two big integers representing the r and s values respectively.
  26. */
  27. BigInteger[] GenerateSignature(byte[] message);
  28. /**
  29. * verify the message message against the signature values r and s.
  30. *
  31. * @param message the message that was supposed to have been signed.
  32. * @param r the r signature value.
  33. * @param s the s signature value.
  34. */
  35. bool VerifySignature(byte[] message, BigInteger r, BigInteger s);
  36. }
  37. }
  38. #endif