none
What is new alternative for CryptQueryObject because it is deprecated RRS feed

  • Question

  • Hi,

    I am trying to check certificate of binary before I launch it. I am verifying serial number and CA to validate certificate. Following is sequence of functions I am using

    CryptQueryObject

    CryptMsgGetParam

    CertFindCertificateInStore

    But MSDN says CryptQueryObject is deprecated and use Cryptography Next Generation APIs. I don't understand how to use these APIs. I don't find similar alternative to CryptQueryObject.

    Please help to find its alternative and how to use it.

    Thanks,

    Sandip


    • Edited by SandipY Friday, May 11, 2018 3:46 AM spelling mistake
    Friday, May 11, 2018 3:45 AM

All replies

  • What parameters are you using with CryptQueryObject ?
    Saturday, May 12, 2018 1:24 AM
  • I am trying to find issuer name and serial number of certificate used to sign the binary file. 

    CryptQueryObject(CERT_QUERY_OBJECT_FILE,
           filePath,
           CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
           CERT_QUERY_FORMAT_FLAG_BINARY,
           0,
           &dwEncoding,
           &dwContentType,
           &dwFormatType,
           &hStore,
           &hMsg,
           NULL);

    Saturday, May 12, 2018 6:06 AM
  • Hi Sandip,

    I am also looking for alternative of cryptqueryobject, please let me know if you find any solution. ?

    Thursday, October 17, 2019 5:18 PM