With the help of Josh Poley, I found the answer. Thank you Josh
bool CertHasDigitalSignature(PCCERT_CONTEXT pCert) { bool retVal(false); CERT_EXTENSION* keyUsage; keyUsage = CertFindExtension(szOID_KEY_USAGE, pCert->pCertInfo->cExtension, pCert->pCertInfo->rgExtension); if(NULL != keyUsage) { DWORD strSz(0); if(CryptFormatObject(X509_ASN_ENCODING, 0, 0, NULL, szOID_KEY_USAGE, keyUsage->Value.pbData ,keyUsage->Value.cbData, NULL, &strSz)) { std::wstring Buff; Buff.resize((strSz / sizeof(wchar_t)) + 1); if(CryptFormatObject(X509_ASN_ENCODING, 0, 0, NULL, szOID_KEY_USAGE, keyUsage->Value.pbData ,keyUsage->Value.cbData, (void*)Buff.data(), &strSz)) { if (std::wstring::npos != Buff.find(L"Digital Signature")) retVal = true; } } } return retVal; }