[ExpectedException (typeof (CryptographicException))]
public void TooSmallKeyPair ()
{
- rsa = new RSACryptoServiceProvider (256);\r
-#if NET_2_0\r
- // in 2.0 MS delay the creation of the key pair until it is required\r
- // (same trick that Mono almost always used ;-) but they also delay\r
- // the parameter validation (what Mono didn't). So here we must "get"\r
- // the key (export) to trigger the exception\r
- rsa.ToXmlString (true);\r
-#endif\r
+ rsa = new RSACryptoServiceProvider (256);
+#if NET_2_0
+ // in 2.0 MS delay the creation of the key pair until it is required
+ // (same trick that Mono almost always used ;-) but they also delay
+ // the parameter validation (what Mono didn't). So here we must "get"
+ // the key (export) to trigger the exception
+ rsa.ToXmlString (true);
+#endif
}
[Test]
[ExpectedException (typeof (CryptographicException))]
public void TooBigKeyPair ()
{
- rsa = new RSACryptoServiceProvider (32768);\r
-#if NET_2_0\r
- // in 2.0 MS delay the creation of the key pair until it is required\r
- // (same trick that Mono almost always used ;-) but they also delay\r
- // the parameter validation (what Mono didn't). So here we must "get"\r
- // the key (export) to trigger the exception\r
- rsa.ToXmlString (true);\r
-#endif\r
+ rsa = new RSACryptoServiceProvider (32768);
+#if NET_2_0
+ // in 2.0 MS delay the creation of the key pair until it is required
+ // (same trick that Mono almost always used ;-) but they also delay
+ // the parameter validation (what Mono didn't). So here we must "get"
+ // the key (export) to trigger the exception
+ rsa.ToXmlString (true);
+#endif
}
[Test]
rsa = new RSACryptoServiceProvider (minKeySize);
rsa.VerifyHash (hash, null, sign);
}
-#endif\r
-\r
+#endif
+
[Test]
[ExpectedException (typeof (ObjectDisposedException))]
public void SignHashDisposed ()
byte[] hash = new byte [20];
rsa = new RSACryptoServiceProvider (minKeySize);
rsa.VerifyHash (hash, "1.3.14.3.2.26", null);
- }\r
-\r
-#if NET_2_0\r
+ }
+
+#if NET_2_0
[Test]
[Category ("NotWorking")]
public void ImportDisposed ()
{
rsa = new RSACryptoServiceProvider (minKeySize);
CspKeyContainerInfo info = rsa.CspKeyContainerInfo;
- Assert ("Accessible", info.Accessible);\r
-// FIXME AssertNotNull ("CryptoKeySecurity", info.CryptoKeySecurity);\r
- Assert ("Exportable", info.Exportable);\r
+ Assert ("Accessible", info.Accessible);
+// FIXME AssertNotNull ("CryptoKeySecurity", info.CryptoKeySecurity);
+ Assert ("Exportable", info.Exportable);
Assert ("HardwareDevice", !info.HardwareDevice);
AssertNotNull ("KeyContainerName", info.KeyContainerName);
AssertEquals ("KeyNumber", KeyNumber.Exchange, info.KeyNumber);
- Assert ("MachineKeyStore", !info.MachineKeyStore);\r
- Assert ("Protected", !info.Protected);\r
+ Assert ("MachineKeyStore", !info.MachineKeyStore);
+ Assert ("Protected", !info.Protected);
AssertNotNull ("ProviderName", info.ProviderName);
AssertEquals ("ProviderType", 1, info.ProviderType);
Assert ("RandomlyGenerated", info.RandomlyGenerated);
- Assert ("Removable", !info.Removable);\r
- AssertNotNull ("UniqueKeyContainerName", info.UniqueKeyContainerName);\r
+ Assert ("Removable", !info.Removable);
+ AssertNotNull ("UniqueKeyContainerName", info.UniqueKeyContainerName);
}
[Test]
RSAParameters rsap = AllTests.GetRsaKey (true);
rsa.ImportParameters (rsap);
CspKeyContainerInfo info = rsa.CspKeyContainerInfo;
- Assert ("Accessible", info.Accessible);\r
-// FIXME AssertNotNull ("CryptoKeySecurity", info.CryptoKeySecurity);\r
+ Assert ("Accessible", info.Accessible);
+// FIXME AssertNotNull ("CryptoKeySecurity", info.CryptoKeySecurity);
Assert ("Exportable", info.Exportable);
Assert ("HardwareDevice", !info.HardwareDevice);
AssertNotNull ("KeyContainerName", info.KeyContainerName);
RSAParameters rsap = AllTests.GetRsaKey (false);
rsa.ImportParameters (rsap);
CspKeyContainerInfo info = rsa.CspKeyContainerInfo;
- Assert ("Accessible", !info.Accessible);\r
- // info.CryptoKeySecurity throws a CryptographicException at this stage\r
+ Assert ("Accessible", !info.Accessible);
+ // info.CryptoKeySecurity throws a CryptographicException at this stage
// info.Exportable throws a CryptographicException at this stage
Assert ("HardwareDevice", !info.HardwareDevice);
AssertNotNull ("KeyContainerName", info.KeyContainerName);