![](/img/trans.png)
[英]Convert .p12 file to .pem using Terminal app in Mac “No such file or directory” error?
[英]How to convert .p12 file to .pem file using Terminal?
我已经development certificate in apple developer portal
获得了development certificate in apple developer portal
。 我正在开发一个 iPhone 应用程序,我想在这个应用程序中集成 Apple 推送通知。 我使用现有证书创建了一个new App ID
,并enabled the Push Notification in this app id
。 我使用新创建的应用程序 ID 创建了一个new Provisioning Profile
。 在执行这些步骤之前,我已经.cer file from keychain access
创建并下载了.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
。
我遵循了苹果文档RemoteNotificationsPG.pdf
,在他们保存 .p12 文件后提到的这个文档中,打开终端应用程序并输入以下命令,
openssl pkcs12 -in Certificates.p12 -out Certificates.pem -nodes
我在我的终端应用程序中使用过它,但出现的错误消息是,
Error opening input file Certificates.p12
Certificates.p12: No such file or directory
您能否建议或指导我在这些步骤中我做错了什么或遗漏了什么? 请帮我。 提前致谢。
编辑:
我将 Certificates.p12 文件存储在桌面上。 文件夹路径是Desktop->1/5/2012_Certificate->2/5/12->Certificates.p12
我在终端中使用了'ls' command
,它没有列出我的 Certificates.p12 文件。
我输入了cd *path*
这返回No such file or directory
。
请帮我。 提前致谢。
你在正确的目录中吗? 使用 ls 命令,它是否列出 Certificates.p12?
编辑:在终端类型中:
ls
这将列出您所在的当前目录的所有文件。如果 Certificates.p12 未列出,则您不在终端中的正确目录中。
要获得正确的目录类型:
cd *path*
其中 path 是包含 Certificates.p12 的文件夹。 您可以在输入 cd 后将该文件夹拖放到终端中。 按回车。 然后运行 openssl 命令。
打开终端,点击ls
列出当前目录下的项目,
那么如果您不在 .p12 移动到正确目录的文件夹中
cd directory path
例如,
cd Downloads
然后列出使用的文件并确保 .p12 文件存在于目录中。
然后使用以下命令将 .p12 文件转换为 .pem 文件。
openssl pkcs12 -in filename.p12 -out filename.pem -nodes
您创建的 .pem 文件将保存在包含 .p12 文件的目录中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.