DsaKeyParameters.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  6. {
  7. public abstract class DsaKeyParameters
  8. : AsymmetricKeyParameter
  9. {
  10. private readonly DsaParameters parameters;
  11. protected DsaKeyParameters(
  12. bool isPrivate,
  13. DsaParameters parameters)
  14. : base(isPrivate)
  15. {
  16. // Note: parameters may be null
  17. this.parameters = parameters;
  18. }
  19. public DsaParameters Parameters
  20. {
  21. get { return parameters; }
  22. }
  23. public override bool Equals(
  24. object obj)
  25. {
  26. if (obj == this)
  27. return true;
  28. DsaKeyParameters other = obj as DsaKeyParameters;
  29. if (other == null)
  30. return false;
  31. return Equals(other);
  32. }
  33. protected bool Equals(
  34. DsaKeyParameters other)
  35. {
  36. return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(parameters, other.parameters)
  37. && base.Equals(other);
  38. }
  39. public override int GetHashCode()
  40. {
  41. int hc = base.GetHashCode();
  42. if (parameters != null)
  43. {
  44. hc ^= parameters.GetHashCode();
  45. }
  46. return hc;
  47. }
  48. }
  49. }
  50. #pragma warning restore
  51. #endif