New tests.
[mono.git] / mcs / class / corlib / System.Security.Cryptography / CryptoConfig_2_1.cs
index fd5172a862d08ab1ec1a78c1c63b26be617dacee..657c7aa4368ff0085f29607983b418fae532c55d 100644 (file)
@@ -35,10 +35,8 @@ namespace System.Security.Cryptography {
 
                public static byte[] EncodeOID (string str)
                {
-#if NET_2_0
                        if (str == null)
                                throw new ArgumentNullException ("str");
-#endif
                        char[] delim = { '.' };
                        string[] parts = str.Split (delim);
                        // according to X.208 n is always at least 2
@@ -126,10 +124,12 @@ namespace System.Security.Cryptography {
                        }
                        return num;
                }
-#if NET_2_1
-               // not (really) required for Moonlight
+#if MOONLIGHT
+               // we need SHA1 support to verify the codecs binary integrity
                public static string MapNameToOID (string name)
                {
+                       if ((name != null) && name.Contains ("SHA1"))
+                               return "1.3.14.3.2.26";
                        return String.Empty;
                }
 
@@ -141,6 +141,8 @@ namespace System.Security.Cryptography {
                        case "System.Security.Cryptography.SHA1":
                        case "SHA1":
                                return new SHA1Managed ();
+                       case "SHA256":
+                               return new SHA256Managed ();
                        case "System.Security.Cryptography.MD5":
                        case "MD5":
                                return new MD5CryptoServiceProvider ();