DerNull.cs 706 B

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