BERBitString.cs 1022 B

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