MSIX package signing issue with certificate installed in a certificate store

%3CLINGO-SUB%20id%3D%22lingo-sub-1499926%22%20slang%3D%22en-US%22%3EMSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499926%22%20slang%3D%22en-US%22%3E%3CP%3EI%20created%20a%20MSIX%20file%20and%20later%20signing%20the%20package%20with%20this%20command%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Esigntool%20sign%20%2Ffd%20SHA256%20%2Fv%20%2Fsm%20%2Fs%20My%20%2Fn%20%22ABC%20Corporation%22%20%2Ft%20http%3A%2F%2Ftimestamp.digicert.com%20file.msix%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EBut%20signing%20failed%20with%20this%20error%3A%3C%2FP%3E%3CP%3ESign%20tool%20Error%3A%20This%20file%20format%20cannot%20be%20signed%20because%20it%20is%20not%20recognized.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EHost%20using%20to%20sign%20the%20package%3A%20Windows%20Server%202012%3C%2FLI%3E%3CLI%3EOur%20AD%20team%26nbsp%3B%3CSPAN%3Einstalled%20the%20certificate%20in%20certificate%20store%20of%20the%20host%20I%20am%20using%20to%20sign.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EI%20installed%20Windows%2010%20SDK%20and%20added%20signtool%20'x86'%20location%20%22C%3A%5CProgram%20Files%20(x86)%5CWindows%20Kits%5C10%5Cbin%5C10.0.19041.0%5Cx86%22%20to%20path%20variable%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EFor%20Code%20signing%20we%20are%20using%20DigiCert%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EAppreciate%20any%20suggestions%20to%20resolve%20this%20issue%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1502867%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502867%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F346823%22%20target%3D%22_blank%22%3E%40Sri-Boddupalli%3C%2FA%3E%26nbsp%3B%20While%20I'm%20not%20sure%20about%20the%20syntax%20(I%20normally%20use%20an%20external%20pfx%20file%20instead%20of%20the%20certificate%20store)%2C%20so%20I'm%20not%20sure%20of%20syntax%20for%20getting%20from%20the%20store.%20But%20consider%20these%20ideas%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20subject%20name%20in%20the%20certificate%20must%20exactly%20match%20the%20Publisher%20field%20in%20the%20AppXManifest%20file.%26nbsp%3B%20This%20is%20in%20the%20form%20of%20the%20string%20%22CN%3DCompanyName%22.%26nbsp%3B%20View%20your%20cert%20in%20the%20certificate%20store%20and%20make%20sure%20it%20matches%20by%20changing%20your%20manifest.%3C%2FLI%3E%0A%3CLI%3ESyntax%20on%20the%20timestamp%20looks%20wrong%20to%20me%2C%20but%20I%20don't%20use%20digicert.%26nbsp%3B%20Try%20leaving%20that%20off%20for%20a%20test.%3C%2FLI%3E%0A%3CLI%3EPossibly%20your%20company%20added%20the%20cert%20to%20the%20wrong%20section%20of%20the%20store.%20Check%20signtool%20documentation%20and%20look%20into%20which%20store%20it%20was%20installed%20to.%26nbsp%3B%20Usually%20we%20want%20the%20%22Root%20Certificate%20Store%22.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1511877%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1511877%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%26nbsp%3B%20appreciate%20your%20input%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESubject%20Name%20matched%20with%20Manifest%20file%20CN%20name%20verified%20it.%20Just%20to%20reassure%20I%20exported%20the%20certificate%20installed%20by%20our%20team%20in%20the%20store%20as%20a%20.cer%20file%20and%20imported%20it%20during%20the%20MSIX%20pacakging%20process.%20Which%20do%20not%20sign%20the%20package%20but%20automatically%20generates%20the%20correct%20publisher%20information.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%20I%20tried%20using%20the%20Digicert%20Utility%20tool%20to%20sign%20the%20package(GUI%20method)%20and%20getting%20below%20error.%20Is%20this%20a%20generic%20error%20message%20or%20specific%20to%20my%20scenario%20not%20sure.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Sri-Boddupalli_0-1594304645379.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204354iFDFDCF575C3FABCA%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Sri-Boddupalli_0-1594304645379.png%22%20alt%3D%22Sri-Boddupalli_0-1594304645379.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20thing%20I%20noticed%20is%20it%20does%20not%20have%20.MSIX%20file%20in%20the%20drop%20down%20selection%20of%20file%20type%20we%20are%20signing%20shown%20in%20below.%20Does%20this%20mean%20our%20code%20signing%20certificate%20is%20not%20supporting%20MSIX%20file%20type%3F%20after%20all%20the%20error%20message%20we%20got%20while%20using%20the%20signtool%20was%20%22The%20file%20format%20cannot%20be%20signed%20because%20it%20is%20not%20recognized%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Sri-Boddupalli_1-1594304779836.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204356iF2C7C4D12CF8280C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Sri-Boddupalli_1-1594304779836.png%22%20alt%3D%22Sri-Boddupalli_1-1594304779836.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1512356%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1512356%22%20slang%3D%22en-US%22%3E%3CP%3EI%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F346823%22%20target%3D%22_blank%22%3E%40Sri-Boddupalli%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20Digicert%20utility%20doesn't%20recognise%20.msix%2C%20you%20can%20try%20renaming%20the%20file%20to%20.appx%20and%20then%20sign%20it.%26nbsp%3B%20Ultimately%20I%20assume%20this%20utility%20is%20calling%20the%20Microsoft%20signtool.exe%20utility%20to%20perform%20the%20signing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20is%20no%20difference%20on%20the%20file%20extension%3B%20the%20difference%20between%20a%20UWP%20app%20and%20a%20MSIX%20one%20is%20internal%20to%20the%20manifest%20file%20rather%20than%20the%20file%20name%20extension.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1512360%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1512360%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20might%20also%20just%20leave%20the%20timestamp%20off%20for%20a%20test%20and%20make%20sure%20that%20it%20is%20not%20the%20cause.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1517598%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1517598%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F346823%22%20target%3D%22_blank%22%3E%40Sri-Boddupalli%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20perform%20some%20steps%20to%20eliminate%20a%20few%20things%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(1)%20Start%20with%20testing%20if%20the%20certificate%20you%20have%20is%20valid%20for%20code%20signing.%20Are%20you%20able%20to%20sign%20any%20executable%20with%20it%3F%20(download%207-zip%20EXE%20from%20the%20official%20website%20and%20try%20to%20sign%20it).%20If%20you%20get%20an%20error%20at%20this%20point%2C%20then%20there%20is%20something%20probably%20wrong%20with%20your%20certificate.%20After%20all%2C%20one%20of%20the%20error%20codes%20your%20reported%20was%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%22723px%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22296px%22%3E%3CSTRONG%3ETRUST_E_SUBJECT_FORM_UNKNOWN%3C%2FSTRONG%3E%200x800B0003%3C%2FTD%3E%3CTD%20width%3D%22426px%22%3E%3CP%3EThe%20form%20specified%20for%20the%20subject%20is%20not%20one%20supported%20or%20known%20by%20the%20specified%20trust%20provider.%3C%2FP%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(2)%20If%20signing%20works%20for%20EXE%2C%20then%20it%20should%20(with%20the%20version%20you%20have)%20work%20for%20MSIX%20as%20well.%20You%20should%20try%20to%20validate%20your%20MSIX%20then%20-%20how%20did%20you%20create%20it%3F%20Can%20you%20use%20makeappx.exe%20to%20unpack%20it%2C%20and%20then%20pack%20it%20again%3F%20It%20should%20do%20some%20semantic%20validation%20to%20ensure%20that%20the%20manifest%20is%20correct%20and%20some%20values%20are%20in%20place.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(3)%20Try%20to%20create%20a%20new%20self-signed%20certificate%20and%20sign%20the%20MSIX%20in%20question%2C%20with%20the%20SDK%20you%20have.%20This%20can%20also%20exclude%20any%20potential%20issues%20with%20MSIX%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20my%20freeware%20tool%20MSIX%20Hero%20(%3CA%20href%3D%22https%3A%2F%2Fmsixhero.net%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Emsixhero.net%3C%2FA%3E)%20for%20points%20(2)%20and%20(3)%2C%20or%20use%20the%20following%20links%20and%20resources%20explaining%20how%20to%20perform%20them%20manually%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fpkiclient%2Fnew-selfsignedcertificate%3Fview%3Dwin10-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fpkiclient%2Fnew-selfsignedcertificate%3Fview%3Dwin10-ps%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FMSIX-Toolkit%2Ftree%2Fmaster%2FScripts%2FModifyPackagePublisher%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoft%2FMSIX-Toolkit%2Ftree%2Fmaster%2FScripts%2FModifyPackagePublisher%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fappxpkg%2Fmake-appx-package--makeappx-exe-%23to-extract-files-from-a-package%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fappxpkg%2Fmake-appx-package--makeappx-exe-%23to-extract-files-from-a-package%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518501%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518501%22%20slang%3D%22en-US%22%3EThis%20issue%20looks%20to%20me%20more%20related%20to%20your%20package%20rather%20then%20the%20certificate%20(As%20the%20message%20states%3A%20Sign%20tool%20Error%3A%20This%20file%20format%20cannot%20be%20signed%20because%20it%20is%20not%20recognized.).%20I%20had%20this%20issue%20once%20and%20in%20the%20end%20recreating%20the%20package%20with%20fresh%20binaries.%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20can%20try%20building%20a%20very%20simple%20MSIX%2FAPPX%20package%20and%20sign%20it.%20That%20way%20you%20can%20make%20sure%20that%20it%20is%20really%20not%20about%20the%20certificate.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1519159%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20package%20signing%20issue%20with%20certificate%20installed%20in%20a%20certificate%20store%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1519159%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20guys%20for%20your%20valuable%20suggestions%2C%20appreciate%20your%20time%20on%20this.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3ESo%20I%20ended%20up%20calling%20the%20DigiCert%20support%20and%20asked%20the%20first%20question%20whether%20they%20support%20signing%20MSIX%20packages%20and%20do%20they%20have%20any%20document%20which%20confirms%20that.%20Unfortunately%20they%20don't%20have%20any%20document%20which%20states%20all%20the%20file%20formats%20they%20support%20code%20signing%3C%2FLI%3E%3CLI%3EThen%20I%20ran%20the%20Signtool%20in%20debug%20mode%20as%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%26nbsp%3Bsuggested%20in%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmsix-packaging-and-tools%2Fmsix-packageing-tool-signtool-certificate-issues%2Fm-p%2F224217%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmsix-packaging-and-tools%2Fmsix-packageing-tool-signtool-certificate-issues%2Fm-p%2F224217%3C%2FA%3E%20and%20ended%20up%20finding%20another%20article%20related%20to%20error%20I%20was%20getting.%26nbsp%3B%3C%2FLI%3E%3CLI%3E%26nbsp%3BAs%20per%20this%20thread%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.advancedinstaller.com%2Fforums%2Fviewtopic.php%3Ft%3D36104%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.advancedinstaller.com%2Fforums%2Fviewtopic.php%3Ft%3D36104%3C%2FA%3E%26nbsp%3BI%20uninstalled%20the%20Windows%2010%20SDK%20i%20had%20in%20the%20machine%20and%20re-installed%20the%20latest%20version%20of%20%3CSPAN%3EWindows%26nbsp%3B10%20SDK%2C%20version%202004%20(10.0.19041.0)%3C%2FSPAN%3E%20from%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fwindows%2Fdownloads%2Fsdk-archive%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fwindows%2Fdownloads%2Fsdk-archive%2F%3C%2FA%3E%3C%2FLI%3E%3CLI%3EThen%20as%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%26nbsp%3B%20suggested%20above%20started%20signing%20a%20simple%20MSI%20file%20just%20to%20verify%20nothing%20wrong%20with%20the%20Certificate%20and%20it%20worked%20good.%20Later%20I%20signed%20a%20custom%20.EXE%20we%20developed%20and%20signing%20went%20good.%20So%20I%20confirmed%20nothing%20wrong%20with%20the%20certificate%20I%20am%20using.%26nbsp%3B%3C%2FLI%3E%3CLI%3EFinally%20I%20signed%20the%20MSIX%20pacakge%20I%20created%20using%20this%20command%20and%20it%20worked%20without%20any%20issues.%26nbsp%3B%3CP%3E1)%20Change%20the%20Path%20to%20Signtool%20Location%20below%3CBR%20%2F%3EC%3A%5CProgram%20Files%20(x86)%5CWindows%20Kits%5C10%5Cbin%5C10.0.19041.0%5Cx64%3C%2FP%3E%3CP%3E2)%20Sign%20the%20Package%20using%20this%20command%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E.%5Csigntool.exe%20sign%20%2Fv%20%2Fsm%20%2Fs%20My%20%2Fn%20%22ABC%20Corporation%22%20%2Ffd%20SHA256%20%2Ft%20http%3A%2F%2Ftimestamp.digicert.com%20%22%3CFILELOCATION%3E%5CFile.msix%22%3C%2FFILELOCATION%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20was%20so%20frustrating%20to%20fight%20with%20AD%20team%20on%20getting%20the%20.PFX%20file%20with%20Password.%20I%20understand%20their%20security%20concerns%20but%20without%20that%20we%20are%20pretty%20much%20helpless.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F11847%22%20target%3D%22_blank%22%3E%40John%20Vintzel%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F145112%22%20target%3D%22_blank%22%3E%40Sharla%20Akers%3C%2FA%3E%26nbsp%3BAny%20better%20explanation%20I%20can%20come%20up%20with%2C%20if%20our%20AD%20team%20ask%20why%20exactly%20we%20need%20.PFX%20file%20instead%20of%20installing%20the%20certificate%20in%20cert%20store%20and%20using%20that%3F%20OR%20if%20you%20could%20develop%20a%20Signtool%20GUI%20utility%20that%20would%20be%20wonderful%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I created a MSIX file and later signing the package with this command 

signtool sign /fd SHA256 /v /sm /s My /n "ABC Corporation" /t http://timestamp.digicert.com file.msix

But signing failed with this error:

Sign tool Error: This file format cannot be signed because it is not recognized. 

 

  1. Host using to sign the package: Windows Server 2012
  2. Our AD team installed the certificate in certificate store of the host I am using to sign.
  3. I installed Windows 10 SDK and added signtool 'x86' location "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86" to path variable
  4. For Code signing we are using DigiCert 

Appreciate any suggestions to resolve this issue

8 Replies

@Sri-Boddupalli  While I'm not sure about the syntax (I normally use an external pfx file instead of the certificate store), so I'm not sure of syntax for getting from the store. But consider these ideas:

  • The subject name in the certificate must exactly match the Publisher field in the AppXManifest file.  This is in the form of the string "CN=CompanyName".  View your cert in the certificate store and make sure it matches by changing your manifest.
  • Syntax on the timestamp looks wrong to me, but I don't use digicert.  Try leaving that off for a test.
  • Possibly your company added the cert to the wrong section of the store. Check signtool documentation and look into which store it was installed to.  Usually we want the "Root Certificate Store". 

Thanks @TIMOTHY MANGAN  appreciate your input

 

Subject Name matched with Manifest file CN name verified it. Just to reassure I exported the certificate installed by our team in the store as a .cer file and imported it during the MSIX pacakging process. Which do not sign the package but automatically generates the correct publisher information. 

 

Also I tried using the Digicert Utility tool to sign the package(GUI method) and getting below error. Is this a generic error message or specific to my scenario not sure. 

 

Sri-Boddupalli_0-1594304645379.png

 

One thing I noticed is it does not have .MSIX file in the drop down selection of file type we are signing shown in below. Does this mean our code signing certificate is not supporting MSIX file type? after all the error message we got while using the signtool was "The file format cannot be signed because it is not recognized"

 

Sri-Boddupalli_1-1594304779836.png

 

I@Sri-Boddupalli 

If the Digicert utility doesn't recognise .msix, you can try renaming the file to .appx and then sign it.  Ultimately I assume this utility is calling the Microsoft signtool.exe utility to perform the signing.

 

There is no difference on the file extension; the difference between a UWP app and a MSIX one is internal to the manifest file rather than the file name extension. 

@TIMOTHY MANGAN 

 

You might also just leave the timestamp off for a test and make sure that it is not the cause.

@Sri-Boddupalli 

You could perform some steps to eliminate a few things:

 

(1) Start with testing if the certificate you have is valid for code signing. Are you able to sign any executable with it? (download 7-zip EXE from the official website and try to sign it). If you get an error at this point, then there is something probably wrong with your certificate. After all, one of the error codes your reported was 

 

TRUST_E_SUBJECT_FORM_UNKNOWN 0x800B0003

The form specified for the subject is not one supported or known by the specified trust provider.

 

(2) If signing works for EXE, then it should (with the version you have) work for MSIX as well. You should try to validate your MSIX then - how did you create it? Can you use makeappx.exe to unpack it, and then pack it again? It should do some semantic validation to ensure that the manifest is correct and some values are in place.

 

(3) Try to create a new self-signed certificate and sign the MSIX in question, with the SDK you have. This can also exclude any potential issues with MSIX file.

 

You can use my freeware tool MSIX Hero (msixhero.net) for points (2) and (3), or use the following links and resources explaining how to perform them manually:

 

This issue looks to me more related to your package rather then the certificate (As the message states: Sign tool Error: This file format cannot be signed because it is not recognized.). I had this issue once and in the end recreating the package with fresh binaries.

You can try building a very simple MSIX/APPX package and sign it. That way you can make sure that it is really not about the certificate.

Thank you guys for your valuable suggestions, appreciate your time on this. 

 

  1. So I ended up calling the DigiCert support and asked the first question whether they support signing MSIX packages and do they have any document which confirms that. Unfortunately they don't have any document which states all the file formats they support code signing
  2. Then I ran the Signtool in debug mode as @TIMOTHY MANGAN suggested in here https://techcommunity.microsoft.com/t5/msix-packaging-and-tools/msix-packageing-tool-signtool-certif... and ended up finding another article related to error I was getting. 
  3.  As per this thread https://www.advancedinstaller.com/forums/viewtopic.php?t=36104 I uninstalled the Windows 10 SDK i had in the machine and re-installed the latest version of Windows 10 SDK, version 2004 (10.0.19041.0) from here https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
  4. Then as @TIMOTHY MANGAN  suggested above started signing a simple MSI file just to verify nothing wrong with the Certificate and it worked good. Later I signed a custom .EXE we developed and signing went good. So I confirmed nothing wrong with the certificate I am using. 
  5. Finally I signed the MSIX pacakge I created using this command and it worked without any issues. 

    1) Change the Path to Signtool Location below
    C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64

    2) Sign the Package using this command

 

.\signtool.exe sign /v /sm /s My /n "ABC Corporation" /fd SHA256 /t http://timestamp.digicert.com "<FileLocation>\File.msix"

 

It was so frustrating to fight with AD team on getting the .PFX file with Password. I understand their security concerns but without that we are pretty much helpless. @John Vintzel @Sharla_Akers Any better explanation I can come up with, if our AD team ask why exactly we need .PFX file instead of installing the certificate in cert store and using that? OR if you could develop a Signtool GUI utility that would be wonderful 

I was having the same issue and the note about using the sign tool from the windows kits folder worked. I'm guessing it is using the manifest and\or some dlls in that directory and that's why it can handle the msix format.

Anyway, Thanks!