Decryption failure error with crypt32.dll, CertGetSubjectCertificateFromStore API

Mehul Donga 0 Reputation points
2024-10-25T09:51:58.47+00:00

We have an application which transfer EDI documents using AS2 protocol where when our business partner and send data to us, we can’t decrypt it.

We are reading the certificate from windows certificate store using CertGetSubjectCertificateFromStore api and trying to decrypt data and getting error code, Error = 0x8009200C (Cannot find the certificate and private key to use for decryption.

pEnvelopeCert = CertGetSubjectCertificateFromStore(dwCertStoreIdx, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, ptrCertInfo);

Same solution is working with every other partners. I really appreciate if someone help here, let me know if need more information.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,651 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,758 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.