I have:
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
And any of them:
byte[] Csp = rsa.ExportCspBlob(true); RSAParameters parameters = rsa.ExportParameters(true);
What is the correct way to save them and what file extension should I use? Note. I do not mean how to encrypt them. How to store them.
I would just use it RSACryptoServiceProvider.PersistKeyInCsp = true. Make sue that CspParameters.KeyContainerNamecontains a unique identifiable name for the key.
RSACryptoServiceProvider.PersistKeyInCsp = true
CspParameters.KeyContainerName
To transfer the public key, use export to Xml.
Xml