DerNull.cs 777 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
  5. {
  6. /**
  7. * A Null object.
  8. */
  9. public class DerNull
  10. : Asn1Null
  11. {
  12. public static readonly DerNull Instance = new DerNull(0);
  13. byte[] zeroBytes = new byte[0];
  14. [Obsolete("Use static Instance object")]
  15. public DerNull()
  16. {
  17. }
  18. protected internal DerNull(int dummy)
  19. {
  20. }
  21. internal override void Encode(
  22. DerOutputStream derOut)
  23. {
  24. derOut.WriteEncoded(Asn1Tags.Null, zeroBytes);
  25. }
  26. protected override bool Asn1Equals(
  27. Asn1Object asn1Object)
  28. {
  29. return asn1Object is DerNull;
  30. }
  31. protected override int Asn1GetHashCode()
  32. {
  33. return -1;
  34. }
  35. }
  36. }
  37. #pragma warning restore
  38. #endif