ios 如何使用终端将 .p12 文件转换为 .pem 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10408920/
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
How to convert .p12 file to .pem file using Terminal?
提问by Gopinath
I already have an development certificate in apple developer portal
. Am developing an iPhone app,i want to integrate Apple Push Notification in this app. I have created a new App ID
with used the existing certificate and enabled the Push Notification in this app id
. And i have created a new Provisioning Profile
used the newly created app id. Before these steps i have created and downloaded the .cer file from keychain access
. After done these steps i downloaded the newly created SSL (Apple Push Notification Service SSL certificate) file and installed
in my Mac Keychain Access. Once i installed this file, verified (Green tick mark is there) and got the .p12 file from this ssl file
.
我已经有一个development certificate in apple developer portal
. 我正在开发一个 iPhone 应用程序,我想在这个应用程序中集成 Apple 推送通知。我创建了一个new App ID
使用现有证书和enabled the Push Notification in this app id
. 我已经创建了一个new Provisioning Profile
使用过的新创建的应用程序 ID。在执行这些步骤之前,我已经创建并下载了.cer file from keychain access
. 完成这些步骤后,我created SSL (Apple Push Notification Service SSL certificate) file and installed
在 Mac Keychain Access 中下载了新的。一旦我安装了这个文件,验证(绿色勾号在那里)和got the .p12 file from this ssl file
.
I followed the apple document RemoteNotificationsPG.pdf
, in this document they mentioned after saved the .p12 file open the Terminal app and type below commends,
我遵循了苹果文档RemoteNotificationsPG.pdf
,在保存 .p12 文件后他们提到的这个文档中,打开终端应用程序并输入以下命令,
openssl pkcs12 -in Certificates.p12 -out Certificates.pem -nodes
I have used this in my Terminal app, but the error message is appear that is,
我在我的终端应用程序中使用过它,但出现的错误消息是,
Error opening input file Certificates.p12
Certificates.p12: No such file or directory
Can you please suggest or guide me where i did wrong or what i missed in these steps? Please help me. Thanks in advance.
您能否建议或指导我在这些步骤中我做错了什么或遗漏了什么?请帮我。提前致谢。
EDIT:
编辑:
I stored my Certificates.p12 file in my desktop. Folder path is Desktop->1/5/2012_Certificate->2/5/12->Certificates.p12
我将 Certificates.p12 文件存储在桌面上。文件夹路径是Desktop->1/5/2012_Certificate->2/5/12->Certificates.p12
I have used 'ls' command
in Terminal it is not listing my Certificates.p12 file.
我'ls' command
在终端中使用过它没有列出我的 Certificates.p12 文件。
I have typed cd *path*
this returned No such file or directory
.
我已经输入cd *path*
这个返回No such file or directory
。
Please help me. Thanks in advance.
请帮我。提前致谢。
采纳答案by ulu5
Are you in the right directory? Use ls command, does it list Certificates.p12?
你在正确的目录中吗?使用 ls 命令,它是否列出 Certificates.p12?
EDIT: In the terminal type:
编辑:在终端类型中:
ls
this will list all the files of the current directory that you are in. If Certificates.p12 is not listed, you are not in the correct directory in the terminal.
这将列出您所在的当前目录的所有文件。如果 Certificates.p12 未列出,则您不在终端中的正确目录中。
To get to the correct directory type:
为了得到正确的目录类型:
cd *path*
where path is the folder containing Certificates.p12. You can drag and drop that folder into the terminal after typing cd. Hit return. Then run the openssl command.
其中 path 是包含 Certificates.p12 的文件夹。您可以在输入 cd 后将该文件夹拖放到终端中。按回车。然后运行 openssl 命令。