分发证书和私钥
好吧,这是我的情况:我有 2 台 Macbook(我们称它们为 #1 和 #2),我在 2010 年开始在 #1 上进行开发
。2011 年 6 月,我的分发证书过期了,我必须更新它。在我的 #1 Macbook 上,我能够将证书更新到钥匙串中,并且再次更新我的应用程序时一切正常。
现在,在 2011 年 8 月,我也想更新我的 #2 上的证书,并认为我可以从 dev.apple 页面下载它并添加到钥匙串中。但是当我这样做时,证书下面的私钥丢失了!这是为什么? 2010 年分发配置文件的私钥仍然在(过期的)证书下方可见。
这让我非常疯狂,我回到 Macbook #1 并将那里的两个密钥导出到 #2。这当然有效,但它不能成为未来的解决方案!如果 Macbook 崩溃而我想通过新 Macbook 执行所有操作该怎么办?假设我无法从#1 中导出,我如何获得#2 中证书下方的怪异私钥?
其次,我有点困惑:我需要备份哪些密钥?我以为这只是私钥,但我无法在我的新 Macbook #2 上的分发证书“下方”获取它,这让我有点害怕。
顺便说一句:与苹果的证书之战是一个大笑话,但那是另一个话题了。
Ok here is my situation: I have 2 Macbooks (lets call them #1 and #2) and I started developing on #1 in 2010.
This June 2011, my distribution certificate expired and I had to renew it. On my #1 Macbook I was able to update the certificate into the keychain and everything was fine when updating my app again.
Now, in August 2011, I wanted to update the certificate on my #2 as well and thought I just could download it from dev.apple page and add to the keychain. But when I did that, the private key below the certificate was missing! Why is that? The private key for the distribution profile for 2010 was still there visible below the (expired) certificate.
It made me so crazy that I went back to Macbook #1 and exported both of the keys there to the #2. That worked of course, but it can't be the solution for the future! What if the Macbook crashes and I want to do everything via new Macbook? Lets assume I couldn't have done the export from #1, how would I get the freakin private key below the cert in #2?
Secondly, I am a bit confused: Which keys do I need to back up? I thought it was only the private key, but I couldn't get it "below" the distribution certificate on my new Macbook #2, which scares me a little bit.
BTW: the certificate war with Apple is a big joke, but that's another topic.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置证书后,转到 Xcode 的管理器,在左侧的“设备”选项卡下,您将看到“开发人员配置文件”部分,您可以在其中导出开发人员配置文件。它是一个受密码保护的文件,将保存您的所有开发/分发证书及其各自的私钥,以及您已安装的任何配置文件。当你有了这个文件后,你就可以将开发转移到新机器上,只需双击它,当 Xcode 打开它时,输入密码即可。
不管你信不信,“证书之战”对苹果来说并不是一个大笑话,你应该看看WP7,但那是其他地方可以讨论的。
Once you setup your certificates, go to Xcode's Organizer and under Devices tab on the left side you will see Developer Profile section where you can export your developer profile. It's a password-protected files that will hold all your development/distribution certificates and their respective private keys, as well as any provisioning profiles you have installed. When you have this file, it's all you need to move development to new machine, just double-click it and when Xcode opens it, enter the password.
And believe it or not, "certificate war" is not a big joke with Apple, you should see WP7, but that's for some other place to discuss about.