如何为 iPhone 分发证书创建私钥?

发布于 2024-07-16 02:48:54 字数 236 浏览 7 评论 0 原文

在iPhone开发者计划门户中,有一个视频演示如何创建开发证书和分配私钥

现在我已经完成了开发过程并开始分发

我已经创建了“分发证书”,但是如何分配私钥到这个证书?

因为编译时出现“CodeSign 错误:代码签名身份‘...’与钥匙串中的任何代码签名证书不匹配”,

如果我需要为分发证书分配私钥,我会很高兴现在就告诉我如何。

请注意,我在这里不是在谈论开发证书,谢谢。

In iPhone Developer Program Portal, there's a video to demonstrate how to create a development certificate and assign a private key

Now I have finished the development process and starting to distribute

I have created a "Distribution Certificate", but how do I assign a private key to this certificate?

As it got the "CodeSign error: code signing identity '...' does not match any code-signing certificate in your keychain" when compiles

It will be glad to let me now if I need to assign a private key to the distribution cert and how.

Please be noticed that I am NOT talking about development certificate here, thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

不回头走下去 2024-07-23 02:48:54

由于自从 Nathan 指出原始答案链接不可用以来,没有人更新或回答这个问题(在 stackoverflow 上发布的第一点“请务必回答问题”),这是我的答案经验,希望它对某人有所帮助:

对于这个特定问题(安装了开发/分发证书但没有私钥),答案是 2 个替代方案的选择:

1。 通过苹果开发者门户创建新的证书身份
在这种情况下,您需要登录苹果开发人员门户并使用助手,作为此过程的一部分,您需要创建并上传 CSR(证书签名请求),这还将在计算机上创建公钥和私钥。 Apple 对请求进行签名,瞧,这是一个签名的公共/私有证书对: 参考

2. 从最初用于创建证书的机器导出私钥
这种情况是当您使用之前创建的身份进行签名时,可能是在旧机器上,或者如果(如我的情况)您为已创建 ID 的客户进行开发。 如果您无法访问最初用于创建证书身份的计算机,您将必须按照指南/助理创建新身份。

为此,您需要通过钥匙串访问导出您的私钥(.p12 文件)或公钥/私钥对,并将私钥或密钥对安装到您进行开发的计算机上。 这是我在 stackoverflow 上找到的指南

参考:http://iphonedevsdk.com/forum/iphone-sdk-development/11498-problems-exporting-importing-p12-private-key-for-developing-on-another-mac.html

PS> 请注意,我现在正在执行后一个选项,虽然有证据表明这会起作用,但到目前为止我还没有测试过,如果不起作用,我会重新回复!

As no one has updated or answered this question since Nathan pointed out the original answer link is unavailable (Point number one on posting on stackoverflow "Please be sure to answer the question") here is an answer from my experiance, hope it helps someone:

For this specific question (Dev/Distribution cert installed but no private key) the answer is a choice of 2 alternatives:

1. Create a new certificate identity via the apple devloper portal
In this case you'll need to log into the apple developer portal and use the assistant, as part of this you will need to create and upload a CSR (Certificate Signing Request) which will also create the public and private keys on the machine. Apple sign the request and voila, a signed public/private certificate pair : Reference

2. Export the private key from the machine originally used to create the Certificate
This case is when your signing with an identity previously created, probably on an old machine or if (as in my case) your developing for a client that has their ID's already created. If you can't access the machine originally used to create the certificate identity you'll have to create a new identity as per the guide/assistant.

To do this, you will need to export your private key (a .p12 file), or public/private key pair via Keychain Access, and install the private key or key pair to the machine your developing on. Here's a guide I found on stackoverflow.

Ref: http://iphonedevsdk.com/forum/iphone-sdk-development/11498-problems-exporting-importing-p12-private-key-for-developing-on-another-mac.html

PS> Be warned, I am performing the latter option right now, and while evidence suggests this will work, it is untested by me as of yet, If if doesn't work I will re-reply!

南街女流氓 2024-07-23 02:48:54

请阅读 Xcode 帮助网站的维护签名资产部分。 它以正确的顺序逐步解释您需要执行的操作。

在对应用程序进行代码签名之前,您需要创建开发证书,稍后再创建分发证书以将应用程序上传到 iTunes Connect。 您可以使用 Xcode 创建所需的所有类型的证书和签名身份。 Xcode 会为您创建、下载并安装您的签名身份。

所有团队成员都可以创建自己的开发证书。 只有团队代理或管理员才能创建分发证书。 只有团队代理才能创建开发者 ID 证书。 如果您有组织会员资格,请阅读会员中心中的管理您的团队,了解团队角色和团队代理代表团队成员执行的任务的说明。

Xcode 在您需要时为您创建开发证书。 例如,当您将项目分配给团队或创建团队配置文件时(如配置身份和团队设置中所述),Xcode 会创建您的开发证书并将其添加到团队配置文件中。 因此,您通常使用 Xcode“首选项”窗口创建分发证书。

创建签名身份

  1. 在 Xcode 首选项窗口中,单击“帐户”。

  2. 选择您要使用的团队,然后单击“查看详细信息”。

  3. 在出现的对话框中,单击您要创建的证书类型所在行中的“创建”按钮。

    如果“创建”按钮被禁用,您将无法创建该类型的签名身份。 各类证书的说明请参见表14-2。

    创建签名身份后,“创建”按钮消失。

  4. 要返回“帐户”首选项,请单击“完成”。

Read the Maintain Signing Assets section of the Xcode Help site. It explains step-by-step what you will need to do, in the correct order.

Before you can code sign your app, you create your development certificate and later, a distribution certificate to upload your app to iTunes Connect. You can create all the types of certificates and signing identities you need using Xcode. Xcode creates, downloads, and installs your signing identities for you.

All team members can create their own development certificate. Only a team agent or admin can create a distribution certificate. Only a team agent can create a Developer ID certificate. If you have an organization membership, read Managing Your Team in Member Center for a description of team roles and tasks that team agents perform on behalf of team members.

Xcode creates your development certificate for you when you need it. For example, when you assign your project to a team or create the team provisioning profile, as described in Configuring Identity and Team Settings, Xcode creates your development certificate and adds it to the team provisioning profile. Because of this, you typically create distribution certificates using the Xcode Preferences window.

To create a signing identity

  1. In the Xcode Preferences window, click Accounts.

  2. Select the team you want to use, and click View Details.

  3. In the dialog that appears, click the Create button in the row of the type of certificate you want to create.

    If the Create button is disabled, you are not allowed to create that type of signing identity. For a description of each type of certificate, refer to Table 14-2.

    After the signing identity is created, the Create button disappears.

  4. To return to Accounts preferences, click Done.

别靠近我心 2024-07-23 02:48:54

对我来说 - 重新启动 Xcode 解决了这两个问题。
显然,一切都在某处正确设置,但需要刷新/同步。

For me - restarting Xcode solved both these issues.
Everything was obviously setup correctly somewhere, but needed to be flushed/synced.

请别遗忘我 2024-07-23 02:48:54

如果将鼠标悬停在图像上并单击红色小删除图标,则保存该图像。 离开并返回此页面,您将能够再次添加图标。

If you hover over the image and click the small red delete icon, then save this. Navigate away and come back to this page you will be able to add the icon again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文