Reputation: 59336
As explained in the MSDN, it is possible to generate new public/private keys by calling the method DSACryptoServiceProvider.ExportParameters
. The result of this method is of type DSAParameters
.
What is the de facto standard on dealing with these keys? Should I generate new keys for each transaction or should I generate keys once, store them and reuse them ad eternum?
If it's better to keep them, how do I store these keys?
EDIT:
There's a previous homonymous question but the accepted answer does not answer the question.
Upvotes: 1
Views: 1023
Reputation: 273274
Should I generate new keys for each transaction or should I generate keys once
Depends entirely on the situation/application.
how do I store these keys
DsaParameters is Serializable so you can read/write it as XML (SoapFormatter).
And the DSACryptoServiceProvider class itself has ToXml/FromXml members. Iirc this can also be used to store/restore the keys.
Upvotes: 2