title: Find the public and private keys using RSACryptoServiceProvider in c#
body: <p>I have the following code.</p>
  
  <pre><code>RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
  //Save the public key information to an RSAParameters structure.
  RSAParameters RSAKeyInfo = RSA.ExportParameters(true);
  
  byte[] toEncryptData = Encoding.ASCII.GetBytes("hello world");
  byte[] encryptedRSA = RSAEncrypt(toEncryptData, RSAKeyInfo, false);
  string EncryptedResult = System.Text.Encoding.Default.GetString(encryptedRSA);
  
  byte[] decryptedRSA = RSADecrypt(encryptedRSA, RSAKeyInfo, false);
  string originalResult = System.Text.Encoding.Default.GetString(decryptedRSA);
  return userDetails.ToString();
  </code></pre>
  
  <p>When I use the RSAEncrypt method it takes the parameter "RSAKeyInfo" (Public key for encryption and Private key for decryption).</p>
  
  <p>How can I get the value of private and public keys, which this method used for encryption and decryption.</p>
  
  <p>Thanks,</p>