如何将私钥添加到分发证书?

问题描述:

好吧,我已经将我的开发人员证书与它的私钥链接了.效果很好.

Well, I've got my Developer Certificate linked with it's private key. Works Fine.

我已经下载了发行人的iOS个人资料,但显示未找到有效的签名身份.

I've downloaded my iOS Profile of distributor, but it says Valid signing identity not found.

因此,我检查了我的证书,确切地说,是我的开发人员证书,它与它的私钥链接在一起,而不是我的发行证书.如何将我的私钥链接/添加到此证书!?

So I checked my certificates, and exactly, my developer certificate it's linked with its private key but not my distribution certificate. How can I link/add my private keys to this certificate!?

这将解决找不到有效签名身份"问题吗?

Will this solve the problem "Valid Signing identity not found"?

是的,您收到的错误意味着您的Mac上没有与要用来对应用程序进行签名的分发证书相关联的私钥.

Yes, the error you are getting means that there is not a private key on your Mac associated with the distribution certificate you are trying to use to sign the app.

有两种可能的解决方案,具体取决于请求分发证书的计算机是否可用.

There are two possible solutions, depending on whether the computer who requested the distribution certificate is available or not.

如果请求分发证书的计算机可用(或者某处有分发资产的备份)

  1. 在生成分发资产的计算机上,打开Xcode.
  2. 单击窗口,管理器.
  3. 展开团队"部分.
  4. 选择您的团队,选择"iOS Distribution"类型的证书,单击导出",然后按照说明进行操作.
  5. 保存导出的文件并转到计算机.
  6. 重复步骤1-3.
  7. 点击导入,然后选择之前导出的文件.

如果无法再访问创建分发配置文件的计算机(并且没有备份)

您必须吊销证书并创建一个新证书.

You have to revoke the certificate and create a new one.

您可能需要请团队管理员或代理为您提供一些特权才能生成分发证书.拥有足够的特权后,请按照以下步骤操作(从2013年5月15日开始准确):

You may need to ask your team admin or agent to give you some privileges in order to generate distribution certificates. Once you have enough privileges, follow these steps (accurate as of 15-May-2013):

  1. 转到此网页: https://developer.apple.com/devcenter/ios /index.action
  2. 点击会员中心",然后输入您的iOS开发者凭据.
  3. 单击证书,标识符和配置文件".
  4. 点击"iOS应用"部分下的证书".
  5. 展开左侧的证书"部分,选择分发",然后单击您的分发证书.
  6. 点击撤消并按照说明进行操作.
  7. 单击加号以添加新证书.
  8. 选择"App Store和Ad Hoc"选项,然后单击继续".
  9. 按照网页上打印的步骤进行操作.这涉及在Mac上打开钥匙串"应用程序并从那里生成证书签名请求.点击继续.
  10. 上传.csr文件,然后单击继续".
  11. 已生成证书以进行分发.下载并双击将其集成到您的钥匙串中.
  1. Go to this webpage: https://developer.apple.com/devcenter/ios/index.action
  2. Click on "Member Center" and enter your iOS developer credentials.
  3. Click on "Certificates, Identifiers & Profiles".
  4. Click on "Certificates" under the "iOS Apps" section.
  5. Expand the Certificates section on the left, select Distribution, and click on your distribution certificate.
  6. Click Revoke and follow the instructions.
  7. Click on the plus sign to add a new certificate.
  8. Select "App Store and Ad Hoc" option, and click Continue.
  9. Follow the steps printed in the webpage. That involves opening the Keychain application on your Mac and generate a Certificate Signing Request from there. Click Continue.
  10. Upload the .csr file and click Continue.
  11. A certificate is generated for distribution. Download it and double click it to integrate it in your keychain.

重新打开Xcode并检查您的项目配置,以查看是否现在可以选择"iPhone Distribution"证书(即该证书未变灰).

Reopen Xcode and check your project configuration to see if you can now select an "iPhone Distribution" certificate (i.e. it's not grayed out).