summary refs log tree commit diff
path: root/crypto/src/asn1/DerBitString.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/DerBitString.cs')
-rw-r--r--crypto/src/asn1/DerBitString.cs16
1 files changed, 4 insertions, 12 deletions
diff --git a/crypto/src/asn1/DerBitString.cs b/crypto/src/asn1/DerBitString.cs
index bc3de7fe4..caa97933f 100644
--- a/crypto/src/asn1/DerBitString.cs
+++ b/crypto/src/asn1/DerBitString.cs
@@ -74,18 +74,10 @@ namespace Org.BouncyCastle.Asn1
 		 * @exception ArgumentException if the tagged object cannot
 		 *               be converted.
 		 */
-		public static DerBitString GetInstance(Asn1TaggedObject obj, bool isExplicit)
-		{
-			Asn1Object o = obj.GetObject();
-
-			if (isExplicit || o is DerBitString)
-			{
-				return GetInstance(o);
-			}
-
-            // Not copied because assumed to be a tagged implicit primitive from the parser
-			return CreatePrimitive(((Asn1OctetString)o).GetOctets());
-		}
+        public static DerBitString GetInstance(Asn1TaggedObject obj, bool isExplicit)
+        {
+            return (DerBitString)Meta.Instance.GetContextInstance(obj, isExplicit);
+        }
 
         internal readonly byte[] contents;