How to convert .p12 file to .pem file using Terminal?


December 2018


43k time


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.

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,

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.


I stored my Certificates.p12 file in my desktop. Folder path is 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.

I have typed cd *path* this returned No such file or directory.

Please help me. Thanks in advance.

1 answers


Вы в правильном каталоге? Команда LS используется, это список Certificates.p12?

EDIT: В терминале типа:


это будет список всех файлов текущего каталога, вы находитесь. Если Certificates.p12 нет в списке, вы не в правильный каталог в терминале.

Для получения правильного типа каталога:

cd *path*

где путь папки, содержащей Certificates.p12. Вы можете перетащить и поместить эту папку в терминал после ввода кд. Хит возврата. Затем запустите команду OpenSSL.