windows应用程序签名

本文详细介绍了在Windows环境下为应用程序签名的过程,包括遇到的问题、解决方法及具体步骤。通过购买正式证书或使用自签名证书,利用微软的签名工具进行签名,并解决了签名后证书信任问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

遇到问题

 

解决方法

购买正式证书,如Global Sign,他们会提供签名工具

自签名证书,可使用微软的签名工具
https://docs.microsoft.com/zh-cn/dotnet/framework/tools/signtool-exe

步骤

1、安装vs2019,并打开developer powershell for vs 2019
2、执行如下命令
D:\signtoodemo>Makecert -sv test.pvk -r -n "CN=TCT" test.cer
Succeeded

D:\signtoodemo>Cert2spc test.cer test.spc
Succeeded

D:\signtoodemo>pvk2pfx -pvk test.pvk  -spc test.spc -pfx test.pfx -f

D:\signtoodemo>signtool sign /fd SHA256 /f test.pfx demo.exe
Done Adding Additional Store
Successfully signed: demo.exe

D:\signtoodemo> signtool sign /f test.pfx /t http://timestamp.digicert.com /fd SHA256 demo.exe
Done Adding Additional Store
Successfully signed: demo.exe

D:\signtoodemo>signtool verify /pa /v demo.exe  
SignTool Error: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider
上述错误,需要双击test.cer文件,在弹出的证书对话框中选择“安装证书”,选择将证书存储在“受信任的根证书颁发机构”存储区

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值