summary refs log tree commit diff
path: root/crypto/src/asn1/x9/X9FieldID.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x9/X9FieldID.cs')
-rw-r--r--crypto/src/asn1/x9/X9FieldID.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/crypto/src/asn1/x9/X9FieldID.cs b/crypto/src/asn1/x9/X9FieldID.cs
index 58823a285..08d7d71b4 100644
--- a/crypto/src/asn1/x9/X9FieldID.cs
+++ b/crypto/src/asn1/x9/X9FieldID.cs
@@ -90,11 +90,19 @@ namespace Org.BouncyCastle.Asn1.X9
             this.parameters = new DerSequence(fieldIdParams);
         }
 
-        internal X9FieldID(
-            Asn1Sequence seq)
+        private X9FieldID(Asn1Sequence seq)
         {
-            this.id = (DerObjectIdentifier) seq[0];
-            this.parameters = (Asn1Object) seq[1];
+            this.id = DerObjectIdentifier.GetInstance(seq[0]);
+            this.parameters = seq[1].ToAsn1Object();
+        }
+
+        public static X9FieldID GetInstance(object obj)
+        {
+            if (obj is X9FieldID)
+                return (X9FieldID)obj;
+            if (obj == null)
+                return null;
+            return new X9FieldID(Asn1Sequence.GetInstance(obj));
         }
 
         public DerObjectIdentifier Identifier