Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 Notification I have followed these blogs to convert apns-dev-cert.p12 to apns-dev-cert.pem from Terminal app,

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?

Am using 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.

EDIT:

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

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
like image 860
Yuvaraj.M Avatar asked May 02 '12 11:05

Yuvaraj.M


People also ask

What is PEM file vs p12?

PKCS12 - A Microsoft private standard that was later defined in an RFC that provides enhanced security versus the plain-text PEM format. This can contain private key and certificate chain material. Its used preferentially by Windows systems, and can be freely converted to PEM format through use of openssl.

How do I get my p12 from CER?

From the Keychain Access menu in the header, go to File then select Export Items. For File Format, select Personal Information Exchange (. p12). Enter a name for the file in the Save As: field, and click Save.


1 Answers

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.

Then go on with the other Commands

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

like image 143
Maffo Avatar answered Oct 13 '22 00:10

Maffo