summary refs log tree commit diff
path: root/crypto/src/asn1/BerApplicationSpecific.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-11-12 01:54:30 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-11-12 01:54:30 +0700
commit8c32dba3fc4f2033e7597ee1999e793cf6552584 (patch)
treec48d45537cfbea6f7e0ab92de4793a2b35204573 /crypto/src/asn1/BerApplicationSpecific.cs
parentAdd new Equals method (diff)
downloadBouncyCastle.NET-ed25519-8c32dba3fc4f2033e7597ee1999e793cf6552584.tar.xz
Reimplement application-specific over tagged object
Diffstat (limited to 'crypto/src/asn1/BerApplicationSpecific.cs')
-rw-r--r--crypto/src/asn1/BerApplicationSpecific.cs44
1 files changed, 38 insertions, 6 deletions
diff --git a/crypto/src/asn1/BerApplicationSpecific.cs b/crypto/src/asn1/BerApplicationSpecific.cs
index 65fbecbe1..2a874984f 100644
--- a/crypto/src/asn1/BerApplicationSpecific.cs
+++ b/crypto/src/asn1/BerApplicationSpecific.cs
@@ -5,11 +5,43 @@ namespace Org.BouncyCastle.Asn1
 	public class BerApplicationSpecific
 		: DerApplicationSpecific
 	{
-		public BerApplicationSpecific(
-			int					tagNo,
-			Asn1EncodableVector	vec)
-			: base(tagNo, vec)
-		{
-		}
+        /**
+         * Create an application specific object with an explicit tag
+         *
+         * @param tagNo the tag number for this object.
+         * @param baseEncodable the object to be contained.
+         */
+        public BerApplicationSpecific(int tagNo, Asn1Encodable baseEncodable)
+            : this(true, tagNo, baseEncodable)
+        {
+        }
+
+        /**
+         * Create an application specific object with the tagging style given by the value of explicit.
+         *
+         * @param explicit true if the object is explicitly tagged.
+         * @param tagNo the tag number for this object.
+         * @param baseEncodable the object to be contained.
+         */
+        public BerApplicationSpecific(bool isExplicit, int tagNo, Asn1Encodable baseEncodable)
+            : base(new BerTaggedObject(isExplicit, Asn1Tags.Application, tagNo, baseEncodable))
+        {
+        }
+
+        /**
+         * Create an application specific object which is marked as constructed
+         *
+         * @param tagNo the tag number for this object.
+         * @param contentsElements the objects making up the application specific object.
+         */
+        public BerApplicationSpecific(int tagNo, Asn1EncodableVector contentsElements)
+            : base(new BerTaggedObject(false, Asn1Tags.Application, tagNo, BerSequence.FromVector(contentsElements)))
+        {
+        }
+
+        internal BerApplicationSpecific(Asn1TaggedObject taggedObject)
+            : base(taggedObject)
+        {
+        }
 	}
 }