我应该保存哪些私钥才能重建我的 iOS 应用程序?
在 Apple 的 iOS 配置门户中,在 Distribution > 下“准备应用程序”,有一个严厉的警告,告诉我保存私钥的重要性。 (要查看它,请单击“获取您的 iOS 分发证书”,然后单击“保存您的私钥并传输到其他系统。”)下面是它的内容:
如果您需要在多台 Mac 上构建应用程序或决定重新安装系统操作系统,请将私钥保存在安全的地方,这一点至关重要。 如果没有您的私钥,您将无法在 Xcode 中签署二进制文件,并且您将无法将您的应用程序上传到 App Store 或在任何 Apple 设备上安装您的应用程序。生成 CSR 时,钥匙串访问应用程序在您的登录钥匙串上创建私钥。此私钥与您的用户帐户绑定,如果由于操作系统重新安装而丢失,则无法复制。如果您计划在多个系统上进行开发和测试,则需要将私钥导入到您将要处理的所有系统上。
- 要导出您的私钥和证书以便妥善保管,请打开钥匙串访问应用程序并选择“密钥”类别。
- 突出显示与您的 iOS 分发证书关联的私钥,然后从“文件”菜单中选择“导出项目”。以个人信息交换 (.p12) 文件格式保存您的密钥。
- 系统将提示您创建一个密码,当您尝试在另一台计算机上导入此密钥时将使用该密码。
- 您现在可以在系统之间传输此 .p12 文件。双击 .p12 以在系统上安装。系统将提示您输入上面首次输入的密码。
我不知道要保存哪个私钥,而且我不太明白所有这些东西是如何工作的。
我想我可能应该保存与名为“iPhone Distribution:Acme Software”的证书关联的私钥(其中“Acme Software”是公司的[虚构]名称)。如果我转到“证书”部分,则会有一个具有该名称的证书,如果我展开该部分,则会在其下方有一个名为“Mike Morearty”(我的名字)的私钥。所以我可以导出它。
但配置门户上的说明说要转到“密钥”部分,而不是“证书”部分。在“密钥”下,我看到六个私钥都名为“Mike Morearty”,并且无法区分其中的大多数。其中有几个证书嵌套在其下面,例如,一个具有“iPhone 开发人员:Mike Morearty”,另一个具有“Apple 开发推送服务:...”。我明白这一点。但它们都没有显示“iPhone Distribution:Acme Software”。
我是否应该单击“证书”部分中“iPhone Distribution:Acme Software”证书下的“Mike Morearty”私钥?或者有什么方法可以确定要从“密钥”部分导出哪个私钥?
In Apple's iOS Provisioning Portal, under Distribution > "Prepare App," there is a stern warning about how critical it is that I save my private key. (To see it, click "Obtaining your iOS Distribution Certificate," then "Saving your Private Key and Transferring to Other Systems.") Here is what it says:
It is critical that you save your private key somewhere safe in the event that you need to build your application on multiple Macs or decide to reinstall your system OS. Without your private key, you cannot sign binaries in Xcode and there you will be unable to upload your application to the App Store or install your application on any Apple device. When a CSR is generated, the Keychain Access application creates a private key on your login keychain. This private key is tied to your user account and cannot be reproduced if lost due to an OS reinstall. If you plan to do development and testing on multiple systems, you will need to import your private key onto all of the systems you’ll be doing work on.
- To export your private key and certificate for safe-keeping, open up the Keychain Access Application and select the “Keys” category.
- Highlight the private key associated with your iOS Distribution Certificate and select “Export Items” from the ‘File’ menu. Save your key in the Personal Information Exchange (.p12) file format.
- You will be prompted to create a password which will be used when you attempt to import this key on another computer.
- You can now transfer this .p12 file between systems. Double-click on the .p12 to install on a system. You will be prompted for the password you first entered above.
I can't figure out which private key to save, and I don't quite understand how all this stuff works.
I figured I was probably supposed to save the private key that is associated with the certificate named "iPhone Distribution: Acme Software" (where "Acme Software" is the [fictional] name of the company). If I go to the "Certificates" section, then there is a certificate with that name, and if I expand that section, there is a private key under it named "Mike Morearty" (my name). So I could export that.
But the instructions on the Provisioning Portal said to go to the "Keys" section, not the "Certificates" section. Under "Keys," I see six private keys all named "Mike Morearty," and there is no way to tell most of them apart. A couple of them have certificates nested underneath them, e.g. one has "iPhone Developer: Mike Morearty," and another has "Apple Development Push Services: ...". I understand that. But none of them shows "iPhone Distribution: Acme Software."
Should I just click the "Mike Morearty" private key that was under the "iPhone Distribution: Acme Software" certificate in the Certificates section? Or is there some way to figure out which private key to export from the Keys section?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了安全起见,您可以将它们全部导出。
但是,如果您在 XCode 中有一个使用正确密钥的工作构建环境,那么您也可以导出您的开发人员配置文件。在 XCode 中,转到 Window->Organizer,然后在“Development”下找到“Developer Profile”。导出开发人员配置文件为该 XCode 安装中的所有有效身份导出适当的私钥。
To be safe, you could export all of them.
However, if you have a working build environment in XCode that uses the proper keys then you can also export your developer profile. in XCode go to Window->Organizer and find "Developer Profile" under "Development". The Export Developer Profile exports the appropriate private keys for all the valid identities in that XCode installation.