title: Convert pem rsa key to xml for C# RSACryptoServiceProvider.FromXmlString
body: <p>I generating RSA public and private key with PHP:</p>
  
  <pre><code>function genKeys($pkey, $skey)
  {
      $pkGenerate = openssl_pkey_new(array(
          'private_key_bits' =&gt; 2048,
          'private_key_type' =&gt; OPENSSL_KEYTYPE_RSA
      ));
  
      $pkGeneratePrivate = null;
      openssl_pkey_export($pkGenerate, $pkGeneratePrivate);
  
      $pkGenerateDetails = openssl_pkey_get_details($pkGenerate);
      $pkGeneratePublic  = $pkGenerateDetails['key'];
  
      openssl_pkey_free($pkGenerate);
  
      $pkImport        = openssl_pkey_get_private($pkGeneratePrivate);
      $pkImportDetails = openssl_pkey_get_details($pkImport);
      $pkImportPublic  = $pkImportDetails['key'];
  
      openssl_pkey_free($pkImport);
  
      $result = (bool) strcmp($pkGeneratePublic, $pkImportPublic);
  
      if ($result) {
          file_put_contents($pkey, $pkGeneratePrivate);
          file_put_contents($skey, $pkGeneratePublic);
      }
  
      return $result;
  
  }
  </code></pre>
  
  <p>And I need use PEM file with RSACryptoServiceProvider.</p>
  
  <p>So, how to convert PEM public and private to XML?</p>