Asn1BitStringParser.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.IO;
  5. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1
  6. {
  7. public interface Asn1BitStringParser
  8. : IAsn1Convertible
  9. {
  10. /// <summary>Return a <see cref="Stream"/> representing the contents of the BIT STRING. The final byte, if any,
  11. /// may include pad bits. See <see cref="PadBits"/>.</summary>
  12. /// <returns>A <see cref="Stream"/> with its source as the BIT STRING content.</returns>
  13. /// <exception cref="IOException"/>
  14. Stream GetBitStream();
  15. /// <summary>Return a <see cref="Stream"/> representing the contents of the BIT STRING, where the content is
  16. /// expected to be octet-aligned (this will be automatically checked during parsing).</summary>
  17. /// <returns>A <see cref="Stream"/> with its source as the BIT STRING content.</returns>
  18. /// <exception cref="IOException"/>
  19. Stream GetOctetStream();
  20. /// <summary>Return the number of pad bits, if any, in the final byte, if any, read from
  21. /// <see cref="GetBitStream"/>.</summary>
  22. /// <remarks>
  23. /// This number is in the range zero to seven. That number of the least significant bits of the final byte, if
  24. /// any, are not part of the contents and should be ignored. NOTE: Must be called AFTER the stream has been
  25. /// fully processed. (Does not need to be called if <see cref="GetOctetStream"/> was used instead of
  26. /// <see cref="GetBitStream"/>.
  27. /// </remarks>
  28. /// <returns>The number of pad bits. In the range zero to seven.</returns>
  29. int PadBits { get; }
  30. }
  31. }
  32. #pragma warning restore
  33. #endif