我已经准备了一个应用程序和网站,客户可以在下载之前为这个应用程序设置几个选项。设置以二进制格式存储在文件末尾(附加),然后将编辑后的文件发送给最终用户。问题是,更改文件的“内容”会破坏文件签名--有没有可能用命令行工具重新签名这个更改过的文件?我试过使用微软的SignTool,但它在Linux上不能正常工作。
发布于 2013-08-17 19:03:21
这实际上是使用Mono
的signtool来完成的;棘手的部分(在链接的Mozilla文章中更详细地描述)是将证书以正确的格式从quite straight forward复制到Linux。
将Windows PFX证书文件转换为PVK和SPC文件,只需在将证书从Windows复制到Linux时执行一次;
openssl pkcs12 -in authenticode.pfx -nocerts -nodes -out key.pem
openssl rsa -in key.pem -outform PVK -pvk-strong -out authenticode.pvk
openssl pkcs12 -in authenticode.pfx -nokeys -nodes -out cert.pem
openssl crl2pkcs7 -nocrl -certfile cert.pem -outform DER -out authenticode.spc
实际上签署可执行文件是很简单的;
signcode \
-spc authenticode.spc \
-v authenticode.pvk \
-a sha1 -$ commercial \
-n My\ Application \
-i http://www.example.com/ \
-t http://timestamp.digicert.com/scripts/timstamp.dll \
-tr 10 \
MyApp.exe
https://stackoverflow.com/questions/18287960
复制相似问题