diff options
Diffstat (limited to 'crypto/src/asn1/DERSetGenerator.cs')
-rw-r--r-- | crypto/src/asn1/DERSetGenerator.cs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/crypto/src/asn1/DERSetGenerator.cs b/crypto/src/asn1/DERSetGenerator.cs index 677241798..642744951 100644 --- a/crypto/src/asn1/DERSetGenerator.cs +++ b/crypto/src/asn1/DERSetGenerator.cs @@ -7,21 +7,22 @@ namespace Org.BouncyCastle.Asn1 { private readonly MemoryStream _bOut = new MemoryStream(); - public DerSetGenerator( - Stream outStream) + public DerSetGenerator(Stream outStream) : base(outStream) { } - public DerSetGenerator( - Stream outStream, - int tagNo, - bool isExplicit) + public DerSetGenerator(Stream outStream, int tagNo, bool isExplicit) : base(outStream, tagNo, isExplicit) { } - public override void AddObject(Asn1Encodable obj) + protected override void Finish() + { + WriteDerEncoded(Asn1Tags.Constructed | Asn1Tags.Set, _bOut.ToArray()); + } + + public override void AddObject(Asn1Encodable obj) { obj.EncodeTo(_bOut, Asn1Encodable.Der); } @@ -35,10 +36,5 @@ namespace Org.BouncyCastle.Asn1 { return _bOut; } - - public override void Close() - { - WriteDerEncoded(Asn1Tags.Constructed | Asn1Tags.Set, _bOut.ToArray()); - } } } |