summary refs log tree commit diff
path: root/crypto/src/asn1/cms/MetaData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/cms/MetaData.cs')
-rw-r--r--crypto/src/asn1/cms/MetaData.cs27
1 files changed, 15 insertions, 12 deletions
diff --git a/crypto/src/asn1/cms/MetaData.cs b/crypto/src/asn1/cms/MetaData.cs
index 6435d4d2e..a0d783d59 100644
--- a/crypto/src/asn1/cms/MetaData.cs
+++ b/crypto/src/asn1/cms/MetaData.cs
@@ -5,7 +5,21 @@ namespace Org.BouncyCastle.Asn1.Cms
 	public class MetaData
 		: Asn1Encodable
 	{
-		private DerBoolean hashProtected;
+        public static MetaData GetInstance(object obj)
+        {
+			if (obj == null)
+				return null;
+			if (obj is MetaData metaData)
+				return metaData;
+            return new MetaData(Asn1Sequence.GetInstance(obj));
+        }
+
+        public static MetaData GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
+        {
+            return new MetaData(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
+        }
+
+        private DerBoolean hashProtected;
 		private DerUtf8String fileName;
 		private DerIA5String  mediaType;
 		private Attributes otherMetaData;
@@ -44,17 +58,6 @@ namespace Org.BouncyCastle.Asn1.Cms
 			}
 		}
 
-		public static MetaData GetInstance(object obj)
-		{
-			if (obj is MetaData)
-				return (MetaData)obj;
-
-			if (obj != null)
-				return new MetaData(Asn1Sequence.GetInstance(obj));
-
-			return null;
-		}
-
 		/**
 		 * <pre>
 		 * MetaData ::= SEQUENCE {