Too many MachineKeys ?
C#
1
Posts
1
Posters
0
Views
1
Watching
-
I've written a Web Service which encrypts files via the RSACryptoServiceProvider. Everything is going great with the code except that I am experiencing a build up of key files in my Crypto\RSA\MachineKeys directory. I have verified that it is because every call to the WebService creates a new instance of RSACryptoServiceProvider which creates a new Key. I am using the FromXmlString method to restore a previously used Key Pair which I persist to a file between calls to the Web Service. This only occurs after I have created the new instance of RSACryptoServiceProvider though so the new key is already created. Is this something I need to worry about? Will Windows clean this directory from time to time or am I doing somthing wrong ?