Generating a Test Certificate for Windows 10 UWP with 10 years expiry

Generating a Test Certificate for Windows 10 UWP with 10 years expiry



I have generated a certificate using following Powershell Command:


New-SelfSignedCertificate -Type Custom -Subject "CN=Something" -TextExtension @("2.5.29.37=criticaltext1.3.6.1.5.5.7.3.3", "2.5.29.19=text") -KeyUsage DigitalSignature -FriendlyName "Friendly Name" -CertStoreLocation "Cert:LocalMachineMy" -NotBefore (Get-Date) -NotAfter (Get-Date).AddYears(10)



Then I am exporting it using following command:


Export-PfxCertificate -cert "Cert:LocalMachineMy0fa4dd7524315b780abaa9cb70dc4755da1103c" -FilePath C:testcertificate.pfx -Password $pwd



Now when I am using this certificate from Package.appxmanifest file. It is throwing following error:



enter image description here



I am using Visual Studio 2017 with SDK Version 1809



I have also tried to export using Certificate Management Snap in MMC.



What am I missing?






So turns out that I need to import the certificate first into my system certificate store. When I run visual studio as admin, it is not failing.

– Daredevil
Sep 17 '18 at 12:18






If this works for you, post it as an answer and mark it as accepted.

– kennyzx
Sep 17 '18 at 13:36




2 Answers
2



I'm not sure about the Powershell commands, but you can do this with the normal SDK commands makecert, pvk2pfx, and certutil.


makecert


pvk2pfx


certutil



You can get a sample batch file from this GitHub project but the basic commands are as follows (using an expiry date of 1/1/2030):


makecert /n CN=foo /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e 1/1/2030 /sv foo.pvk foo.cer

pvk2pfx /pvk foo.pvk /spc foo.cer /pfx foo.pfx

certutil -addstore TrustedPeople foo.cer



You can try skipping signing checks.



Open the project file (.csproj), and add the following line under the first PropertyGroup element.


PropertyGroup


<EnableSigningChecks>false</EnableSigningChecks>






Can we sideload after skipping signing checks?

– Daredevil
Sep 17 '18 at 12:17






It works in my test. - Edit: we have been doing this for years.

– kennyzx
Sep 17 '18 at 12:43




Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

How do I collapse sections of code in Visual Studio Code for Windows?