Getting TRUST_E_NO_SIGNER_CERT from WinVerifyTrust

0

I am getting TRUST_E_NO_SIGNER_CERT from WinVerifyTrustEx. error code is "0x80096002" and message is "The certificate for the signer of the message is invalid or not found."

I checked that certificate is fine and it is trusted. Exporting and opening up signing certificate I can see that Certificate is okay. Can somebody help me understand what can cause WinVerifyTrustEx to return TRUST_E_NO_SIGNER_CERT?

 WINTRUST_FILE_INFO fileInfo;
    ZeroMemory(&fileInfo, sizeof(fileInfo));
    fileInfo.cbStruct = sizeof(fileInfo);
    fileInfo.pcwszFilePath = filePath;

    CERT_STRONG_SIGN_PARA strongSignParam;
    ZeroMemory(&strongSignParam, sizeof(strongSignParam));
    strongSignParam.cbSize = sizeof(strongSignParam);
    strongSignParam.dwInfoChoice = CERT_STRONG_SIGN_OID_INFO_CHOICE;
    strongSignParam.pszOID = szOID_CERT_STRONG_SIGN_OS_1;

    WINTRUST_SIGNATURE_SETTINGS signatureSettings;
    ZeroMemory(&signatureSettings, sizeof(signatureSettings));
    signatureSettings.cbStruct = sizeof(signatureSettings);
    signatureSettings.pCryptoPolicy = &strongSignParam;

    WINTRUST_DATA_WIN8 wintrustData;
    ZeroMemory(&wintrustData, sizeof(wintrustData));
    wintrustData.cbStruct = sizeof(wintrustData);
    wintrustData.pSignatureSettings = &signatureSettings;
    wintrustData.dwUIChoice = WTD_UI_NONE;  
    wintrustData.fdwRevocationChecks = WTD_REVOKE_WHOLECHAIN;  
    wintrustData.dwUnionChoice = WTD_CHOICE_FILE;  
    wintrustData.pFile = &fileInfo;  
    wintrustData.dwStateAction = WTD_STATEACTION_VERIFY; 
    wintrustData.dwProvFlags =  WTD_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT;

    GUID guidGenericVerifyV2 = WINTRUST_ACTION_GENERIC_VERIFY_V2;

    HRESULT hr = WinVerifyTrustEx(static_cast<HWND>(INVALID_HANDLE_VALUE), &guidGenericVerifyV2, &wintrustData);
c++
windows
certificate
asked on Stack Overflow Oct 30, 2019 by Deep

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0