如何在C ++中读取嵌入式代码签名签名? [英] How do I read an embedded code signing signature in C++?

查看:420
本文介绍了如何在C ++中读取嵌入式代码签名签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用我的数字签名签名文件,我如何从此文件中读取此签名?

I signed file with my digital signature, how can i read this signature from this file?

签名受信任(Globalsign)。加密RSA / SHA1。签名文件是.exe

Signature is trusted (Globalsign) . Encryption RSA/SHA1. Signed file is .exe

推荐答案

首先,您需要指定要处理的证书类型。如果你正在谈论CLI组件,那么你可能正在处理StrongName签名,这是完全不同的野兽,旨在防止CLR的全局程序集缓存中的名称冲突。

First, you need to specify what kind of certificate you're dealing with. If you are talking about a CLI assembly, then you might be dealing with StrongName signatures, which are entirely different beasts designed to prevent name collisions in the CLR's global assembly cache.

听起来更像是要读取Authenticode签名,这些签名用于本机和CLI应用程序。如果你想读取证书本身,那么你需要得到你的PE / COFF规范,并实现PE(可移植可执行文件)文件格式,这是Windows NT及其衍生物使用的格式的解析器。如果您想要实际验证该证书,您需要致电 WinVerifyTrust函数,它将为您执行Authenticode验证。

It sounds more like you want to read Authenticode signatures, which are used for both native and CLI applications. If you want to read the certificate itself, then you need to get your hands on the PE/COFF specification, and implement a parser for the PE ( Portable Executable ) file format, which is the format used by Windows NT and its derivatives. If you want to be able to actually verify that certificate, you need to call the WinVerifyTrust function, which will perform the Authenticode validation for you.

当然,如果你只是想检查您的证书验证,而无需处理编写自己的应用程序,这样做,您可以右键单击该文件,并选择属性...在Windows资源管理器中,它应该显示您的文件的签名状态。否则,您可以使用命令行实用程序 SigCheck

Of course, if you just want to check that your cert validates without dealing with writing your own application to do it, you can right click on the file and choose Properties... in Windows Explorer, and it should show you the signing status of the file. Otherwise, you can use the command line utility SigCheck.

这篇关于如何在C ++中读取嵌入式代码签名签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆