gpt4 book ai didi

c++ - 验证 EXE 上的 Authenticode 签名 - 没有 CAPICOM 的 C++

转载 作者:IT老高 更新时间:2023-10-28 22:26:01 25 4
gpt4 key购买 nike

我正在为安装程序 DLL 编写一个函数来验证系统上已安装的 EXE 文件的 Authenticode 签名。

函数需要:

A) verify that the signature is valid.
B) verify that the signer is our organization.

因为它在安装程序中,并且因为它需要在较旧的 Win2k 安装上运行,所以我想依赖 CAPICOM.dll,因为它可能不在目标系统上。

WinVerifyTrust API 非常适合解决 (A)。

我需要找到一种方法将已知证书(或其中的属性)与签署相关 EXE 的证书进行比较。

最佳答案

您应该使用 CryptQueryObject .

这篇知识库文章演示了如何使用:How To Get Information from Authenticode Signed Executables .

对于询问如何在没有 Windows-API 的情况下执行此操作的评论者,我不知道有任何库可以执行此操作,但此处记录了格式:Windows Authenticode Portable Executable Signature Format

关于c++ - 验证 EXE 上的 Authenticode 签名 - 没有 CAPICOM 的 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/301024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com