summary refs log tree commit diff
path: root/crypto/src/asn1/BerApplicationSpecificParser.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-11-18 16:31:12 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-11-18 16:31:12 +0700
commit1ec8938ad4d5810c3f50957b85c7fe9a1e6a00b7 (patch)
tree7760d701bc4f114be2b18f02896cbfa0442f958b /crypto/src/asn1/BerApplicationSpecificParser.cs
parentASN.1: Port of bc-java TYPE instances (diff)
downloadBouncyCastle.NET-ed25519-1ec8938ad4d5810c3f50957b85c7fe9a1e6a00b7.tar.xz
ASN:1 tagged object parser updates from bc-java
Diffstat (limited to 'crypto/src/asn1/BerApplicationSpecificParser.cs')
-rw-r--r--crypto/src/asn1/BerApplicationSpecificParser.cs20
1 files changed, 5 insertions, 15 deletions
diff --git a/crypto/src/asn1/BerApplicationSpecificParser.cs b/crypto/src/asn1/BerApplicationSpecificParser.cs
index 7d2c4b3e8..899e76ca5 100644
--- a/crypto/src/asn1/BerApplicationSpecificParser.cs
+++ b/crypto/src/asn1/BerApplicationSpecificParser.cs
@@ -3,27 +3,17 @@ using System;
 namespace Org.BouncyCastle.Asn1
 {
 	public class BerApplicationSpecificParser
-		: IAsn1ApplicationSpecificParser
+		: BerTaggedObjectParser, IAsn1ApplicationSpecificParser
 	{
-		private readonly int tag;
-		private readonly Asn1StreamParser parser;
-
-		internal BerApplicationSpecificParser(
-			int					tag,
-			Asn1StreamParser	parser)
+		internal BerApplicationSpecificParser(int tagNo, Asn1StreamParser parser)
+            : base(Asn1Tags.Application, tagNo, true, parser)
 		{
-			this.tag = tag;
-			this.parser = parser;
 		}
 
 		public IAsn1Convertible ReadObject()
 		{
-			return parser.ReadObject();
-		}
-
-		public Asn1Object ToAsn1Object()
-		{
-			return new BerApplicationSpecific(tag, parser.ReadVector());
+            // NOTE: No way to say you're looking for an implicitly-tagged object via IAsn1ApplicationSpecificParser
+            return ParseBaseUniversal(true, -1);
 		}
 	}
 }