首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用于Authenticode的替代时间戳服务

用于Authenticode的替代时间戳服务
EN

Stack Overflow用户
提问于 2010-05-20 08:30:43
回答 8查看 78.4K关注 0票数 120

我们执行代码签名和时间戳为我们的所有生产建设。偶尔(通常是在我们即将进行RTM (!)时)Veri符号的时间戳服务器("http://timestamp.verisign.com/scripts/timstamp.dll")决定断断续续地脱机。

在这种情况下我们该怎么办?

  • 时间戳服务器必须由根证书颁发机构托管吗?
  • 如果服务器关机,我们还可以使用其他网络托管的时间戳服务器而不是Verisign吗?欢迎就其他高度可用和免费的替代品提出建议:)
EN

回答 8

Stack Overflow用户

发布于 2012-08-28 13:37:52

我使用下面的批处理文件,最多循环300次。有两个参数,%1是包含批处理文件、pfx文件和signtool.exe的文件夹的路径。%2是要签名的文件的完整路径。您可以通过调用"$(SolutionDir)thirdparty\signing\sign.bat“”$(SolutionDir)第三方\signing“"$(TargetPath)”这样的方式在visual构建事件中调用它--我已经修改了这个批处理文件,以便在每次迭代中使用不同的时间戳服务器。目前它使用的是Comodo,Verisign.GlobalSign和Starfield。希望这是终极签名脚本;)

代码语言:javascript
运行
复制
@echo off    

REM create an array of timestamp servers...
set SERVERLIST=(http://timestamp.comodoca.com/authenticode http://timestamp.verisign.com/scripts/timestamp.dll http://timestamp.globalsign.com/scripts/timestamp.dll http://tsa.starfieldtech.com)

REM sign the file...
%1\signtool.exe sign /f %1\comodo.pfx /p videodigital %2

set timestampErrors=0

for /L %%a in (1,1,300) do (

    for %%s in %SERVERLIST% do (

        REM try to timestamp the file. This operation is unreliable and may need to be repeated...
        %1\signtool.exe timestamp /t %%s %2

        REM check the return value of the timestamping operation and retry a max of ten times...
        if ERRORLEVEL 0 if not ERRORLEVEL 1 GOTO succeeded

        echo Signing failed. Probably cannot find the timestamp server at %%s
        set /a timestampErrors+=1
    )

    REM wait 2 seconds...
    choice /N /T:2 /D:Y >NUL
)

REM return an error code...
echo sign.bat exit code is 1. There were %timestampErrors% timestamping errors.
exit /b 1

:succeeded
REM return a successful code...
echo sign.bat exit code is 0. There were %timestampErrors% timestamping errors.
exit /b 0

我还把http://timestamp.comodoca.com放到了可信的站点(谢谢文斯)。我认为这可能是重要的一步。我也在PC上更新了根证书。

票数 93
EN

Stack Overflow用户

发布于 2010-07-13 18:51:26

我不确定时间戳服务器是否必须由根CA拥有。

我们使用http://timestamp.comodoca.com/authenticode (并且有一个Comodo证书),但实际上也有一个类似的问题,因为他们的服务器似乎偶尔会出现错误或超时。我们在我们的持续集成服务器上作为夜间(或按需)构建的一部分进行签名,只用于发布版本(而不是Debug构建)。

我用两种方式(主要是)解决了这个问题:

  • 如果对signtool.exe的调用失败,它将再次(立即)重试两次
  • 构建脚本用于在一个步骤中对每个exe进行签名(而且我们有几个作为我们产品的一部分),现在它一个接一个地完成需要稍长一点的时间,但失败的可能性较小。

在这两者之间,时间戳服务器问题导致的构建失败已经从每周一次或两次变为几乎从未发生过。

编辑:我有一个MSBuild任务,在https://gist.github.com/gregmac/4cfacea5aaf702365724执行这个任务(以及读取存储库外存储的证书密码。)

票数 18
EN

Stack Overflow用户

发布于 2012-04-02 11:56:06

它可以很好地工作,方法是用以下其中之一替换verisign时间戳url:

http://timestamp.comodoca.com/authenticode

http://www.trustcenter.de/codesigning/timestamp

票数 12
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2872105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档