title: Export private key from X509Certificate object
body: <p>We use C# code we build X509Certificate2 with .p12 file, in the constructor we insert the path to certificate, certificate's password. We also marked it as Exportable as shown below:</p>
  
  <pre><code>X509Certificate2 x509Certificate2 = new X509Certificate2
  ("...\\MyCerificate.p12", "P@ssw0rd", X509KeyStorageFlags.Exportable);
  </code></pre>
  
  <p>we get the private key as AsymmetricAlgorithm format by the following:</p>
  
  <pre><code>x509Certificate2.PrivateKey
  </code></pre>
  
  <p>Now, we want to get the private key from the certificate as <em>Base64</em> format - but we don't have any idea how to do it, and its so important for us.</p>