I have a public key and a private key and also a string which I want to decrypt.
The public key is in this format:
-----BEGIN PUBLIC KEY-----
(key here)
-----END PUBLIC KEY-----
The private key is in this format:
-----BEGIN RSA PRIVATE KEY-----
(key here)
-----END RSA PRIVATE KEY-----
The string I want to decrypt has been encrypted using the public key and then I need to decrypt it using the private key.
I was wondering how I would go about doing this.
I have been researching this and have found RSACryptoServiceProvider
but for encryption/decryption that seems to want the key to be in an XML format with a modulus and exponent.
My question is, is there a way to generate the XML format with modulus and exponent using the data I have or is there another way I can decrypt the string using the data I have.