Merge pull request #5636 from BrzVlad/fix-xmm-scan
[mono.git] / mcs / class / corlib / Test / System.Security.Cryptography / RSACryptoServiceProviderTest.cs
index 8a20b9add458b2d2ed9ff7c097f7a140479c7215..c9011cb41f6f9a37736eb9d0ba9e89d39e203b67 100644 (file)
@@ -420,7 +420,7 @@ public class RSACryptoServiceProviderTest {
                rsa.VerifyHash (hash, "1.3.14.3.2.26", null);
        }
 
-#if !NET_2_1
+#if !MOBILE
        [Test]
        [Category ("NotWorking")]
        public void ImportDisposed ()
@@ -1161,7 +1161,7 @@ public class RSACryptoServiceProviderTest {
                Assert.IsNotNull (r.Decrypt (bytes, true));
        }
 
-#if !NET_2_1
+#if !MOBILE
        [Test]
        [Category ("NotWorking")]
        public void CspKeyContainerInfo_NewKeypair ()
@@ -1403,6 +1403,16 @@ public class RSACryptoServiceProviderTest {
                rsa = new RSACryptoServiceProvider (minKeySize);
                rsa.ImportCspBlob (blob);
        }
+
+       [Test] //bug 38054
+       public void NonExportableKeysAreNonExportable ()
+       {
+               var cspParams = new CspParameters();
+               cspParams.KeyContainerName = "TestRSAKey";
+               cspParams.Flags = CspProviderFlags.UseNonExportableKey;
+               var rsa = new RSACryptoServiceProvider(cspParams);
+               Assert.Throws<CryptographicException>(() => rsa.ExportParameters(true));
+       }
 }
 
 }