【发布时间】:2020-01-09 06:02:08
【问题描述】:
我需要为所有苹果操作自动设置:
- 创建 csr(我在终端中使用 openssl 完成)
- 在 developer.apple 中创建证书(我使用了 apple api https://developer.apple.com/documentation/appstoreconnectapi/create_a_certificate)
- 需要获取证书详细信息,我做到了,但我无法从返回的响应中下载 .cer 文件。在手动情况下,它可以从 developer.apple.com 安装,所以我需要在我的软件中进行动态安装。
响应示例:([GET] https://api.appstoreconnect.apple.com/v1/certificates/{id} )
"data": {
"type": "certificates",
"id": "cert id xxxx",
"attributes": {
"serialNumber": "xxxxx",
"certificateContent": "cer content...",
"displayName": "xxx",
"name": "iOS Distribution: xxx",
"csrContent": null,
"platform": "IOS",
"expirationDate": "2020-09-03T20:03:52.000+0000",
"certificateType": "IOS_DISTRIBUTION"
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/certificates/xxx"
}
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/certificates/xxx"
}
}
Apple 说你可以用这个 api 下载,我研究了如何从这个数据创建 .cer,因此我不能。
注意:如果解码“certificateContent”,我可以看到我的公司信息。
总结:我需要从这个响应中创建 cer 并添加到钥匙串
这个命令:security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ios_distribution.cer
【问题讨论】:
标签: ios xcode certificate apple-developer