title: How do I extract the public key from private key in c#?
body: <p>I <strong>only</strong> have a private key in a pem file and need to extract the public key from it.</p>
  
  <p>At the moment I'm using openssl for this:</p>
  
  <pre><code>openssl rsa -pubout -outform DER
  </code></pre>
  
  <p>Ho can I do the same in c# (and Bouncycastle)?</p>