title: How to pair a ECDSA public key to it's private key
body: <p>I've created an ECDSA CSR using certreq, now I want to import the certificate into my local store and pair it with the private key. I can import RSA public keys and pair them up no problem, and can import ECDSA certificates but they lack their private key...</p>
  
  <p>I've looked into all kinds of methods and properties on every class I could see - None of them seem to have a straightforward way to "set" the private key when it's ECDsa - One promising method is the "ECDsaCertificateExtensions.CopyWithPrivateKey" method - but this shows up as not having a definition, and I'd rather not force people using this to download other versions of .net, etc. ( I'm using Windows 10 )</p>
  
  <pre><code>certificate.PrivateKey = foundCSR.PrivateKey;
  </code></pre>
  
  <p>Works just fine for setting RSA private keys once I've found the CSR within the system. Trying that when it's an ECDsa key throws an error "Only asymmetric keys that implement ICspAsymmetricAlgorithm are supported"</p>
  
  <p>Trying to get this key into a RSACryptoProvider blob is no good because it's not RSA-based (I'm assuming) - GetECDsaPrivateKey method only gets that key - is there an equivalent to SetECDsaPrivateKey?</p>
  
  <p>( I'd also be open to using other ways to get the functionality of certreq -accept - This is basically the goal, import certificate, pair it to it's private key, delete csr )</p>