summary refs log tree commit diff
path: root/crypto/src/asn1/BERSetParser.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-10-15 16:10:37 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-10-15 16:10:37 +0700
commit2e690b9bb3da422608a86f70fc9090923b398694 (patch)
tree6f2a7da682fce10b58d8615e86ba5d2ef4d882fe /crypto/src/asn1/BERSetParser.cs
parentReplace Obsolete tag (diff)
downloadBouncyCastle.NET-ed25519-2e690b9bb3da422608a86f70fc9090923b398694.tar.xz
Refactor ASN.1 parsers
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());
+        }
+    }
 }