PemHeader.cs 1.1 KB

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