使用SignTool给Windows程序进行数字签名

栏目: 编程工具 · 发布时间: 6年前

内容简介:前段时间写了个Windows平台的使用openssl生成一张自签证书通过以上命令生成一张名为 alert.pfx 的证书,在生成pfx文件时会要求你输入一些信息以及一个密码,改密码会在下面的签名过程中使用到。

前段时间写了个Windows平台的 自动报时程序 ,由于未添加签名所以在启动时总是会被提示为不被信任的程序,所以给程序添加了一个数字签名,这里记录下操作步骤。

使用openssl生成一张自签证书

openssl genrsa -out alert.key 2048
openssl req -new -x509 -days 365 -key alert.key -out alert.crt
openssl pkcs12 -export -in alert.crt -inkey ca.key -out alert.pfx

通过以上命令生成一张名为 alert.pfx 的证书,在生成pfx文件时会要求你输入一些信息以及一个密码,改密码会在下面的签名过程中使用到。

下载微软的签名工具,地址: https://pan.baidu.com/s/1rBE2HDodwM4qa6gLX8RwNA ,密码为 tnsb 。

把签名 工具 和之前生成的签名文件,以及生成的可执行文件放到同一个文件夹中,之后进行签名

signtool.exe sign /f alert.pfx /p 上一步中的密码 /t http

://timestamp.verisign.com/scripts/timstamp.dll TimeAlert.exe

Done Adding Additional Store

Successfully signed and timestamped: TimeAlert.exe

至此我们就成功的给一个Windows程序添加了数字签名。

参考: 使用SignTool给 .dll或 .exe数字签名


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Advanced Web Metrics with Google Analytics, 2nd Edition

Advanced Web Metrics with Google Analytics, 2nd Edition

Brian Clifton / Sybex / 2010-3-15 / USD 39.99

Valuable tips and tricks for using the latest version of Google Analytics Packed with insider tips and tricks, this how-to guide is fully revised to cover the latest version of Google Analytics and sh......一起来看看 《Advanced Web Metrics with Google Analytics, 2nd Edition》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具