[ios] Add, as a last resort, the creation of the hash based on it's type name. Needed...
authorSebastien Pouliot <sebastien@xamarin.com>
Tue, 28 May 2013 23:35:12 +0000 (19:35 -0400)
committerSebastien Pouliot <sebastien@xamarin.com>
Tue, 28 May 2013 23:35:27 +0000 (19:35 -0400)
mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS1.cs

index d26a02ea69168c8e049ce0f2920c2b9563685533..aad30c1323bdccc52c96efbe1f54537c9b9175ca 100644 (file)
@@ -478,7 +478,12 @@ namespace Mono.Security.Cryptography {
                        case "RIPEMD160":
                                return RIPEMD160.Create ();
                        default:
-                               throw new CryptographicException ("Unsupported hash algorithm: " + name);
+                               try {
+                                       return (HashAlgorithm) Activator.CreateInstance (Type.GetType (name));
+                               }
+                               catch {
+                                       throw new CryptographicException ("Unsupported hash algorithm: " + name);
+                               }
                        }
 #else
                        return HashAlgorithm.Create (name);