0

Basically, the title: How do I add a Client Certificate and Private Key to the Users Store in Windows with C++?

I've found the function PFXImportCertStore which will let me load the cert and private key from a PKCS12 into a temporary cert store but I dont know how to save this store to the users store. The goal is to add a private key which other applications can access (for example, Outlook).

chacham15
  • 13,719
  • 26
  • 104
  • 207

1 Answers1

0

I needed to call CertAddCertificateContextToStore to put it in the store that I wanted.

chacham15
  • 13,719
  • 26
  • 104
  • 207
  • 1
    Can you explain what you did? I've tried everything under the sun, and I can't get the private key to show up in the certmgr store. If I take my crt and key and merge them into a pfx and run the windows import wizard for pfx it does exactly what I want, but I can't reproduce the effect programatically. – stu Sep 18 '18 at 20:42