AsymmetricKeyParameter.cs 894 B

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