title: get private key with dotnet core on linux
body: <p>I have a program that find a certificate into a store, and test if the rsa private key is present.</p>
  
  <pre><code>var store = (StoreName.CertificateAuthority, StoreLocation.LocalMachine);
  store.Open(OpenFlags.ReadOnly);
  X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindByThumbprint, "a02274af4e74defc0bf2ffb45e2d90bdbb1282f9", false);
  
  if (certs.Count &gt; 0)
  {
      Console.WriteLine("Cert found");
      X509Certificate2 cert = certs[0];
      var rsa = cert.GetRSAPrivateKey();
      if (rsa == null)
          Console.WriteLine("rsa failed");
      else
          Console.WriteLine("rsa ok");
  }
  </code></pre>
  
  <p>On Windows everything is fine with the certificate in pfx installed into the store.</p>
  
  <p>On linux, the certificate is found, but the private key is not.
  I used this SO answer to convert my pfx to crt file : <a href="https://stackoverflow.com/a/16724275/1083225">https://stackoverflow.com/a/16724275/1083225</a>
  and I put the crt file into <code>/usr/local/share/ca-certificates</code>, and executed <code>update-ca-certificates</code>
  If I look into the crt file, the rsa is present.</p>
  
  <p>It's a .NETCoreApp 1.1</p>