windows-store-apps - UWP appx 包 Signtool "Error: SignerSign() failed."(-2147024885/0x8007000b)

标签 windows-store-apps signtool appx desktop-bridge desktop-app-converter

编辑

事件日志错误是这样的:

    error 0x8007000B: The app manifest publisher name (CN=...) 
must match the subject name of the signing certificate 
(CN={19BE29DF-4812-4F2E-8FC1-A138B146946A}).

下面的命令现在似乎可以工作了。因此,当我看到这一点时,要么是我无法识别的用户错误,要么是机器状态有问题。与事件日志消息中的签名证书关联的 guid 不是证书管理器管理单元中显示的证书,这很奇怪。

原问题

我正在尝试对使用 MakeAppx.exe 生成的 UWP appx 包进行签名. pfx 是使用来自 https://msdn.microsoft.com/windows/uwp/porting/desktop-to-uwp-manual-conversion 的这些命令生成的开发人员代码签名证书。 .
C:\> MakeCert.exe -r -h 0 -n "CN=<publisher_name>" -eku 1.3.6.1.5.5.7.3.3 -pe -sv <my.pvk> <my.cer>
C:\> pvk2pfx.exe -pvk <my.pvk> -spc <my.cer> -pfx <my.pfx>

私钥在我受信任的根证书存储中,并且在我使用 Desktop App Converter 从安装程序生成 appx 时起作用。 .

我使用的命令行是:
signtool.exe sign -f <path to my pfx file> -fd SHA256 -v .\FishTank.appx

但是 SignTool是错误的:
The following certificate was selected:
    Issued to: ...
    Issued by: ...
    Expires:   Sat Dec 31 18:59:59 2039
    SHA1 hash: ...

Done Adding Additional Store
Error information: "Error: SignerSign() failed." (-2147024885/0x8007000b)

证书发布者匹配 appmanifest.xml 中的内容

<?xml version="1.0" encoding="utf-8"?>
<Package
   xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
   xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
   xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
  <Identity Name="..."
    ProcessorArchitecture="x64"
    Publisher="CN=..."
    Version="1.1.0.0" />
  <Properties>
    <DisplayName>Fish Tank</DisplayName>
    <PublisherDisplayName>Reserved</PublisherDisplayName>
    <Description>Some fish. Swimming around on your screen.</Description>
    <Logo>StoreLogo.png</Logo>
  </Properties>
  <Resources>
    <Resource Language="en-us" />
  </Resources>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
  </Dependencies>
  <Capabilities>
    <rescap:Capability Name="runFullTrust"/>
  </Capabilities>
  <Applications>
    <Application Id="FishTank" Executable="FishTank.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements
       BackgroundColor="#464646"
       DisplayName="Fish Tank"
       Square150x150Logo="Square150x150Logo.png"
       Square44x44Logo="Square44x44Logo.png"
       Description="Some fish. Swimming around on your screen." />
    </Application>
  </Applications>
</Package>

最佳答案

就像回答 here (虽然对于不同的错误代码) - 您必须确保发布者名称(在 AppxManifest.xml 文件中)与证书的发布者相同。

如需更多信息,请参阅 here (在底部的“备注”部分)。

关于windows-store-apps - UWP appx 包 Signtool "Error: SignerSign() failed."(-2147024885/0x8007000b),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37473394/

相关文章:

.net - Windows Metro 应用程序中没有 P2P?

signtool - 在IE中解决 "the signature of foo.exe is corrupt or invalid"

windows - 如何更改 msix 包的安装位置?

windows-runtime - 如何解决 DownloadOperation 的 AttachAsync 没有立即返回?

c# - 使用Direct2d Effects时出现 "error LNK2001: unresolved external symbol _CLSID_D2D1Blend"如何解决?

c# - Windows 应用商店应用程序中的 Grid.ShowGridLines

delphi - SignerSign() 失败。 (-2146869243/0x80096005)

cruisecontrol.net - SignTool.exe 偶尔会失败,退出代码为 1

c# - 如何为UWP包安装程序添加Microsoft.NET.CoreRuntime.2.1?

uwp - Fall Creators Update UWP App Installer Updater 不工作