PemHeader.cs 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Utilities.IO.Pem
  4. {
  5. public class PemHeader
  6. {
  7. private string name;
  8. private string val;
  9. public PemHeader(string name, string val)
  10. {
  11. this.name = name;
  12. this.val = val;
  13. }
  14. public virtual string Name
  15. {
  16. get { return name; }
  17. }
  18. public virtual string Value
  19. {
  20. get { return val; }
  21. }
  22. public override int GetHashCode()
  23. {
  24. return GetHashCode(this.name) + 31 * GetHashCode(this.val);
  25. }
  26. public override bool Equals(object obj)
  27. {
  28. if (obj == this)
  29. return true;
  30. if (!(obj is PemHeader))
  31. return false;
  32. PemHeader other = (PemHeader)obj;
  33. return Org.BouncyCastle.Utilities.Platform.Equals(this.name, other.name)
  34. && Org.BouncyCastle.Utilities.Platform.Equals(this.val, other.val);
  35. }
  36. private int GetHashCode(string s)
  37. {
  38. if (s == null)
  39. {
  40. return 1;
  41. }
  42. return s.GetHashCode();
  43. }
  44. }
  45. }
  46. #endif