CERT_FIND_SUBJECT_CERT (not "CERT_FIND_SUBJECT_CERT") should be defined in wincrypt.h
How to correctly use CertFindCertificateInStore with needed parameters
I marked the other question as solved because I figured that just knowing what function to use is enough for it. But I still need to know how to correctly use that function and how to pass it the information I need to pass it, so I decided to open a new thread since I wasn't getting a reply in the other one about it. I'm sorry if anyone has a problem with me doing this.
The certificates (it's a chain of two) I want to find use an encoding of SHA256. It apparently hasn't been defined so I can't tell the function to use it, but I don't know how to specify the encoding anyway. Is there an Enum I can use? What is that Enum and what member should I use from it?
What do I pass for dwFindFlags
for the below dwFindType
value that I want to use?
The dwFindType
value I want to use is CERT_FIND_SUBJECT_CERT
. How do I specify the specify "CERT_FIND_SUBJECT_CERT"
as the argument for the parameter? It doesn't seem like I can just pass that in because it's telling me that it's undefined
.
For dwFindPara
I need to specify the actual structure with the certificate info, in this case, right? If I understand correctly. Again, though: I don't know how to do this. How do I specify the info from the certificate chain as DWORDs? I cant give them as strings.
For the last argument I think nullptr
should be fine. Please correct me I'm wrong.
Anyway, please give me answers to the above questions. I need to know so I can correctly use the CertFindCertificateInStore
function since right now I have no idea how to give it the info I want to give it. Please help me out here. Thanks.
2 answers
Sort by: Most helpful
-
-
David Lowndes 4,711 Reputation points
2020-10-28T15:32:52.48+00:00 It's not something I've ever done, but see if this example helps.