gpt4 book ai didi

openssl - 如何使用 osslsigncode 执行代码签名

转载 作者:行者123 更新时间:2023-12-03 20:21:58 46 4
gpt4 key购买 nike

你能帮我弄清楚如何用证书签署我的软件吗?你知道 signtool 只能在 windows 机器上工作,但我需要在 linux 服务器上签署文件。现在系统像这样工作,文件在 linux 服务器上构建,然后移动到 win 服务器进行签名,然后再次返回到 linux。

我尝试谷歌并找到了一种新的签名方式 osslsigncode程序。

我现在的问题是如何将证书从 MS 转换为 osslsigncode 格式。
所以现在我做这个步骤
永久有两个文件:
cert.crt 和 key.blob
首先我需要将它们转换为 .pfx 格式
我愿意:

openssl rsa -inform MS/PRIVATEKEYBLOB -in key.blob -outform PEM -out key.pem
openssl rsa -in key.pem -outform PVK -pvk-strong -out key.pvk
pvk2pfx -pvk key.pvk -pi 1234 -spc cert.crt -pfx cert.pfx

然后我可以用命令签署我的软件
signtool.exe sign /v /f cert.pfx /p 1234 soft.exe

你能告诉我使用 osslsigncode 程序需要做哪些转换步骤吗?

最佳答案

http://development.adaptris.net/users/lchan/blog/2013/06/07/signing-windows-installers-on-linux/为我工作......感谢原作者。

万一丢失,相关步骤是:

To do the signing, you basically have to export your key from your keystore [...] as a PKCS12/PFX file so that you can convert it using openssl[...].


openssl pkcs12 -in authenticode.pfx -nocerts -nodes -out key.pem
openssl pkcs12 -in authenticode.pfx -nokeys -nodes -out cert.pem
openssl rsa -in key.pem -outform DER -out authenticode.key
openssl crl2pkcs7 -nocrl -certfile cert.pem -outform DER -out authenticode.spc
osslsigncode -spc authenticode.spc -key authenticode.key -t http://timestamp.verisign.com/scripts/timstamp.dll -in install.exe -out install-signed.exe

关于openssl - 如何使用 osslsigncode 执行代码签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20045939/

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