Skip to content

Commit

Permalink
[ios] Add, as a last resort, the creation of the hash based on it's t…
Browse files Browse the repository at this point in the history
…ype name. Needed for some API (which provides it) and the associated unit tests
  • Loading branch information
spouliot committed May 28, 2013
1 parent ec5a3f0 commit 5c9cedd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mcs/class/Mono.Security/Mono.Security.Cryptography/PKCS1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,12 @@ static internal HashAlgorithm CreateFromName (string name)
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);
Expand Down

0 comments on commit 5c9cedd

Please sign in to comment.