BERBitString.cs 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using Org.BouncyCastle.Utilities;
  4. namespace Org.BouncyCastle.Asn1
  5. {
  6. public class BerBitString
  7. : DerBitString
  8. {
  9. public BerBitString(byte[] data, int padBits)
  10. : base(data, padBits)
  11. {
  12. }
  13. public BerBitString(byte[] data)
  14. : base(data)
  15. {
  16. }
  17. public BerBitString(int namedBits)
  18. : base(namedBits)
  19. {
  20. }
  21. public BerBitString(Asn1Encodable obj)
  22. : base(obj)
  23. {
  24. }
  25. internal override void Encode(
  26. DerOutputStream derOut)
  27. {
  28. if (derOut is Asn1OutputStream || derOut is BerOutputStream)
  29. {
  30. derOut.WriteEncoded(Asn1Tags.BitString, (byte)mPadBits, mData);
  31. }
  32. else
  33. {
  34. base.Encode(derOut);
  35. }
  36. }
  37. }
  38. }
  39. #endif