清单签名未验证成功

Manifest signature did not verify successfully

我正在为我们的应用程序实现存折,它在 Android 上运行良好,但现在在 iOS 和 Mac OS 上运行良好,可能是因为它的签名或认证。

我有 2 个证书文件:

  1. company.pfx(有效期至 2021 年)
  2. AppleWWDRCA.cer(最新)

还有那个 .pfx 文件的密码。

我正在使用 dotnet-passbook framework in a .NET MVC Webapi, also you can find my issue in the repository here


我正在使用以下代码生成 de .pkpass 文件:

     public static byte[] Generate(Models.PassKey.PassBookTicketData data)
      {
        // Generator to get the passkey
        var generator = new PassGenerator();

        string appleCertPath = (HttpContext.Current.Server.MapPath("~/Certificates/AppleWWDRCA.cer"));
        string companyCertPath = (HttpContext.Current.Server.MapPath("~/Certificates/company.pfx"));

        // Request to send
        var request = new PassGeneratorRequest()
        {
            PassTypeIdentifier = "pass.com.company",
            TeamIdentifier = "TEAM",
            Certificate = File.ReadAllBytes(companyCertPath),
            CertificatePassword = ConfigurationManager.AppSettings["PASSBOOK_PASSWORD"],
            AppleWWDRCACertificate = File.ReadAllBytes(appleCertPath),
            SerialNumber = Guid.NewGuid().ToString(),
            Description = data.Description,
            OrganizationName = "some organization",
            BackgroundColor = ColorHexToPassBookColor("#00517c"),
            ForegroundColor = ColorHexToPassBookColor("#f68700"),
            LabelColor = ColorHexToPassBookColor("#ffffff"),
            LogoText = "some text",
            GroupingIdentifier = data.EventCode
        };

             // .... images, icons, fields, etc

             return generator.Generate(request);
       }

它缺少您添加字段、图像、图标的部分,但现在这无关紧要,如果您需要,我用整个代码创建了一个 Gist它。


发送时需要重新制作证书才能生效吗?

我是 dotnet-passbook 的开发者,我在 Github 上帮助 Emiliano 解决了这个问题。

问题在于用于签署清单的 pfx 证书。

此证书不是从 Apple Developer 门户生成的,因此缺少必需的信息。我 运行 通过了我的验证工具 (https://pkpassvalidator.azurewebsites.net),这让我了解了问题所在。在确定通行证类型标识符和团队标识符值不同后,我进一步调查了证书。

您可以在此处阅读问题的完整历史记录 - https://github.com/tomasmcguinness/dotnet-passbook/issues/69