A little new to windows programming/C++. I'm trying to install a .p7b root certificate file to the Trusted Root Certificate Store. I want to use the Windows Wincrypt library. Specifically, these are the suggested steps that I got from an old forum:
- Call
CertCreateCertificateContext
using your certificate content bytes in order to obtain aPCCERT_CONTEXT
- Call
CertOpenSystemStore
withszSubsystemProtocol
set to "ROOT" in order to obtain aHCERTSTORE
- Call
CertAddCertificateContextToStore
using the aboveHCERTSTORE
andPCCERT_CONTEXT
.
[Here's] the api documentation for CertCreateCertificateContext. Not sure how to just point pbCertEncoded
to my actual cert file. Should I just point it to the path? Do I have to load the cert in? What should the type be?