resolve darcs stupidity
[org.ibex.core.git] / src / org / bouncycastle / asn1 / x509 / RSAPublicKeyStructure.java
index b792fe1..b390245 100644 (file)
@@ -11,6 +11,29 @@ public class RSAPublicKeyStructure
     private BigInteger  modulus;
     private BigInteger  publicExponent;
 
+    public static RSAPublicKeyStructure getInstance(
+        ASN1TaggedObject obj,
+        boolean          explicit)
+    {
+        return getInstance(ASN1Sequence.getInstance(obj, explicit));
+    }
+
+    public static RSAPublicKeyStructure getInstance(
+        Object obj)
+    {
+        if(obj == null || obj instanceof RSAPublicKeyStructure) 
+        {
+            return (RSAPublicKeyStructure)obj;
+        }
+        
+        if(obj instanceof ASN1Sequence) 
+        {
+            return new RSAPublicKeyStructure((ASN1Sequence)obj);
+        }
+        
+        throw new IllegalArgumentException("Invalid RSAPublicKeyStructure: " + obj.getClass().getName());
+    }
+    
     public RSAPublicKeyStructure(
         BigInteger  modulus,
         BigInteger  publicExponent)
@@ -20,7 +43,7 @@ public class RSAPublicKeyStructure
     }
 
     public RSAPublicKeyStructure(
-        DERConstructedSequence  seq)
+        ASN1Sequence  seq)
     {
         Enumeration e = seq.getObjects();