【发布时间】:2017-07-25 01:16:51
【问题描述】:
我已经构建了一个 Windows 10 UWP cordova 应用程序,现在正在尝试对其进行签名。我已经有一个在其他地方使用的证书(用于签署 .net 程序集),所以我想我会使用同一个证书来签署这个应用程序。
当我使用 signtool.exe 时,出现以下错误..
SignTool Error: An unexpected internal error has occurred.
Error information: "Error: SignerSign() failed." (-2146958839/0x80080209)
按照here 的建议查看事件日志,我没有看到任何错误,只有 2 条信息消息
无需清单验证即可成功创建阅读器。
我已确保 AppxManifest.xml 文件中的 Publisher 字段与证书中的主题匹配。
看着here,我看到这个描述为
0x80080209-APPX_E_INVALID_SIP_CLIENT_DATA
Description : The SIP_SUBJECTINFOstructure used to sign the package didn’t
contain the required data
有人知道这是什么意思吗?
[更新1]
上述失败后,我尝试创建一个新证书,如here 所述。
我使用了以下。
# create
New-SelfSignedCertificate -Type Custom -Subject "CN=My Company Pty Ltd, O=My Company Pty Ltd, C=AU" -KeyUsage DigitalSignature -FriendlyName mycert_uwp -CertStoreLocation "Cert:\LocalMachine\My"
# get info
Set-Location Cert:\LocalMachine\My
Get-ChildItem | Format-Table Subject, FriendlyName, Thumbprint
# export
$pwd = ConvertTo-SecureString -String password123 -Force -AsPlainText
Export-PfxCertificate -cert "Cert:\LocalMachine\My\17BBBBBB2DC49F550671AF3E72120C88E2333333" -FilePath h:\0\mycert_uwp.pfx -Password $pwd
似乎一切正常。
在我的 AppxManifest.xml 中有...
<Identity Name="com.mycompany.myapp" Publisher="CN=My Company Pty Ltd, O=MyCompany Pty Ltd, C=AU" Version="1.0.1.1" ProcessorArchitecture="x86" />
使用上述方法时,我仍然遇到同样的错误。
[更新 2]
我使用的signtool命令是
signtool sign /fd SHA256 /a /f myapp_uwp.pfx /p may password c:\dev\myapp\platforms\windows\build\windows\release\x86\win10\Upload\CordovaApp.Windows10_1.0.1.1_x86\CordovaApp.Windows10_1.0.1.1_x86.appx
如here所述。
我也尝试过使用SHA384 和SHA512。还有建议尝试使用/debug,我收到错误提示/debug 是无效选项。
[更新3] 好像是证书。我尝试通过 Visual Studio 使用(打包,选择证书),但得到以下错误(输入密码后)
.. 但我已按照说明进行操作 here(并三重检查)。
这些说明有错吗??
【问题讨论】:
-
您能否在问题中包含您的清单和证书信息?您是否按照these steps 创建了您的证书——尤其是两个 EKU?
-
我看过上面的链接。这有标记为
Important MakeCert.exe is deprecated. For current guidance on creating a certificate, see Create a certificate for package signing.的链接,所以我按照那里的说明进行操作。我已将额外信息添加到问题中。 -
尝试按照this article 中的说明进行操作。忽略所有资源位,但它确实有创建证书等的明确说明。
-
感谢您提供的额外信息。查看第一个链接,签名步骤
signtool sign /fd SHA256 /a /f ..\contoso_demo_key.pfx ..\contoso_demo.appx正是我一直在运行的。实际的构建和打包是通过 Ionic 构建完成的,因此构建中的某些内容可能有所不同,导致证书无法正常工作。我还在第二个链接中尝试了批处理。证书创建得很好,但现在 signtool 抱怨密码错误,即使我肯定使用相同的密码(作为非常简单的 2 字符之一,我尝试了很多次以确保没有拼写错误)
标签: uwp windows-10 code-signing visual-studio-cordova signtool