ios Xcode 在您的钥匙串中找不到此配置文件的有效私钥证书对

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8424017/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 15:46:56  来源:igfitidea点击:

Xcode could not find a valid private-key certificate pair for this profile in your keychain

ios

提问by Gruntcakes

[Before immediately marking as a duplicate, I've read through a few others with the same problem description but don't have a solution after applying answers from them]

[在立即标记为重复之前,我已经阅读了其他一些具有相同问题描述但在应用他们的答案后没有解决方案的人]

Several days ago I created a profile and was successfully able to use it to run app on my iPhone.

几天前,我创建了一个配置文件,并成功地使用它在我的 iPhone 上运行应用程序。

Now however I am using a different laptop for development and am unable to progress as I keep getting a "Xcode could not find a valid private-key certificate pair for this profile in your keychain". I have tried with the same iPhone/profile combination as I used previously, in additional I have another iPhone and have generated a new profile with that device's id. However I get the same message with that profile/phone too.

但是,现在我正在使用不同的笔记本电脑进行开发并且无法继续,因为我不断收到“Xcode 无法在您的钥匙串中找到此配置文件的有效私钥证书对”。我尝试过使用与我之前使用的相同的 iPhone/配置文件组合,此外我还有另一部 iPhone 并使用该设备的 ID 生成了一个新的配置文件。但是,我也收到了与该个人资料/电话相同的消息。

From other postings on this site seems people got this problem when the profile had not been dragged/dropped in the Library section of Organizer - I dragged the profiles on Xcode and there is a resulting Provisioning Profiles section containing the relevant profile in both the Library section and Devices section of Organizer.

从这个网站上的其他帖子看来,当配置文件没有被拖放到管理器的库部分时,人们会遇到这个问题 - 我在 Xcode 上拖动了配置文件,并且在两个库部分都有一个包含相关配置文件的配置配置文件部分和管理器的设备部分。

The certificate is showing as being valid in Keychain Access.

该证书在 Keychain Access 中显示为有效。

Any suggestions?

有什么建议?

Added Later: trying this Q&A from Apple:

稍后添加:尝试 Apple 的此问答:

https://web.archive.org/web/20141029102125/http://developer.apple.com/library/ios/qa/qa1618/_index.html

https://web.archive.org/web/20141029102125/http://developer.apple.com/library/ios/qa/qa1618/_index.html

They say within Keychain Access click on the .p12 file. What are they talking about, what and where is the .p12 file? Its not shown in their own documentation screen shots and nor does it appear in my Keychain Access. Is it supposed to?

他们说在 Keychain Access 中点击 .p12 文件。他们在说什么,.p12 文件是什么以及在哪里?它没有显示在他们自己的文档屏幕截图中,也没有出现在我的 Keychain Access 中。应该这样吗?

回答by Oscar Salguero

The best thing you can do is delete the certificates from your Keychain and get them back so XCode 4's Organizer stops being "confused". I've compiled it in 7 "easy" steps:

您能做的最好的事情是从您的钥匙串中删除证书并将其取回,这样 XCode 4 的管理器就不会被“混淆”。我用 7 个“简单”的步骤编译它:

  1. Delete your Certificates: Open the Application called Keychain Accesson your Mac (You can hit the keys command + space bar on your keyboard to bring Spotlightand type Keychain Accessto launch it). Then select loginon the upper left list and Certificateson the lower left list, you will delete only the Certificates starting with the words "iPhone Developer" or "iPhone Distribution".

  2. You need to revoke the old certificates by logging into your Apple iOS Developer's account and going to the Provisioning Portaland then to the Certificatesoption on the left menu. Then locate your Developer Certificate and click on the link located at the right that reads "Revoke".

  3. Go back to the Keychain AccessApplication on you Mac, click on the menu bar the following menus: "Keychain Access" -> "Certificate Assistant" -> "Request a Certificate from a Certificate Authority". Just enter you email if needed and modify the option that says "Request is:" selecting the option "save to disk"... a dialog will ask you where do you want to save a CSR file which is normally called "CertificateSigningRequest.certSigningRequest".

  4. Go back to the online Provision Portaland create a new Certificate uploading the file you just generated on the same option where your old Certificates were before.

  5. After a minute or so... you will see under the Certificateslist that you can now Download you new certificate and that you can also download a WWDR intermediate certificate (See the links under the certificate list). Download them and give them to your Keychain Accessby double-clicking them.

  6. You will have to go to the Provisioning Portalmenu option called Provisioningwhere you will see all your App's Development Provisioning Profiles. You will have to click the link "Edit"->"Modify" at the right and verify that the Certificate is checked.

  7. Finally, just close "XCode 4". When you re-open it, go to the menu "Window" -> "Organizer". Because the Organizer reads the certificates from you keychain, they should be there already. Next time you plug your devices just click on Provisioning and make sure the old certificates are gone and the new certificate is on.

  1. 删除您的证书:在 Mac 上打开名为Keychain Access的应用程序(您可以按下键盘上的按键命令 + 空格键以打开Spotlight并键入Keychain Access以启动它)。然后选择左上列表中的登录和左下列表中的证书,您将只删除以“iPhone Developer”或“iPhone Distribution”字样开头的证书。

  2. 您需要通过登录 Apple iOS Developer 的帐户并转到Provisioning Portal,然后转到左侧菜单中的Certificates选项来撤销旧证书。然后找到您的开发人员证书并单击位于右侧的“撤销”链接。

  3. 返回Mac 上的钥匙串访问应用程序,单击菜单栏以下菜单:“钥匙串访问”->“证书助手”->“从证书颁发机构请求证书”。如果需要,只需输入您的电子邮件并修改“请求是:”选项,选择“保存到磁盘”选项...一个对话框会询问您要将 CSR 文件保存在哪里,该文件通常称为“ CertificateSigningRequest.certSigningRequest”。

  4. 返回在线Provision Portal并创建一个新证书,上传您刚刚在旧证书所在的相同选项上生成的文件。

  5. 大约一分钟后...您将在证书列表下看到您现在可以下载新证书,并且您还可以下载 WWDR 中间证书(请参阅证书列表下的链接)。下载它们并通过双击它们将它们提供给您的钥匙串访问

  6. 您必须转到名为ProvisioningProvisioning Portal菜单选项,您将在其中看到所有应用程序的开发配置文件。您必须单击右侧的链接“编辑”->“修改”并验证证书是否已选中。

  7. 最后,关闭“XCode 4”。当您重新打开它时,转到菜单“窗口”->“管理器”。因为组织者会从您的钥匙串中读取证书,所以它们应该已经存在了。下次插入设备时,只需单击 Provisioning 并确保旧证书已消失而新证书已启用。

回答by Danny Robinson

For some reason, I found that Apple's root certs were not in my keychain. I can't explain why. but after about 3 hours of looking, I finally figured that out. I red-ownloaded them from here:

出于某种原因,我发现 Apple 的根证书不在我的钥匙串中。我无法解释为什么。但经过大约 3 个小时的查找,我终于想通了。我从这里重新下载了它们:

http://www.apple.com/certificateauthority/

http://www.apple.com/certificateauthority/

回答by Smoke Liberator

I ran into this same problem (switched to a different system) and at least as of Xcode 4.5.2 (possibly earlier), you can export your Developer Profile. To do so, open the Organizer, click on the Devices section, then go to the Editor submenu in the menu bar. There will be a Developer Profile entry that has Import & Export actions. Export the profile from the previous system and then import it on the new system. You can password protect it, so you could also just put it into your SVN/git/whathaveyou so it's available across systems.

我遇到了同样的问题(切换到不同的系统),至少从 Xcode 4.5.2(可能更早)开始,您可以导出您的开发人员配置文件。为此,请打开管理器,单击“设备”部分,然后转到菜单栏中的“编辑器”子菜单。将有一个具有导入和导出操作的开发人员配置文件条目。从以前的系统导出配置文件,然后将其导入新系统。你可以用密码保护它,所以你也可以把它放到你的 SVN/git/whathaveyou 中,这样它就可以跨系统使用了。

回答by Zepplock

You need to drop "certificate" to your keychain. It has nothing to do with development profile. Like this: Xcode could not find a valid private certificate/valid key-pair for this profile in your keychain

您需要将“证书”放到您的钥匙串中。它与开发配置文件无关。像这样:Xcode 在您的钥匙串中找不到此配置文件的有效私有证书/有效密钥对

回答by Gruntcakes

I deleted everything from the keychain and revoked the certificate and deleted everything associated with it, generated everything from afresh and now it works.

我从钥匙串中删除了所有内容并撤销了证书并删除了与之相关的所有内容,重新生成了所有内容,现在它可以工作了。

回答by hotpaw2

You don't have the exact same current Developer certificate andprivate key on all your Macs. Either export the working combo from your Keychain as a .p12, or start over by revoking your Developer certificate and create a new one and all new provision profiles.

您在所有 Mac 上都没有完全相同的当前开发人员证书私钥。将工作组合从您的钥匙串导出为 .p12,或者通过撤销您的开发人员证书重新开始并创建一个新的和所有新的配置文件。