I generated a private key and a public key from a website and so I have my keys as string.
I would like to use them to encrypt and decrypt data. However, I can't find any solution that explain how to do that properly.
Using only the System.Security.Cryptography
namespace (I can't use other librairies).
I understand I have to set, in an RSAParameter
object, my keys. However, how can I do that from raw string keys? The documentation (and mostly 100% of the solutions I found on internet) generates keys using the RSA classe(s) of .Net, but don't explain how to encrypt/decrypt using already generated keys.
So, basically:
How to encrypt/decrypt data using the System.Security.Cryptography
namespace with the RSA algorithm and already generated keys (as strings)?