DsaPrivateKeyParameters.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  6. {
  7. public class DsaPrivateKeyParameters
  8. : DsaKeyParameters
  9. {
  10. private readonly BigInteger x;
  11. public DsaPrivateKeyParameters(
  12. BigInteger x,
  13. DsaParameters parameters)
  14. : base(true, parameters)
  15. {
  16. if (x == null)
  17. throw new ArgumentNullException("x");
  18. this.x = x;
  19. }
  20. public BigInteger X
  21. {
  22. get { return x; }
  23. }
  24. public override bool Equals(
  25. object obj)
  26. {
  27. if (obj == this)
  28. return true;
  29. DsaPrivateKeyParameters other = obj as DsaPrivateKeyParameters;
  30. if (other == null)
  31. return false;
  32. return Equals(other);
  33. }
  34. protected bool Equals(
  35. DsaPrivateKeyParameters other)
  36. {
  37. return x.Equals(other.x) && base.Equals(other);
  38. }
  39. public override int GetHashCode()
  40. {
  41. return x.GetHashCode() ^ base.GetHashCode();
  42. }
  43. }
  44. }
  45. #pragma warning restore
  46. #endif