【问题标题】:Convert .p12 file to .pem using Terminal app in Mac "No such file or directory" error?使用Mac中的终端应用程序将.p12文件转换为.pem“没有这样的文件或目录”错误?
【发布时间】:2012-05-02 11:13:51
【问题描述】:

我已从 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

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

    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

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

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

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

编辑:

我已在我的 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

【问题讨论】:

  • 你在学习 rayWenderLich 教程吗?
  • 是的,我正在学习教程。我已经尝试了他们创建 .pem 文件的步骤,但它对我不起作用。
  • 你改到正确的目录了吗?输入“pwd”以查看您的位置。
  • 您在 cd 和 /Users 之间缺少一个空格
  • 您好,Maffo 先生,感谢您的回复。我已经编辑了我在终端中尝试过你的话的问题。你能帮我么?谢谢。

标签: iphone ios terminal pem pkcs#12


【解决方案1】:

输入:

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

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

然后继续其他命令

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

【讨论】:

  • 这两个命令完全相同。不过他们工作得很好。这些是正确的命令。
  • 就其价值而言,这两个命令并不完全相同。第二个不会随它一起导出私钥,至少对于我正在使用的 django-push-notifications 来说这是必需的
猜你喜欢
  • 1970-01-01
  • 2012-05-11
  • 2018-06-03
  • 1970-01-01
  • 1970-01-01
  • 2013-04-13
  • 1970-01-01
  • 2021-10-31
  • 1970-01-01
相关资源
最近更新 更多