PEM file is used to setup Apple Push Notification. In this tutorial, you will be guided to generate a PEM file. Please follow our user guide step by step.
Step 1: Go to website https://developer.apple.com and login your Apple Developer Account.
Step 2: Select Certificates, Identifiers, Profiles
Step 3: Select tab Production, then Click on (+)Add button on Top-Right to add a new Certificate
Step 4: On Select Type page, select Apple Push Notification service SSL (Sanbox & Production). Then click Continue
Step 5: On this page, select the App ID you want to PUSH notification. Then click Continue
Step 6: Go to Generate your certificate
Step 7: Prepare on your MaC (or computer runs with MacOS)
- Open Spotlight search and search “keychain”.
- Follow Keychain Access/ Certificate Assistant/ Request a Certificate from a Certificate Authority
You are directed to “Certificate Information”. Please fill out all required information:
- Your Apple account email as “User Email Address”
- app_pushnotification as “Common Name”
Tick on “Saved to disk”. Next, save this file as “app_pushnotification” and then you will get . certSigningRequest file on your Desktop
Step 9: Please come back to your account on developer.apple.com, you need to click “Choose file” to upload the app_pushnotification.certSigningRequest file you have just created. Then, click “Continue”.
Step 10: After that, double click on the file you have just downloaded, change file’s name as app_pushnotification.cer, move this file to your Desktop and open “Keychain Access”. Now find “app_pushnotification” and “Apple Push Services:<your App ID>” and export these 2 items. Then, save this file as “app_pushnotification” and move to your Desktop. Please note that the file format is (.p12).
Step 11: Create PEM file
Open a Terminal and execute the following steps.
Go to the folder where you downloaded the files, in this case is the Desktop:
- cd ~/Desktop/
- openssl pkcs12 -in app_pushnotification.p12 -out app_pushnotification.pem -nodes –clcerts <Note: You need to enter the password you entered on Step 10>
- openssl x509 -in app_pushnotification.cer -inform der -out app_pushnotificationpass.pem
- cat app_pushnotificationpass.pem app_pushnotification.pem > app_pushnotification_end.pem
The file app_pushnotification_end.pem is the one you need.