summary refs log tree commit diff
path: root/crypto/src/asn1/BERSetParser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/BERSetParser.cs')
-rw-r--r--crypto/src/asn1/BERSetParser.cs42
1 files changed, 24 insertions, 18 deletions
diff --git a/crypto/src/asn1/BERSetParser.cs b/crypto/src/asn1/BERSetParser.cs
index aa9ccbc12..9da964c61 100644
--- a/crypto/src/asn1/BERSetParser.cs
+++ b/crypto/src/asn1/BERSetParser.cs
@@ -1,24 +1,30 @@
+using System;
+
 namespace Org.BouncyCastle.Asn1
 {
-	public class BerSetParser
-		: Asn1SetParser
-	{
-		private readonly Asn1StreamParser _parser;
+    public class BerSetParser
+        : Asn1SetParser
+    {
+        private readonly Asn1StreamParser _parser;
+
+        internal BerSetParser(Asn1StreamParser parser)
+        {
+            this._parser = parser;
+        }
 
-		internal BerSetParser(
-			Asn1StreamParser parser)
-		{
-			this._parser = parser;
-		}
+        public IAsn1Convertible ReadObject()
+        {
+            return _parser.ReadObject();
+        }
 
-		public IAsn1Convertible ReadObject()
-		{
-			return _parser.ReadObject();
-		}
+        public Asn1Object ToAsn1Object()
+        {
+            return Parse(_parser);
+        }
 
-		public Asn1Object ToAsn1Object()
-		{
-			return new BerSet(_parser.ReadVector(), false);
-		}
-	}
+        internal static BerSet Parse(Asn1StreamParser sp)
+        {
+            return new BerSet(sp.ReadVector());
+        }
+    }
 }