The passTypeIdentifier or teamIdentifier provided may not match your certificate, or the certificate trust chain could not be verified
每当我尝试通过按"添加"按钮安装手动打包的存折应用程序时,标题中都会出现错误。我可以成功安装使用 \\'signpass\\' 工具打包的存折应用程序,但我现在需要在 unix 服务器上创建动态包。
我一直在尝试将我的存折应用程序与来自网络的各种包手动打包,每个包都给我同样的错误。这是我尝试过的几个软件包:
https://github.com/maater/TCSH-PKPass
https://github.com/devartis/passbook
https://github.com/pcperini/PyPKPass
这是创建和压缩的 pass.json(请注意,teamIdentifier 和 passTypeIdentifier 都已填充):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | { "formatVersion" : 1, "passTypeIdentifier" :"pass.votizen.membership", "serialNumber" :"ASDF", "webServiceURL" :"https://www.votizen.com/passbook/", "authenticationToken" :"AUTH_TOKEN", "teamIdentifier" :"MY_TEAM_IDENTIFIER", "organizationName" :"Matthew Snider", "description" :"Your voter registration card", "logoText" :"VOTIZEN", "labelColor":"#B7B0A8", "foregroundColor" :"#5F6062", "backgroundColor" :"#FCFAF5", "generic" : { "headerFields": [ { "key" :"reg_date", "label":"VOTER SINCE", "value" :"2002" } ], "primaryFields" : [ { "key" :"party", "label":"REGISTERED PARTY", "value" :"Democrat" } ], "secondaryFields" : [ { "key" :"election", "label" :"NEXT ELECTION", "value" :"November 6, 2012" }, ], "auxiliaryFields" : [ { "key" :"polling_place", "label" :"POLLING PLACE", "value" :"268 E Julian Street, San Jose, CA 95112", "textAlignment" :"PKTextAlignmentLeft" } ], "backFields" : [ { "key" :"elections", "label" :"ELECTIONS YOU VOTED IN", "value" :"2010 General\ 2008 General\ 2008 Primary\ 2004 General" }, { "key" :"polling", "label" :"DIRECTIONS TO YOUR POLLING PLACES", "value" :"https://maps.apple.com/maps?q=268+E+Julian+Street,+San+Jose,+CA+95112" }, { "key" :"website", "label" :"Powered by Votizen", "value" :"https://www.votizen.com/" } ] } } |
我按照苹果上的步骤生成我的 Pass Type ID 证书,下载并安装在我的 Keychain Access 中。然后我将其导出为 "Certificates.p12" 并运行以下命令以生成 certificate.pem 和 key.pem:
1 2 3 4 | set P12 = Certificates.p12 sef PASSWORD = MY_PASSWORD openssl pkcs12 -passin pass:$PASSWORD -in"$P12" -clcerts -nokeys -out certificate.pem openssl pkcs12 -passin pass:$PASSWORD -in"$P12" -nocerts -out key.pem -passout pass:$PASSWORD |
创建清单文件后,我运行:
1 | openssl smime -passin pass:$PASSWORD -binary -sign -certfile wwdr.pem -signer certificate.pem -inkey key.pem -in manifest.json -out signature xs-outform DER |
我通过将 Apple 全球开发者关系证书颁发机构导出为隐私增强邮件文件来创建 wwdr.pem。
我在某处读到您需要安装 Apple 根证书颁发机构(我已经安装了),所以这里是我已安装的证书列表:
- Apple 应用程序集成证书颁发机构 Apple 根 CA
- Apple 根证书颁发机构申请全球开发者关系
- 认证机构
- com.apple.idms.appleid.prd.4f3756614a59746e554a36344e6b55426b64576441413d3d
- com.apple.ubiquity.peer-uuid.207240B0-758A-4C1E-B173-D1B70FF03533
- com.apple.ubiquity.peer-uuid.C5D1968F-8923-48E4-A09D-8C9AE485A88B
- com.apple.ubiquity.ssl-cert.C5D1968F-8923-48E4-A09D-8C9AE485A88B
- iPhone 开发者:Matthew Snider 通行证类型 ID:
- pass.votizen.membership
很明显,我使用的证书或我打包它的方式有问题。我不知道我做错了什么。我希望有人有一个想法。
我想通了。在创建 p12 文件时,我没有意识到您需要同时选择证书和私钥。我假设导出证书也将包含私钥,但事实并非如此。当您在 Keychain Access 中导出 Pass Type ID 时,请确保它显示"Export 2 Items",而不是"Export Pass Type ID: ..."。
我知道这是一个古老的问题,但最近我又遇到了。问题是"新"Apple WWDR 证书与同样由 Apple 创建的 pass 证书不兼容。
解决方案是在签署通行证时使用"旧"WWDR 证书,该证书将于 2023 年到期。