title: how to decrypt an encrypted text using RSACryptoServiceProvider?
body: <p>I have encrypted a text using RSACryptoServiceProvider. I exported the public and private key. Obviously I just want to expose the public key inside the decoder application, so I have written a code as follows : </p>
  
  <pre><code>private const string PublicKey = "&lt;RSAKeyValue&gt;&lt;Modulus&gt;sIzQmj4vqK0QPd7RXKigD7Oi4GKPwvIPoiUyiKJMGP0qcbUkRPioe2psE/d3c1a2NY9oj4Da2y1qetjvKKFad2QAhXuql/gPIb1WmI+f6q555GClvHWEjrJrD/ho7SLoHbWd6oY6fY609N28lWJUYO97RLVaeg2jfNAUSu5bGC8=&lt;/Modulus&gt;&lt;Exponent&gt;AQAB&lt;/Exponent&gt;&lt;/RSAKeyValue&gt;";
  
  private string Decrypt()
          {
              byte[] encryptedKeyAsBytes = Convert.FromBase64String(_encryptedKey);
              RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
              rsa.FromXmlString(PublicKey);
              // read ciphertext, decrypt it to plaintext
              byte[] plainBytes = rsa.Decrypt(encryptedKeyAsBytes, false);
              string plainText = System.Text.Encoding.ASCII.GetString(plainBytes);
  
              return plainText;
          }
  </code></pre>
  
  <p>But an exception is thrown at line "byte[] plainBytes = rsa.Decrypt(encryptedKeyAsBytes, false);"
  and says "Key does not exist." However if I expose the whole private and public key then it runns happily. So how can I decrypt the data using only the public key information?</p>