views:

185

answers:

1

I'm trying to use the DSACryptoServiceProvider class with C# to create two DLLs: one will have the ability to verify and create digital signatures, the other will just be able to verify. Basically, I'm trying to create a private/public key pair and save they keys accordingly (to a file).

I'm running into problems when using ExportParameters(). When I attempt to export the key containing the private information (using serialize), the private information is automatically nulled out.

Is there a better way to store the keys?

Thanks in advance.

+2  A: 

Look here:

http://msdn.microsoft.com/en-us/library/system.security.cryptography.dsacryptoserviceprovider.exportparameters%28VS.80%29.aspx

I think what you want to do is:

ExportParameters(true)

The 'true' means it'll export the private parts

Chris