AsymmetricKeyParameter.cs 769 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. namespace Renci.SshNet.Security.Org.BouncyCastle.Crypto
  2. {
  3. internal abstract class AsymmetricKeyParameter
  4. {
  5. private readonly bool privateKey;
  6. protected AsymmetricKeyParameter(
  7. bool privateKey)
  8. {
  9. this.privateKey = privateKey;
  10. }
  11. public bool IsPrivate
  12. {
  13. get { return privateKey; }
  14. }
  15. public override bool Equals(
  16. object obj)
  17. {
  18. AsymmetricKeyParameter other = obj as AsymmetricKeyParameter;
  19. if (other == null)
  20. {
  21. return false;
  22. }
  23. return Equals(other);
  24. }
  25. protected bool Equals(
  26. AsymmetricKeyParameter other)
  27. {
  28. return privateKey == other.privateKey;
  29. }
  30. public override int GetHashCode()
  31. {
  32. return privateKey.GetHashCode();
  33. }
  34. }
  35. }