使用makecert / pvk2pfx时,ClickOnce签名者的证书对签名无效 [英] ClickOnce signer's certificate not valid for signing when using makecert/pvk2pfx

查看:300
本文介绍了使用makecert / pvk2pfx时,ClickOnce签名者的证书对签名无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用makecert / pvk2pfx创建的我的未过期证书突然间在尝试发布ClickOnce应用程序时抛出错误。就在上周,这很好用...

All of a sudden my unexpired certificate created using makecert/pvk2pfx is throwing an error when attempting to publish a ClickOnce application. This worked fine just last week...

错误消息:


错误2签名时发生错误:无法签名
bin\Debug\app.publish\setup.exe。 SignTool错误:签名者的
证书对于签名无效。 SignTool错误:尝试签名时发生错误
:bin\Debug\app.publish\setup.exe

Error 2 An error occurred while signing: Failed to sign bin\Debug\app.publish\setup.exe. SignTool Error: The signer's certificate is not valid for signing. SignTool Error: An error occurred while attempting to sign: bin\Debug\app.publish\setup.exe

当我使用签名选项卡中的创建测试证书选项时,该证书可以正常工作,并且该应用程序已成功发布。

When I use the "Create Test Certificate" option in the Signing tab that certificate works fine and the application is published successfully.

使用makecert /手动创建证书时pvk2pfx我正在遵循 MSDN指令

When manually creating my certificate with makecert/pvk2pfx I'm following the MSDN instructions.

当我删除旧的手动创建的证书时,使用makecert / pvk2pfx创建一个新证书并尝试使用该证书,我会得到相同的错误。

When I delete my old manually created certificate, create a new one using makecert/pvk2pfx and try to use that one I get the same error.

该应用程序是针对.NET 4的WPF应用程序,而这一切都在Visual Studio 2010中...

The application is a WPF application targeting .NET 4, and this is all in Visual Studio 2010...

有什么想法吗?

推荐答案

在我指定证书长度大于1024之后,它对我有用:

It worked for me after I specified the certificate length greater than 1024:

makecert -sv MyApp.pvk -n "CN=MyCompany" -len 2048 MyApp.cer -r
pvk2pfx -pvk MyApp.pvk -spc MyApp.cer -pfx MyApp.pfx -po MyPassword

Microsoft发布了一个更新,该更新会影响所有RSA密钥长度小于1024位的证书。

Microsoft released an update that affects all certificates having an RSA key less than 1024 bits long.

Microsoft安全公告:更新最小证书密钥长度

这篇关于使用makecert / pvk2pfx时,ClickOnce签名者的证书对签名无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆