AsymmetricKeyParameter.cs 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
  6. {
  7. public abstract class AsymmetricKeyParameter
  8. : ICipherParameters
  9. {
  10. private readonly bool privateKey;
  11. protected AsymmetricKeyParameter(
  12. bool privateKey)
  13. {
  14. this.privateKey = privateKey;
  15. }
  16. public bool IsPrivate
  17. {
  18. get { return privateKey; }
  19. }
  20. public override bool Equals(
  21. object obj)
  22. {
  23. AsymmetricKeyParameter other = obj as AsymmetricKeyParameter;
  24. if (other == null)
  25. {
  26. return false;
  27. }
  28. return Equals(other);
  29. }
  30. protected bool Equals(
  31. AsymmetricKeyParameter other)
  32. {
  33. return privateKey == other.privateKey;
  34. }
  35. public override int GetHashCode()
  36. {
  37. return privateKey.GetHashCode();
  38. }
  39. }
  40. }
  41. #pragma warning restore
  42. #endif