7

編輯Signtool「錯誤:SignerSign()失敗。」 (-2147024885/0x8007000b)

事件日誌錯誤是這樣的:

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> 
+2

此錯誤在文檔中特別提及(https://msdn.microsoft.com/en-us/library/windows/desktop/jj835835%28v=vs.85%29.aspx)。您忘記告訴我們您在應用程序日誌中找到的內容。 –

+0

回答編輯有事件日誌,但奇怪的是(離電腦幾個小時之後)簽名剛剛工作,沒有我改變我能想到的任何東西。將它歸咎於我自己的用戶錯誤或gremlins。 – dkackman

+4

我有相同的錯誤,問題出現在證書頒發者名稱中。 「MakeCert.exe」中的「'值應該匹配'AppxManifest.xml'中的'Publisher =」CN = 「' – crea7or

回答

2

就像回答here(雖然對於不同的錯誤代碼) - 喲您必須確保發佈者名稱(在AppxManifest.xml文件中)與證書的發佈者相同。

欲瞭解更多信息,請參閱here(在底部的「備註」部分)。

+0

這意味着什麼?僅僅是CN =公司還是整個主題?什麼必須完全匹配?文檔非常模糊,我無法進行任何組合工作。 –

+0

@RickStrahl從我觀察到的,它應該是整個字符串,而不僅僅是CN =東西的一部分。如果這仍然不適合你,讓我知道 –