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.cs30
1 files changed, 4 insertions, 26 deletions
diff --git a/crypto/src/asn1/DerBitString.cs b/crypto/src/asn1/DerBitString.cs
index bc3de7fe4..f543a968d 100644
--- a/crypto/src/asn1/DerBitString.cs
+++ b/crypto/src/asn1/DerBitString.cs
@@ -31,11 +31,6 @@ namespace Org.BouncyCastle.Asn1
         private static readonly char[] table
 			= { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
 
-        /**
-		 * return a Bit string from the passed in object
-		 *
-		 * @exception ArgumentException if the object cannot be converted.
-		 */
 		public static DerBitString GetInstance(object obj)
 		{
             if (obj == null)
@@ -65,27 +60,10 @@ namespace Org.BouncyCastle.Asn1
             throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj));
 		}
 
-		/**
-		 * return a Bit string from a tagged object.
-		 *
-		 * @param obj the tagged object holding the object we want
-		 * @param explicitly true if the object is meant to be explicitly
-		 *              tagged false otherwise.
-		 * @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;