如何使用 Window Store 证书为我的 Windows Store 应用程序签名?

How can I sign my Windows Store app from Window Store certificate?

我刚刚从 Windows 商店购买了我的开发者帐户,我想在上传之前签署我的应用程序。当我进入包装并点击选择证书按钮时,我看到以下选项:

  1. 从证书库中选择
  2. Select 来自文件
  3. 创建测试证书。

我用第三个选项测试了所有内容,但第一个选项,从证书存储中选择,给我如下错误:

No Certificate Available

No certificates meet the application criteria.

这是错误的屏幕截图:

我应该如何获得证书?我想像 Apple iTunes 一样,我可以从商店创建证书,然后我将使用它或喜欢 Android 自签名证书。

我正在使用 Visual Studio 2013..

请帮忙

您需要一个代码签名证书。查看 this blog post(来自 Hanselman),您会在其中找到 link 到您可以从中购买协同设计的 CA 之一。

在大多数情况下,您需要购买代码签名证书,但您可以从 CA(即,如果您是开源开发人员)免费获得它。其中之一是 Cetrum CA(我目前正在使用)。看看here。获取的过程是一种折磨,但是证书本身是可以的。 (它不适用于所有浏览器 - 使用 FF,需要在每个页面上完成单点登录并且邮件使用波兰语。)

我相信只有在旁加载应用时才需要对其进行签名。如果您将其上传到 Windows 应用商店,Microsoft 将为您签署该应用程序。

来自 MSDN 文章 Submitting Your Windows 8 Apps:

Signing and publishing. In this final step, we'll sign the packages you submitted with a trusted certificate that matches the technical details of your developer account. This provides customers with the assurance that the app is certified by the Windows Store and hasn't been tampered with.

不确定这是否是 related/helpful 但 FWIW 我最近不得不为我的 windows 商店应用程序(本地 testing/installs)获得一个代码签名证书。以下命令行脚本对我有用,以防它们帮助其他人。

第 1 部分:生成证书

(运行 这些来自 Visual Studio 201x 命令提示符)

# 1) Generate .PVK and .CER
MakeCert /n "CN=YourMSPartnerPublisherIDString" /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /sv MyAppName.pvk MyAppName.cer

# 2) Generate .PFX
Pvk2Pfx /pvk  MyAppName.pvk /pi "password" /spc MyAppName.cer /pfx MyAppName.pfx /po "password"

第 2 部分:从 EXE 创建 APPX 并签署 APPX w/the 证书

(运行 这些来自命令行作为管理员)

# 3) Generate APPX from EXE
# (Assumes you have your App EXE and valid AppManifest.xml in C:\MyAppFolder\AppxPackage folder)
"C:\Program Files (x86)\Windows Kits\bin.0.17763.0\x64\makeappx.exe" pack /p "C:\MyAppFolder\MyAppName.appx" /d "C:\MyAppFolder\AppxPackage"

# 4) Sign APPX with Cert
"C:\Program Files (x86)\Windows Kits\bin.0.17763.0\x64\signtool.exe" sign /fd sha256 /a /f "C:\MyAppFolder\CertMyAppName.pfx" /p password "C:\MyAppFolder\MyAppName.appx"