如何向分发证书添加私钥?

时间:2021-11-08 11:11:49

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

我有我的开发证书和它的私钥联系在一起。工作很好。

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

我下载了分销商的iOS配置文件,但它说没有找到有效的签名标识。

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"?

这会解决“找不到有效签名标识”的问题吗?

8 个解决方案

#1


71  

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.

是的,您得到的错误意味着您的Mac上没有一个私钥与您试图用来签署应用程序的分发证书相关联。

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

根据请求分发证书的计算机是否可用,有两种可能的解决方案。

If the computer who requested the distribution certificate is available (or there is a backup of the distribution assets somewhere)

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

  1. From the computer where the distribution asset was generated, open Xcode.
  2. 从生成分发资产的计算机打开Xcode。
  3. Click on Window, Organizer.
  4. 点击窗口,组织者。
  5. Expand the Teams section.
  6. 展开团队部分。
  7. Select your team, select the certificate of "iOS Distribution" type, click Export and follow the instructions.
  8. 选择您的团队,选择“iOS发行版”类型的证书,单击Export并遵循说明。
  9. Save the exported file and go to your computer.
  10. 保存导出的文件并访问您的计算机。
  11. Repeat steps 1-3.
  12. 重复步骤1 - 3。
  13. Click Import and select the file you exported before.
  14. 单击Import并选择之前导出的文件。

If the computer where the distribution profile was created is not accessible anymore (and there is not a backup)

如果创建分发概要文件的计算机不再可访问(而且没有备份)

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

您必须撤销证书并创建一个新的证书。

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):

您可能需要请求您的团队管理员或代理给您一些特权,以便生成分发证书。一旦你有足够的特权,遵循以下步骤(准确到2013年5月15日):

  1. Go to this webpage: https://developer.apple.com/devcenter/ios/index.action
  2. 进入这个网页:https://developer.apple.com/devcenter/ios/index.action
  3. Click on "Member Center" and enter your iOS developer credentials.
  4. 点击“会员中心”,输入你的iOS开发者证书。
  5. Click on "Certificates, Identifiers & Profiles".
  6. 点击“证书、标识符和配置文件”。
  7. Click on "Certificates" under the "iOS Apps" section.
  8. 点击“iOS应用”部分下的“证书”。
  9. Expand the Certificates section on the left, select Distribution, and click on your distribution certificate.
  10. 展开左边的证书部分,选择发行版,然后单击您的发行版证书。
  11. Click Revoke and follow the instructions.
  12. 单击Revoke并按照说明进行操作。
  13. Click on the plus sign to add a new certificate.
  14. 单击加号添加新证书。
  15. Select "App Store and Ad Hoc" option, and click Continue.
  16. 选择“App Store and Ad Hoc”选项,然后单击“继续”。
  17. 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.
  18. 按照网页上打印的步骤操作。这包括打开Mac上的Keychain应用程序,并从那里生成一个证书签名请求。单击Continue。
  19. Upload the .csr file and click Continue.
  20. 上传。csr文件并单击Continue。
  21. A certificate is generated for distribution. Download it and double click it to integrate it in your keychain.
  22. 生成用于分发的证书。下载它,双击它将它集成到你的钥匙链中。

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).

重新打开Xcode并检查您的项目配置,看看您是否可以选择一个“iPhone发行版”证书(即它不是灰色的)。

#2


34  

Since the existing answers were written, Xcode's interface has been updated and they're no longer correct (notably the Click on Window, Organiser // Expand the Teams section step). Now the instructions for importing an existing certificate are as follows:

由于已经编写了现有的答案,Xcode的界面已经更新,它们不再正确(特别是单击窗口、组织者//展开团队部分步骤)。现在导入现有证书的说明如下:

To export selected certificates

选择出口证书

  1. Choose Xcode > Preferences.
  2. 选择Xcode >首选项。
  3. Click Accounts at the top of the window.
  4. 单击窗口顶部的帐户。
  5. Select the team you want to view, and click View Details.
  6. 选择要查看的团队,并单击view Details。
  7. Control-click the certificate you want to export in the Signing Identities table and choose Export from the pop-up menu.
  8. control -单击要在签名标识表中导出的证书,并从弹出菜单中选择export。

如何向分发证书添加私钥?

  1. Enter a filename in the Save As field and a password in both the Password and Verify fields. The file is encrypted and password protected.
  2. 在Save As字段中输入文件名,并在密码和验证字段中输入密码。文件是加密和密码保护。
  3. Click Save. The file is saved to the location you specified with a .p12 extension.
  4. 单击Save。文件被保存到您指定的扩展名为.p12的位置。

Source (Apple's documentation)

源(苹果的文档)

To import it, I found that Xcode's let-me-help-you menu didn't recognise the .p12 file. Instead, I simply imported it manually into Keychain, then Xcode built and archived without complaining.

为了导入它,我发现Xcode的let-me-help-you菜单没有识别.p12文件。相反,我只是手工将它导入到Keychain中,然后构建并归档Xcode,没有任何抱怨。

#3


10  

With Xcode 9 the interface has been updated and now the way I did to resolve the problem was this:

通过Xcode 9界面已经更新,现在我解决问题的方法是:

  1. Choose Xcode > Preferences.
  2. 选择Xcode >首选项。
  3. Click Accounts at the top of the window.
  4. 单击窗口顶部的帐户。
  5. Select the team you want to view
  6. 选择要查看的团队
  7. Click the gear icon (如何向分发证书添加私钥?) in the lower-left.
  8. 单击左下角的gear图标()。

如何向分发证书添加私钥?

  1. Export Apple Id and Code Signing Assets
  2. 导出Apple Id和代码签名资产
  3. After entering a filename in the Save As field and a password in both the Password and Verify fields you'll see a Window like this
  4. 在Save As字段中输入文件名,在password和Verify字段中输入密码后,您将看到这样的窗口

如何向分发证书添加私钥?

  1. Click the gear icon (如何向分发证书添加私钥?) -> Click Import -> Select the file you exported in step 6
  2. 单击gear图标()->单击Import ->选择您在步骤6中导出的文件

#4


3  

This site explain step by step that what you need to do Certificates, Identifiers & Profiles and as your question

这个网站一步一步地解释你需要做什么证书、标识符和概要文件以及作为你的问题

"Valid Signing identity not found"?

You need the private key that were used to sign the code base with provisioning profile. . If you don't have then you can generate a new signing request on the iOS developer portal.

您需要使用私钥,该私钥用于使用配置文件对代码库进行签名。如果没有,那么可以在iOS开发人员门户上生成一个新的签名请求。

For Export:

Xcode -> Organizer, select your team. Click Export. Specify a filename and a password, and click Save.`

Xcode ->组织者,选择你的团队。点击出口。指定文件名和密码,然后单击savev。

For Import:

Xcode -> Organizer, select your team. Click Import. Select the file containing your code signing assets. Enter the password for the file, and click Open.

Xcode ->组织者,选择你的团队。点击导入。选择包含代码签名资产的文件。输入文件的密码,然后单击Open。

#5


0  

For Developer certificate, you need to create a developer .mobileprovision profile and install add it to your XCode. In case you want to distribute the app using an adhoc distribution profile you will require AdHoc Distribution certificate and private key installed in your keychain.

对于开发人员证书,您需要创建一个Developer . mobile供应概要文件并将其添加到XCode中。如果您想使用adhoc分发应用程序,您需要在密钥链中安装adhoc分发证书和私钥。

If you have not created the cert, here are steps to create it. Incase it has already been created by someone in your team, ask him to share the cert and private key. If that someone is no longer in your team then you can revoke the cert from developer account and create new.

如果您没有创建cert,下面是创建它的步骤。如果它已经由您的团队中的某人创建,请他共享证书和私钥。如果某人不在您的团队中,那么您可以从开发人员帐户中撤销证书并创建新的证书。

#6


0  

"Valid Signing identity not found" This is because you don't have the private key for distribution certificate.

“未找到有效的签名标识”,因为您没有分发证书的私钥。

If the distribution certificate was created originally on a different Mac you may need to import this private key from that Mac. This private key is not available to download from your provisioning portal.

如果分发证书最初是在不同的Mac上创建的,那么您可能需要从Mac上导入这个私有密匙。

When you import the correct private key to your mac , XCode's organizer will recognize your already downloaded distribution profile as a "Valid profile"

当您将正确的私钥导入mac时,XCode的组织者将识别您已经下载的发行版配置文件为“有效配置文件”

However if you do not have access to the original Mac which created those profiles, the only option you have is revoking profiles.

但是,如果您无法访问创建这些概要文件的原始Mac,那么您唯一的选择就是撤销配置文件。

#7


0  

since xcode5 organizer no longer team section exists. but the bold sentence was the answer for me. God thanks there is another mac to restore and import to problemmatic mac. now all is ok.

因为xcode5组织者不再存在team section。但这句大胆的话是我的答案。感谢上帝,还有一个mac要恢复并导入有问题的mac,现在一切都好了。

#8


0  

What i did is that , i created a new certificate for distribution form my Mac computer and gave signing identity from this Mac computer as well, and thats it

我所做的是,我从我的Mac电脑中创建了一个新的分发证书,并从这台Mac电脑中给出签名身份,就是这样

#1


71  

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.

是的,您得到的错误意味着您的Mac上没有一个私钥与您试图用来签署应用程序的分发证书相关联。

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

根据请求分发证书的计算机是否可用,有两种可能的解决方案。

If the computer who requested the distribution certificate is available (or there is a backup of the distribution assets somewhere)

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

  1. From the computer where the distribution asset was generated, open Xcode.
  2. 从生成分发资产的计算机打开Xcode。
  3. Click on Window, Organizer.
  4. 点击窗口,组织者。
  5. Expand the Teams section.
  6. 展开团队部分。
  7. Select your team, select the certificate of "iOS Distribution" type, click Export and follow the instructions.
  8. 选择您的团队,选择“iOS发行版”类型的证书,单击Export并遵循说明。
  9. Save the exported file and go to your computer.
  10. 保存导出的文件并访问您的计算机。
  11. Repeat steps 1-3.
  12. 重复步骤1 - 3。
  13. Click Import and select the file you exported before.
  14. 单击Import并选择之前导出的文件。

If the computer where the distribution profile was created is not accessible anymore (and there is not a backup)

如果创建分发概要文件的计算机不再可访问(而且没有备份)

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

您必须撤销证书并创建一个新的证书。

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):

您可能需要请求您的团队管理员或代理给您一些特权,以便生成分发证书。一旦你有足够的特权,遵循以下步骤(准确到2013年5月15日):

  1. Go to this webpage: https://developer.apple.com/devcenter/ios/index.action
  2. 进入这个网页:https://developer.apple.com/devcenter/ios/index.action
  3. Click on "Member Center" and enter your iOS developer credentials.
  4. 点击“会员中心”,输入你的iOS开发者证书。
  5. Click on "Certificates, Identifiers & Profiles".
  6. 点击“证书、标识符和配置文件”。
  7. Click on "Certificates" under the "iOS Apps" section.
  8. 点击“iOS应用”部分下的“证书”。
  9. Expand the Certificates section on the left, select Distribution, and click on your distribution certificate.
  10. 展开左边的证书部分,选择发行版,然后单击您的发行版证书。
  11. Click Revoke and follow the instructions.
  12. 单击Revoke并按照说明进行操作。
  13. Click on the plus sign to add a new certificate.
  14. 单击加号添加新证书。
  15. Select "App Store and Ad Hoc" option, and click Continue.
  16. 选择“App Store and Ad Hoc”选项,然后单击“继续”。
  17. 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.
  18. 按照网页上打印的步骤操作。这包括打开Mac上的Keychain应用程序,并从那里生成一个证书签名请求。单击Continue。
  19. Upload the .csr file and click Continue.
  20. 上传。csr文件并单击Continue。
  21. A certificate is generated for distribution. Download it and double click it to integrate it in your keychain.
  22. 生成用于分发的证书。下载它,双击它将它集成到你的钥匙链中。

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).

重新打开Xcode并检查您的项目配置,看看您是否可以选择一个“iPhone发行版”证书(即它不是灰色的)。

#2


34  

Since the existing answers were written, Xcode's interface has been updated and they're no longer correct (notably the Click on Window, Organiser // Expand the Teams section step). Now the instructions for importing an existing certificate are as follows:

由于已经编写了现有的答案,Xcode的界面已经更新,它们不再正确(特别是单击窗口、组织者//展开团队部分步骤)。现在导入现有证书的说明如下:

To export selected certificates

选择出口证书

  1. Choose Xcode > Preferences.
  2. 选择Xcode >首选项。
  3. Click Accounts at the top of the window.
  4. 单击窗口顶部的帐户。
  5. Select the team you want to view, and click View Details.
  6. 选择要查看的团队,并单击view Details。
  7. Control-click the certificate you want to export in the Signing Identities table and choose Export from the pop-up menu.
  8. control -单击要在签名标识表中导出的证书,并从弹出菜单中选择export。

如何向分发证书添加私钥?

  1. Enter a filename in the Save As field and a password in both the Password and Verify fields. The file is encrypted and password protected.
  2. 在Save As字段中输入文件名,并在密码和验证字段中输入密码。文件是加密和密码保护。
  3. Click Save. The file is saved to the location you specified with a .p12 extension.
  4. 单击Save。文件被保存到您指定的扩展名为.p12的位置。

Source (Apple's documentation)

源(苹果的文档)

To import it, I found that Xcode's let-me-help-you menu didn't recognise the .p12 file. Instead, I simply imported it manually into Keychain, then Xcode built and archived without complaining.

为了导入它,我发现Xcode的let-me-help-you菜单没有识别.p12文件。相反,我只是手工将它导入到Keychain中,然后构建并归档Xcode,没有任何抱怨。

#3


10  

With Xcode 9 the interface has been updated and now the way I did to resolve the problem was this:

通过Xcode 9界面已经更新,现在我解决问题的方法是:

  1. Choose Xcode > Preferences.
  2. 选择Xcode >首选项。
  3. Click Accounts at the top of the window.
  4. 单击窗口顶部的帐户。
  5. Select the team you want to view
  6. 选择要查看的团队
  7. Click the gear icon (如何向分发证书添加私钥?) in the lower-left.
  8. 单击左下角的gear图标()。

如何向分发证书添加私钥?

  1. Export Apple Id and Code Signing Assets
  2. 导出Apple Id和代码签名资产
  3. After entering a filename in the Save As field and a password in both the Password and Verify fields you'll see a Window like this
  4. 在Save As字段中输入文件名,在password和Verify字段中输入密码后,您将看到这样的窗口

如何向分发证书添加私钥?

  1. Click the gear icon (如何向分发证书添加私钥?) -> Click Import -> Select the file you exported in step 6
  2. 单击gear图标()->单击Import ->选择您在步骤6中导出的文件

#4


3  

This site explain step by step that what you need to do Certificates, Identifiers & Profiles and as your question

这个网站一步一步地解释你需要做什么证书、标识符和概要文件以及作为你的问题

"Valid Signing identity not found"?

You need the private key that were used to sign the code base with provisioning profile. . If you don't have then you can generate a new signing request on the iOS developer portal.

您需要使用私钥,该私钥用于使用配置文件对代码库进行签名。如果没有,那么可以在iOS开发人员门户上生成一个新的签名请求。

For Export:

Xcode -> Organizer, select your team. Click Export. Specify a filename and a password, and click Save.`

Xcode ->组织者,选择你的团队。点击出口。指定文件名和密码,然后单击savev。

For Import:

Xcode -> Organizer, select your team. Click Import. Select the file containing your code signing assets. Enter the password for the file, and click Open.

Xcode ->组织者,选择你的团队。点击导入。选择包含代码签名资产的文件。输入文件的密码,然后单击Open。

#5


0  

For Developer certificate, you need to create a developer .mobileprovision profile and install add it to your XCode. In case you want to distribute the app using an adhoc distribution profile you will require AdHoc Distribution certificate and private key installed in your keychain.

对于开发人员证书,您需要创建一个Developer . mobile供应概要文件并将其添加到XCode中。如果您想使用adhoc分发应用程序,您需要在密钥链中安装adhoc分发证书和私钥。

If you have not created the cert, here are steps to create it. Incase it has already been created by someone in your team, ask him to share the cert and private key. If that someone is no longer in your team then you can revoke the cert from developer account and create new.

如果您没有创建cert,下面是创建它的步骤。如果它已经由您的团队中的某人创建,请他共享证书和私钥。如果某人不在您的团队中,那么您可以从开发人员帐户中撤销证书并创建新的证书。

#6


0  

"Valid Signing identity not found" This is because you don't have the private key for distribution certificate.

“未找到有效的签名标识”,因为您没有分发证书的私钥。

If the distribution certificate was created originally on a different Mac you may need to import this private key from that Mac. This private key is not available to download from your provisioning portal.

如果分发证书最初是在不同的Mac上创建的,那么您可能需要从Mac上导入这个私有密匙。

When you import the correct private key to your mac , XCode's organizer will recognize your already downloaded distribution profile as a "Valid profile"

当您将正确的私钥导入mac时,XCode的组织者将识别您已经下载的发行版配置文件为“有效配置文件”

However if you do not have access to the original Mac which created those profiles, the only option you have is revoking profiles.

但是,如果您无法访问创建这些概要文件的原始Mac,那么您唯一的选择就是撤销配置文件。

#7


0  

since xcode5 organizer no longer team section exists. but the bold sentence was the answer for me. God thanks there is another mac to restore and import to problemmatic mac. now all is ok.

因为xcode5组织者不再存在team section。但这句大胆的话是我的答案。感谢上帝,还有一个mac要恢复并导入有问题的mac,现在一切都好了。

#8


0  

What i did is that , i created a new certificate for distribution form my Mac computer and gave signing identity from this Mac computer as well, and thats it

我所做的是,我从我的Mac电脑中创建了一个新的分发证书,并从这台Mac电脑中给出签名身份,就是这样