rsa.VerifyHash (hash, "1.3.14.3.2.26", null);
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")]
public void ImportDisposed ()
rsa.ToXmlString (true);
}
+ [Test]
+ [ExpectedException (typeof (CryptographicException))]
+ public void ExportWithoutCRT_2 ()
+ {
+ try {
+ rsa = new RSACryptoServiceProvider ();
+ rsa.FromXmlString (MonoXml384woCRT);
+ }
+ catch {
+ }
+ // exception is HERE!
+ rsa.ExportParameters (true);
+ }
+
// Validate that we can sign with every keypair and verify the signature
// With Windows this means that we can use Mono keypairs to sign and verify.
// For Mono this doesn't mean much.
Assert.IsNotNull (r.Decrypt (bytes, true));
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")]
public void CspKeyContainerInfo_NewKeypair ()
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));
+ }
}
}