【问题标题】:Sigining UWP-Apps with custom code sign certificate使用自定义代码签名证书对 UWP 应用进行签名
【发布时间】:2017-03-14 13:34:20
【问题描述】:

使用 Xamarin.Forms UWP 创建公司内部应用的具体要求是什么?我可以编译 *.appxbundle-Package 但由于证书错误,没有人可以安装它。如果我尝试使用来自 StartSSL 的普通代码签名证书对包进行签名,则会收到以下错误:

Manifest Designer 无法导入证书。

您选择的证书对签名无效,因为它是 要么过期,要么有其他问题。有关更多信息,请参阅: https://go.microsoft.com/fwlink/?LinkID=241478

我们的其他桌面应用程序使用相同的证书与signtool,所以我猜证书是好的。其他 .NET 程序集(例如 WPF 项目)的 signtool 用法:

"C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe" sign /f "..\..\..\..\..\Finaltec\Framework\Signing.pfx" /p ... /tr "http://timestamp.globalsign.com/scripts/timestamp.dll" "$(TargetPath)"

对 UWP 应用签名以便任何人都可以安装它是否有任何特殊要求?使用的证书是 3 类 StartSSL 代码签名证书,有效期至 2020 年 6 月。如果我尝试使用从 Visual Studio 生成的测试证书安装应用程序,我收到根证书不受信任的消息,并且安装进程将被取消。即使我在得到相同的结果错误之前安装了证书手册。

代码签名证书信息:

  • 名称:CVA Computer - Visualisierung und Animation GmbH
  • 地址:Beckebohnen 2
  • 邮编,城市:31618 利伯瑙
  • 州、国家/地区:德国下萨克森州
  • 电话:+49-502398110
  • 电子邮件:info@cva.de
  • 有效期:2017-04-14

Package.appxmanifest 内容:

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
  <Identity Name="f736c883-f105-4d30-a719-4bf328872f5e" Publisher="CN=CVA Computer - Visualisierung und Animation GmbH" Version="1.0.1.0" />
  <mp:PhoneIdentity PhoneProductId="f736c883-f105-4d30-a719-4bf328872f5e" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
  <Properties>
    <DisplayName>CVA.COS_App</DisplayName>
    <PublisherDisplayName>CVA Computer - Visualisierung und Animation GmbH</PublisherDisplayName>
    <Logo>Assets\StoreLogo.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
  </Dependencies>
  <Resources>
    <Resource Language="x-generate" />
  </Resources>
  <Applications>
    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="FPCL.WIndows.App">
      <uap:VisualElements DisplayName="CVA.COS_App" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="CVA.COS_App" BackgroundColor="#f4f4f4">
        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
        </uap:DefaultTile>
        <uap:SplashScreen Image="Assets\SplashScreen.png" />
        <uap:InitialRotationPreference>
          <uap:Rotation Preference="portrait" />
          <uap:Rotation Preference="landscape" />
          <uap:Rotation Preference="portraitFlipped" />
          <uap:Rotation Preference="landscapeFlipped" />
        </uap:InitialRotationPreference>
      </uap:VisualElements>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name="internetClient" />
    <Capability Name="privateNetworkClientServer" />
    <DeviceCapability Name="webcam" />
  </Capabilities>
</Package>

【问题讨论】:

    标签: certificate xamarin.forms uwp codesign xamarin.uwp


    【解决方案1】:

    如果我尝试使用我们来自 StartSSL 的普通代码签名证书对包进行签名,我收到以下错误

    如果我们要唱 UWP 应用,则需要代码签名证书。您从 StartSSL 获得的证书用于客户端身份验证,您可以检查 Enhanced Key Usage 字段:

    可用的代码签名证书:

    来自 StartSSL 的证书:

    另请参阅:What is special about a code signing certificate?Intro to certificates

    -----2016 年 11 月 16 日更新------

    请参阅https://go.microsoft.com/fwlink/?LinkID=241478 的验证证书部分

    看起来这个证书违反了我加粗的句子:

    验证增强型密钥使用属性的值,该属性必须 包含代码签名,也可能包含终身签名。 任何 禁止使用其他 EKU

    他们的屏幕截图(下图)显示了增强的键 Codesignatur 和 Kernelmodus-Codesignatur

    【讨论】:

    • 使用的证书是代码签名证书。看这个截图:puu.sh/scrNZ/f01ad0100b.png(“Erweiterte Schlüsselverwendung”在英语中的意思是“Enhanced Key Usage”,“Codesignatur”的意思是“Code Singing”)
    • @user2050176 求人确认一下,请注意我的回复,谢谢理解:)
    • @Sebastian 请查看我的更新答案:2016 年 11 月 16 日更新
    • 所以这意味着我们的证书被禁止,因为还支持内核模式代码签名?好吧,我想这就是运气不好,因为我们无法在 StartCom 没有内核模式的情况下创建商业证书:/
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-21
    • 1970-01-01
    • 2022-01-13
    • 2014-12-30
    • 2012-09-10
    • 2015-06-06
    • 2019-10-16
    相关资源
    最近更新 更多