DERSetGenerator.cs 752 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System.IO;
  3. namespace Org.BouncyCastle.Asn1
  4. {
  5. public class DerSetGenerator
  6. : DerGenerator
  7. {
  8. private readonly MemoryStream _bOut = new MemoryStream();
  9. public DerSetGenerator(
  10. Stream outStream)
  11. : base(outStream)
  12. {
  13. }
  14. public DerSetGenerator(
  15. Stream outStream,
  16. int tagNo,
  17. bool isExplicit)
  18. : base(outStream, tagNo, isExplicit)
  19. {
  20. }
  21. public override void AddObject(
  22. Asn1Encodable obj)
  23. {
  24. new DerOutputStream(_bOut).WriteObject(obj);
  25. }
  26. public override Stream GetRawOutputStream()
  27. {
  28. return _bOut;
  29. }
  30. public override void Close()
  31. {
  32. WriteDerEncoded(Asn1Tags.Constructed | Asn1Tags.Set, _bOut.ToArray());
  33. }
  34. }
  35. }
  36. #endif