ios 使用 Mac 中的终端应用程序将 .p12 文件转换为 .pem“没有这样的文件或目录”错误?

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

Convert .p12 file to .pem using Terminal app in Mac "No such file or directory" error?

iphoneiosterminalpempkcs#12

提问by Yuvaraj.M

I have export the "Apple Development IOS Push Service" certificate from Keychain Access and save the "apns-dev-cert.p12" in my desktop. I want to enable Apple Push NotificationI have followed these blogs to convert apns-dev-cert.p12 to apns-dev-cert.pemfrom Terminal app,

我已从 Keychain Access 导出“Apple Development IOS Push Service”证书并将“apns-dev-cert.p12”保存在我的桌面中。我想启用Apple Push Notification我已关注这些博客以apns-dev-cert.p12 to apns-dev-cert.pem从终端应用程序转换,

http://bhaveshkumbhani.blogspot.in/2011/12/convert-p12-to-pem-for-apns.html
http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
Apple Document RemoteNotificationPG.pdf

I have used these commands in Terminal,

我在终端中使用过这些命令,

    1.V******-Ms-iMac-2:~ c*****$ openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts
        Response : Error opening input file apns-dev-cert.p12
        Certificates.p12: No such file or directory
    2.V******-Ms-iMac-2:~ c*****$ openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
        Response : Error opening input file apns-dev-cert.p12
        Certificates.p12: No such file or directory
    3.V******-Ms-iMac-2:~ c*****$ ls
            All_iOS_Applications_Document.doc   Pictures
            AppStoreSubmissionSteps.doc     Public
            Desktop                 Sites
            Documents               Softwares
            Downloads               Untitled.txt
            Dropbox                 pic
            Library                 pic.zip
            Movies                  pricelist.txt
            Music                   sms.txt
            Nana_User_Case_Documents.odt
   4. V******-Ms-iMac-2:~ c*****$ cd
   5.V******-Ms-iMac-2:~ c*****$ cd/Users/c*****/Desktop/A
-bash: cd/Users/c*****/Desktop/A: No such file or directory

I can't understand why the terminal always saying "No such file or directory"?. Where i need to save the .p12 file in my Mac?

我不明白为什么终端总是说“没有这样的文件或目录”?。我需要将 .p12 文件保存在我的 Mac 中的什么位置?

Am using Terminal app Version 2.1.2 (273.1). Mac OS X version 10.6.8.

正在使用Terminal app Version 2.1.2 (273.1). Mac OS X version 10.6.8.

Can you please what i need to do? I need to enable the APNS by using the .pem file. Please help me. Thanks in advance.

你能请我做什么吗?我需要使用 .pem 文件启用 APNS。请帮我。提前致谢。

EDIT:

编辑:

I have added tried Raywenderlich.com termial code in my mac Terminal app

我在我的 mac 终端应用程序中添加了尝试过的 Raywenderlich.com 终端代码

1. V******-Ms-iMac-2:~ c*****$ pwd
/Users/creagx
2. V******-Ms-iMac-2:~ c*****$ cd/ Users/creagx/Desktop/A
-bash: cd/: No such file or directory

回答by Maffo

Type in:

输入:

cd /Users/creagx/Desktop/A (Space between cd and Slash: cd[SPACE]/Users/creagx/Desktop/A

if there is a Folder named "A" on your Desktop where the p12 files are in.

如果您的桌面上有一个名为“A”的文件夹,其中 p12 文件所在。

Then go on with the other Commands

然后继续执行其他命令

openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts

openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts

openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12

openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12