Re: RSACryptoServiceProvider() - How to avoid auto key generation

From: Kim Hellan (khe@NOkmdSPAM.dk)
Date: 01/13/03


From: "Kim Hellan" <khe@NOkmdSPAM.dk>
Date: Mon, 13 Jan 2003 10:59:28 +0100


So I guess I should have a dummy CspParameters object that I can use
everytime I call the RSACryptoServiceProvider() constructor? That should
prevent a key generation.
I have checked the help files, but CspParameters works on
containers/providers and the docs only refer to the MS CAPI documentation.
I don't suppose that you have an example on how to make
RSACryptoServiceProvider object with a dummy CspParameters object in the
constructor?

Thanks,
Kim

NB!
I guess you guys have a good reason why you by design can't create an empty
RSACryptoServiceProvider, though I can't see why. What would be really
helpfull was if you also implemented this constructor:
RSACryptoServiceProvider(string xmlkey). Since the is a
RSACryptoServiceProvider.FromXMLString, it should also be possible to load
this XML key in the constructor thereby preventing the auto key generation.

"Xiao Xie [MSFT]" <xiaoxie@online.microsoft.com> wrote in message
news:LhGW$6quCHA.2276@cpmsftngxa09...
> It is by design that the default constructor will always generate a key
> pair based on default CspParameters values. You can have constructor to
use
> predefined keys by using other overloads of the constructor, like:
>
> public RSACryptoServiceProvider(int, CspParameters);
>
> Sincerely,
> Xiao Xie
> Microsoft Developer Support