ios 无法以 .p12 格式导出 Apple 生产推送 SSL 证书
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15662377/
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
Unable to export Apple production push SSL certificate in .p12 format
提问by Rashmi Ranjan mallick
I am using Urban airship in my application for push notification. So, I need to download the push SSL certificate from Apple developer portal. After downloading, I added that in keychain access. But no private key was created for the certificate. When I tried to right click and export the certificate, I was not able to export that as .p12file as the .p12file extension was disabled while saving. I am unable to attach the screenshots here due to lesser reputation.
我在我的应用程序中使用 Urban airship 进行推送通知。因此,我需要从 Apple 开发人员门户下载推送 SSL 证书。下载后,我在钥匙串访问中添加了它。但是没有为证书创建私钥。当我尝试右键单击并导出证书时,我无法将其导出为.p12文件,因为保存时禁用了.p12文件扩展名。由于声誉较低,我无法在此处附上屏幕截图。
Someone please tell me where is the issue here. How should I do that?
有人请告诉我这里的问题在哪里。我该怎么做?
回答by Matt Privman
Turns out all you have to do is select "My Certificates" on the left panel and it enables the .p12 option.
原来您所要做的就是在左侧面板上选择“我的证书”并启用 .p12 选项。
回答by frank
In my case, I made the .cer file into "system" option not the "login" option. then I move the .cer file from the "system" to "login" option then press "My Certificates" then export it .p12 is ok..
就我而言,我将 .cer 文件设置为“系统”选项而不是“登录”选项。然后我将 .cer 文件从“系统”移到“登录”选项,然后按“我的证书”,然后将其导出。p12 就可以了。
回答by lxt
Apple do not store the private key you used to create your certificates. You need to already have a copy of it on your machine.
Apple 不会存储您用于创建证书的私钥。您需要在您的机器上已经有它的副本。
It sounds as if perhaps either somebody else requested the push certificate you're trying to download, or you requested it on another machine. If you can't find the private key you will need to create a new certificate request and upload it via the developer portal.
听起来好像是其他人请求了您尝试下载的推送证书,或者您在另一台机器上请求了它。如果找不到私钥,则需要创建新的证书请求并通过开发人员门户上传。
回答by jcity
In order to export as p12 you either need to generate the cert from your machine or have the key that was used to generate it on your machine.
为了导出为 p12,您需要从您的机器生成证书或拥有用于在您的机器上生成它的密钥。
To ensure this will work:
为确保这将起作用:
Log in to Apple's Dev Center
Go to the Provisioning Portal or Certificates, Identifiers & Profiles
Go to Certificates and create a Apple Push Notification service SSL From here on you will be guided through the certificate generation process.
After you download the generated cert, install it in your keychain (double click the cert file or drag and drop into the keychain window.
Then select "Certificates" from the left panel. Right click the cert you want to export and the p12 option will be there.
登录 Apple 的开发中心
转到供应门户或证书、标识符和配置文件
转到证书并创建 Apple 推送通知服务 SSL 从这里开始,您将被引导完成证书生成过程。
下载生成的证书后,将其安装在您的钥匙串中(双击证书文件或拖放到钥匙串窗口中。
然后从左侧面板中选择“证书”。右键单击要导出的证书,p12 选项将在那里。
Note: it won't be there unless you generated the cert from your machine
注意:除非您从机器生成证书,否则它不会存在
回答by hvaughan3
For me, instead of right-clicking on the main certificate row within Keychain Access and selecting Export
, I had to click the drop-down arrow next to the certificate that I was trying to export and then right-click the entry below that and then select Export
. Then you are actually selecting the private key part instead of the public key part.
对我来说,不是右键单击 Keychain Access 中的主证书行并选择Export
,而是必须单击我尝试导出的证书旁边的下拉箭头,然后右键单击其下方的条目,然后选择Export
. 那么您实际上是在选择私钥部分而不是公钥部分。
回答by Gavin
In addition to verifying that the certificate was issued from certificate request from the Keychain Access -> Certificate Assistant on the same computer, ensure that the received .cer file is installed into the correct keychain.
除了验证证书是否是通过来自同一台计算机上的钥匙串访问 -> 证书助手的证书请求颁发的,确保收到的 .cer 文件安装到正确的钥匙串中。
The best way to do this is select the appropriate keychain under the left Keychains, most likely 'login', ensure 'My Certificates' is selected under Category, then drag and drop the .cer file into the main file list area.
最好的方法是在左侧钥匙串下选择适当的钥匙串,最有可能是“登录”,确保在类别下选择“我的证书”,然后将 .cer 文件拖放到主文件列表区域。
回答by user2387149
Make you are selecting a private key and not a public key because you probably have both types on the list.
让您选择私钥而不是公钥,因为您可能在列表中同时拥有这两种类型。