Home All Groups Group Topic Archive Search About

Exception in RSACryptoServiceProvider

Author
6 Apr 2007 12:13 AM
ajayleo
Hello

The following line of code throws an exception" The System Cannot find
the file specified".
This is on .Net 2.0.

RSA  rsaKey = new RSACryptoServiceProvider(); //Creating with Default
key


Appreciate the help
Thanks


rsaKey shows up as follows during debugging.


-rsaKey
{System.Security.Cryptography.RSACryptoServiceProvider}
     -base
{System.Security.Cryptography.RSACryptoServiceProvider}

     KeyExchangeAlgorithm    "RSA-PKCS1-KeyEx"

     - KeySize      ((System.Security.Cryptography.AsymmetricAlgorithm)
(rsaKey)).KeySize'
                              threw an exception of type

'System.Security.Cryptography.CryptographicException'

     +base            {"The system cannot find the file specified.\r\n"}

Author
6 Apr 2007 3:15 AM
Latish Sehgal
Is this a web app or Win Forms?
The associated account for the app should have rights over the key
store so that the key can be created.

There are already a couple of similar threads out there.
Check out
http://groups.google.com/group/microsoft.public.dotnet.security/browse_thread/thread/c10f7a649d751fe4/1b90345a0e2c2bee%231b90345a0e2c2bee
http://www.derkeiler.com/Newsgroups/microsoft.public.dotnet.framework.aspnet.security/2002-06/0062.html

Latish

AddThis Social Bookmark Button