ios 钥匙串中缺少私钥 iphone 开发人员

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18644786/
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-31 01:00:28  来源:igfitidea点击:

Missing private key iphone developer in keychain

iphoneiosxcode4provisioning-profilecode-signing-certificate

提问by iconso

I'm trying to run an application on my iPhone, but I'm having problems with the code signing identity. Actually I have two certificate in my keychains, one for the distribution, and one for developing that does not have the private key. I tried to download again the certificate from developer.apple.combut I still can't have the private key. In fact I can't select the iPhone developer profile from Target -> Build settings -> Code signing Identitybecause I get the error:

我正在尝试在我的 iPhone 上运行一个应用程序,但我遇到了代码签名身份问题。实际上,我的钥匙串中有两个证书,一个用于分发,另一个用于没有私钥的开发。我试图再次从developer.apple.com下载证书,但我仍然无法获得私钥。事实上,我无法从Target -> Build settings -> Code signature Identity 中选择 iPhone 开发人员配置文件,因为我收到错误消息:

Profile doesn't match any valid certificate/private key pair in your keychains.

配置文件与您的钥匙串中的任何有效证书/私钥对都不匹配。

Moreover in the organizer the status of the developer profile is:

此外,在组织者中,开发者资料的状态是:

Valid signing identity not found.

未找到有效的签名身份。

Do you have any suggestion?

你有什么建议吗?

回答by Hetal Vora

If you had an older machine where you had created a CSR and downloaded the certificate originally, then export the certificate from its keychain. Save it as a .p12 file and then copy it to your new machine on which you are working currently. Double click the .p12 file to install it to your keychain. Expand and see if you see the private key.

如果您有一台较旧的机器,您在其中创建了 CSR 并最初下载了证书,然后从其钥匙串中导出证书。将其另存为 .p12 文件,然后将其复制到您当前正在使用的新机器上。双击 .p12 文件以将其安装到您的钥匙串中。展开并查看您是否看到私钥。

If this is the original machine and you still do not have a private key in your keychain, you would have to request for a new certificate.

如果这是原始机器,而您的钥匙串中仍然没有私钥,则必须申请新证书。

回答by Ruchira Randana

If you don't have your private key in your keychain or stored anywhere else, then you cannot sign an app. There is no point in downloading the developer certificate from Apple. Your private key is NEVER sent to Apple at any point in the process. Only your public key is sent.

如果您的钥匙串中没有您的私钥或存储在其他任何地方,则您无法签署应用程序。从 Apple 下载开发者证书毫无意义。您的私钥在此过程中的任何时候都不会发送给 Apple。仅发送您的公钥。

The private key & public key PAIR is created when you create a Certificate Signing Request using keychain. This is exactly what you need to do if you have lost your private key.

当您使用钥匙串创建证书签名请求时,会创建私钥和公钥 PAIR。如果您丢失了私钥,这正是您需要做的。

回答by Jason FB

We identified in our case that we were exporting the WRONG certificate, because Keychain Access has a UX deficiency in that when you use the search box, you don't see certificates with a name matching what you searched for, you see certificates tied to PRIVATE KEYS with a name that matches what you searched for.

在我们的案例中,我们发现我们导出了错误的证书,因为 Keychain Access 存在 UX 缺陷,因为当您使用搜索框时,您看不到名称与搜索内容匹配的证书,您会看到与 PRIVATE 相关联的证书KEYS 的名称与您搜索的内容相匹配。

Because of this confusing UX of Keychain access, we were continually exporting the wrong certificate (but had convinced ourselves it was right because the name matched). Once we identified it as the right certificate, our import problem & signing identity missing private keys messages went away

由于 Keychain 访问的这种令人困惑的 UX,我们不断导出错误的证书(但我们确信这是正确的,因为名称匹配)。一旦我们将其确定为正确的证书,我们的导入问题和签名身份丢失私钥消息就消失了

see Can't import Code-signing Public or Private keys using Keychain access (Mac OS X Mavericks)for complete notes.

有关完整说明,请参阅无法使用钥匙串访问 (Mac OS X Mavericks) 导入代码签名公钥或私钥

回答by Kripa Jayakumar

This happened to me too recently. No proper reason as to why it did happen. I had tried revoking the certificate as well. But no help. So I created a new certificate.

这也发生在我身上最近。没有正当理由说明它为什么会发生。我也试过撤销证书。但没有帮助。所以我创建了一个新证书。

This might help http://seventhsoulmountain.blogspot.com/2013/09/ios-code-sign-in-complete-walkthrough.html

这可能会有所帮助 http://seventhsoulmountain.blogspot.com/2013/09/ios-code-sign-in-complete-walkthrough.html

回答by Natasha

Profile doesn't match any valid certificate/private key pair in your keychains.

This particular error can occur for couple of reasons, but the most commons are -

发生此特定错误的原因有多种,但最常见的是 -

  1. The certificate you have installed in your keychain is not the one with which you created your provisioning profile, Remember, you had to select a certificate when you created the profile?

  2. The certificate that you used to create the provisioning profile is either revoked or expired.

  1. 您安装在钥匙串中的证书不是您创建配置文件时使用的证书,请记住,您在创建配置文件时必须选择一个证书?

  2. 您用于创建配置文件的证书已被吊销或已过期。