New tests.
[mono.git] / mcs / class / corlib / System.Security.Cryptography / RSACryptoServiceProvider.cs
index 6f0e36261670cb17afaf604052f01defd30f59b7..ef607bc5fd28b0274dfcca13685009223baf6f17 100644 (file)
@@ -29,6 +29,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !MOONLIGHT
+
 using System.IO;
 using System.Runtime.InteropServices;
 
@@ -36,12 +38,8 @@ using Mono.Security.Cryptography;
 
 namespace System.Security.Cryptography {
 
-#if NET_2_0
        [ComVisible (true)]
        public sealed class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm {
-#else
-       public sealed class RSACryptoServiceProvider : RSA {
-#endif
                private const int PROV_RSA_FULL = 1;    // from WinCrypt.h
 
                private KeyPairPersistence store;
@@ -152,13 +150,8 @@ namespace System.Security.Cryptography {
                        }
                }
 
-#if (NET_2_0)
                [ComVisible (false)]
-               public 
-#else
-               internal
-#endif
-               bool PublicOnly {
+               public bool PublicOnly {
                        get { return rsa.PublicOnly; }
                }
        
@@ -297,14 +290,8 @@ namespace System.Security.Cryptography {
                {
                        if (rgbHash == null)
                                throw new ArgumentNullException ("rgbHash");
-#if NET_2_0
                        // Fx 2.0 defaults to the SHA-1
                        string hashName = (str == null) ? "SHA1" : GetHashNameFromOID (str);
-#else
-                       if (str == null)
-                               throw new CryptographicException (Locale.GetText ("No OID specified"));
-                       string hashName = GetHashNameFromOID (str);
-#endif
                        HashAlgorithm hash = HashAlgorithm.Create (hashName);
                        return PKCS1.Sign_v15 (this, hash, rgbHash);
                }
@@ -313,10 +300,8 @@ namespace System.Security.Cryptography {
                // HashAlgorithm descendant
                public bool VerifyData (byte[] buffer, object halg, byte[] signature) 
                {
-#if NET_1_1
                        if (buffer == null)
                                throw new ArgumentNullException ("buffer");
-#endif
                        if (signature == null)
                                throw new ArgumentNullException ("signature");
 
@@ -335,14 +320,8 @@ namespace System.Security.Cryptography {
                                throw new ArgumentNullException ("rgbHash");
                        if (rgbSignature == null)
                                throw new ArgumentNullException ("rgbSignature");
-#if NET_2_0
                        // Fx 2.0 defaults to the SHA-1
                        string hashName = (str == null) ? "SHA1" : GetHashNameFromOID (str);
-#else
-                       if (str == null)
-                               throw new CryptographicException (Locale.GetText ("No OID specified"));
-                       string hashName = GetHashNameFromOID (str);
-#endif
                        HashAlgorithm hash = HashAlgorithm.Create (hashName);
                        return PKCS1.Verify_v15 (this, hash, rgbHash, rgbSignature);
                }
@@ -374,7 +353,6 @@ namespace System.Security.Cryptography {
                                persisted = true;
                        }
                }
-#if NET_2_0
                // ICspAsymmetricAlgorithm
 
                [MonoTODO ("Always return null")]
@@ -425,6 +403,8 @@ namespace System.Security.Cryptography {
                                }
                        }
                }
-#endif
        }
 }
+
+#endif
+