ios 钥匙串上的分发证书中缺少私钥
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12867878/
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
missing private key in the distribution certificate on keychain
提问by moshikafya
I have the following problem which I could not find a solution for anywhere. Basically, we have a company developer account (not enterprise) and so in order to submit our app, I requested from our team lead to send me the distribution certificate and create and send me a distribution provisioning profile.
我有以下问题,我无法在任何地方找到解决方案。基本上,我们有一个公司开发者帐户(不是企业),因此为了提交我们的应用程序,我要求我们的团队负责人向我发送分发证书,并创建并向我发送分发配置文件。
With the developer profile, everything works good, but when I installed the cert and the provisioning profile, I did not see the distribution profile on Xcode, and nor do I have a private key under the dist cert in the keychain.
使用开发人员配置文件,一切正常,但是当我安装证书和配置文件时,我没有在 Xcode 上看到分发配置文件,并且钥匙串中的 dist 证书下也没有私钥。
Does anyone know how to solve this? I read in diff places that I will need to revoke the certificate and create a new one, but I can't really do that since we have a bunch of apps in the company and I can't revoke it for everyone.
有谁知道如何解决这个问题?我在不同的地方读到我需要撤销证书并创建一个新证书,但我真的不能这样做,因为我们公司有一堆应用程序,我不能为每个人撤销它。
Thanks for the help!!!
谢谢您的帮助!!!
采纳答案by Nirma
Ahh this is a common issue, The solution is simple:
啊,这是一个常见问题,解决方法很简单:
Who ever created the developer credentials originally needs to go to the keychain on their computer and right click on the key(s) for private and public and export the key to a file. Then you just download that file on your computer and open it, and it will be added to your keychain.
创建开发人员凭据的人最初需要转到他们计算机上的钥匙串,然后右键单击私有和公共密钥,然后将密钥导出到文件。然后您只需将该文件下载到您的计算机上并打开它,它就会被添加到您的钥匙串中。
You need to have both the private key (.pem file) and the certificate for your provisioning profiles.
您需要同时拥有配置文件的私钥(.pem 文件)和证书。
回答by eladleb
As long as you still have access to the mac which was used to generate the original distribution certificate it's very simple.
只要您仍然可以访问用于生成原始分发证书的 mac,它就非常简单。
Just use that mac's Keychain Access application to export both the certificate and the private key. Select both using shift or command and right click to export to a .p12 file.
只需使用该 Mac 的 Keychain Access 应用程序即可导出证书和私钥。使用 shift 或 command 选择两者并右键单击以导出到 .p12 文件。
Attached a screenshot to make it very clear.
附上截图,让大家看得一清二楚。
On your mac, import that .p12 file and you are good to go (just make sure you have a valid provisioning profile).
在您的 Mac 上,导入该 .p12 文件,一切顺利(只需确保您拥有有效的配置文件)。
回答by mkral
To add on to others' answers, if you don't have access to that private key anymore it's fairly simple to get back up and running:
要补充其他人的答案,如果您不再有权访问该私钥,则恢复并运行非常简单:
- revoke your active certificate in the provisioning portal
- create new developer certificate (keychain access/.../request for csr...etc.)
- download and install a new certificate
- create a new provisioning profile for existing app id (on provisioning portal)
- download and install new provisioning profile and in the build, settings set the appropriate code signing identities
- 在配置门户中撤销您的活动证书
- 创建新的开发人员证书(钥匙串访问/.../CSR 请求...等)
- 下载并安装新证书
- 为现有的应用程序 ID 创建一个新的配置文件(在配置门户上)
- 下载并安装新的配置文件,并在构建中设置适当的代码签名身份
回答by Jamshed Alam
Delete the existing one from KeyChain, get and add the .p12 file to your mac from where the certificate was created.
从 KeyChain 中删除现有的,从创建证书的位置获取 .p12 文件并将其添加到您的 mac。
To get .p12 from source Mac, go to KeyChain, expand the certificate, select both and export 2 items. This will save .p12 file in your location:
要从源 Mac 获取 .p12,请转到 KeyChain,展开证书,选择两者并导出 2 个项目。这将在您的位置保存 .p12 文件:
回答by JakubKnejzlik
In my case, I've lost all private keys in my keychain, new ones were imported correctly, but doesn't show the private key as well. The only thing that helped was generating new CertificateSigningRequest
就我而言,我丢失了钥匙串中的所有私钥,正确导入了新的私钥,但也没有显示私钥。唯一有帮助的是生成新的 CertificateSigningRequest
回答by Michael Yang
After you changed a Mac which are not the origin one who created the disitribution certificate, you will missing the private key.Just delete the origin certificate and recreate a new one, that works for me~
换一台不是创建分发证书的原始Mac后,你会丢失私钥。只需删除原始证书并重新创建一个新的,对我有用~
回答by Vivek
When I try to upload iOS build to test flight then error was appear.
当我尝试将 iOS 版本上传到试飞时出现错误。
"Missing privacy key"
.
"Missing privacy key"
.
Just 2 step for fix this error.
只需 2 步即可修复此错误。
- Remove old certificate from developer.apple.com
- Create new certificate from Xcode or developer.apple.com
- 从 developer.apple.com 删除旧证书
- 从 Xcode 或 developer.apple.com 创建新证书
My problem has been solved (I am using Xcode 9.4.1).
我的问题已解决(我使用的是 Xcode 9.4.1)。
Please check, Xcode created new certificate.
请检查,Xcode 创建了新证书。
回答by Ramis
For person who are afraid on re-creating AppStore distribution certificate Apple documentationsays:
对于害怕重新创建 AppStore 分发证书的人,Apple文档说:
Important: Re-creating your development or distribution certificates doesn't affect apps that you've submitted to the App Store nor does it affect your ability to update them.
重要提示:重新创建您的开发或分发证书不会影响您提交到 App Store 的应用程序,也不会影响您更新它们的能力。
But it affects apps Apple Developer Enterpriseecosystem system.
但它会影响应用程序Apple Developer Enterprise生态系统系统。
回答by ?těpán Havránek
I got into this situation ("Missing private key.") after Xcode failed to create new distribution certificate - an unknown error occurred.
在 Xcode 无法创建新的分发证书后,我陷入了这种情况(“缺少私钥。”) - 发生了未知错误。
Then, I struggled to obtain the private key or to generate new certificate. From the certificate manager in Xcode I got strange errors like "The passphrase you entered is wrong". But it did not even ask me for any passphrase.
然后,我努力获取私钥或生成新证书。从 Xcode 中的证书管理器中,我收到了一些奇怪的错误,例如“您输入的密码错误”。但它甚至没有问我任何密码。
What helped me was:
对我有帮助的是:
- Revoke all not-working distribution certificates at developer.apple.com
- Restartmy Mac
- 在 developer.apple.com 撤销所有无效的分发证书
- 重新启动我的 Mac
After that, Xcode was able to create new distribution certificate and no private key was missing.
之后,Xcode 能够创建新的分发证书,并且没有丢失私钥。
Lesson learned: Restart your Mac as much as you Windows ;)
经验教训:像重新启动 Windows 一样重新启动 Mac ;)
回答by mjb
At the Menu > Visual Studio (mac) > Preferences > Publishing > Apple Developer Accounts > [Select your apple id] > View Details > Create Certificate
在菜单 > Visual Studio (mac) > Preferences > Publishing > Apple Developer Accounts > [Select your apple id] > View Details > Create Certificate
To delete unused/invalid certificates, go to website: https://developer.apple.com/account/resources/certificates/list
要删除未使用/无效的证书,请访问网站:https: //developer.apple.com/account/resources/certificates/list
delete any unwanted certificate there
在那里删除任何不需要的证书
Next is to create App ID (identifiers), go to website:
https://developer.apple.com/account/resources/identifiers/list
接下来是创建App ID(标识符),访问网站:https:
//developer.apple.com/account/resources/identifiers/list
Next, go to website to create provisioning profiles:
https://developer.apple.com/account/resources/profiles/add
接下来,转到网站以创建配置文件:https:
//developer.apple.com/account/resources/profiles/add
use the certificate to bind with your app id.
使用证书与您的应用程序 ID 绑定。
Next is to download the profiles:
At your mac > At the Menu > Visual Studio (mac) > Preferences > Publishing > Apple Developer Accounts > [Select your apple id] > View Details > Download All Profiles
接下来是下载配置文件:
在您的 mac > 在菜单 > Visual Studio (mac) > 首选项 > 发布 > Apple 开发者帐户 > [选择您的 Apple id] > 查看详细信息 > 下载所有配置文件