DsaPublicKeyParameters.cs 1.0 KB

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