Generate a .pem file (2024)

Table of Contents
πŸ“˜ 🚧 πŸ“˜

A remote server can't directly push a notification to a user's device. If you want to send notifications to the user of your app from a remote server, Apple wants you to create a notification payload and send it to the Apple Push Notification service (APNs), and then APNs sends the notification to the targeted device.

Now, to send the notification payload to APNs, you have to generate a .pem file for your app. A .pem file contains the certificate and private key that the server must use to securely send the notification payload to the Apple Push Notification service (APNs). APNs uses the certificate in the .pem file to validate if the push notification request comes from a server that is authorized to do so. If APNs validates that the server is using the right certificate, it takes the notification payload from the server and pushes the notification to the user.

So, if you want to let us send notifications to your users, we need you to generate the .pem file and upload it to our platform. We can use this file to securely create and send notifications to a user of your app. The following steps describe how-to generate a .pem file and upload it to our platform.

A trusted authority must issue a signed certificate that we will use to securely send the notification payload from our platform to APNs. To get a signed certificate, you have to create a request for it on your Mac. After you create a request, you have to upload it to the Apple Developer Portal. We'll get to that once you perform the following steps to create the request on your Mac:

  1. On your Mac, launch Keychain Access.
  2. On the Apple menu, click Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority....
  3. In the Certificate Information dialog, provide the email address and the name that you use to build your apps, select Saved to disk in the Request is: field, and click Continue.
  4. Provide a name for the certificate and save it to a folder on your Mac. A . certSigningRequest file with the name you specify is saved to your Mac.

Now that you have created a request to sign a certificate, you have to create a certificate and attach the signing request to it. This is the place where you upload the request file that you created in the last procedure. Perform the following steps to create the certificate:

  1. Launch and sign-in to the Apple Developer Portal on a browser.
  2. Navigate to the Certificates, Identifiers, & Profiles page. Ensure that iOS, tvOS, WatchOS is selected in the upper-left corner.
  3. In the left pane, click All under Certificates.
  4. Click the + button on the upper-right corner of the page, near the search button, to add a new certificate. This launches a wizard to create the certificate.
  5. In the Select Type section, either choose Apple Push Notification service SSL (Sandbox) under Development or choose Apple Push Notification service SSL (Sandbox & Production) under Production based on your requirement and click Continue.
  6. In the next section, select the app ID of the application that you have integrated with Blueshift and click Continue.
  7. Click Continue in the About Creating a Certificate Signing Request section. We have already described how to do this in the previous procedure. If you haven't done that, we recommend that you do it and then come back to this step.
  8. In the Generate your certificate section, upload the certificate signing request (.certSigningRequest ) file that you created in the last procedure and then click Continue.
  9. In the Your certificate is ready section, click Download to save the certificate file to your Mac. The file that is saved is a .cer file.
  10. Double-click the .cer file to add it to Keychain Access.

πŸ“˜

Important

The .cer created from the Apple developer portal must be installed on the same system where you created the Certificate Signing Request(CSR). Once you install the .cer it will pair with the private key you created using the CSR, and shows up in the KeyChain Access.

  1. Open Keychain Access on your Mac and click My certificates in the left-pane.
  2. On the right-pane, select the Apple push services certificate, you can identify it using the bundle id you used to create it. Do secondary-click (or right-click on it) and then select the Export... option.
    Make sure you see the certificate and private key both as shown in the below image.

Generate a .pem file (1)

  1. When you select the Export... option, you get a dialog that prompts you to provide the file name and extension. Provide a filename, location, and the file format and click Save. Ensure that Personal Information Exchange (.p12) is selected in the File Format field.

Generate a .pem file (2)

🚧

Important

If the private key is missing then the p12 option will be disabled and you won't be able to export the p12 file.

  1. You get an option to protect this file with a password.
  • Click OK without filling-in the Password and Verify fields if you want to save the .p12 without a password.
  • Otherwise, you can provide a password and then click OK to create it with a password. In this case, note down or remember this password since you'll have to provide it later.

You just created the .p12 file. Now, we'll show you how you can generate a .pem file and upload it to our platform.

Now that you have generated the signed certificate, you have to convert it to a .pem file. Perform the following steps to convert the .p12 file to a .pem file:

  1. Launch the terminal on your Mac.
  2. Change directory to the folder where you have saved the .p12 file.
  3. Run the openssl pkcs12 command to generate a .pem file using the .p12 file.

For Mac OS Sonoma 14 and above -

openssl pkcs12 -in BlueShiftPush.p12 -out BlueShiftPush.pem -nodes -clcerts -legacy

For Mac OS Ventura 13 and below -

openssl pkcs12 -in BlueShiftPush.p12 -out BlueShiftPush.pem -nodes -clcerts

If you created the .p12 file with a password, provide it when the terminal prompts: Enter Import Password. If you did not create the .p12 file with a password, press the return key without entering anything.

πŸ“˜

Info

Here, BlueShiftPush.p12 is an example of the .p12 file you export from Keychain Access and BlueShiftPush.pem is an example of the .pem file that this command generates. Ensure that you replace the example filenames with the actual filenames that you want to use in this command.

Now, since you have generated the .pem file that we need to send notifications to your app's users, you have to upload it to our platform so that we can send notifications to your customers. For steps on how to upload the .pem file to our platform, see this section.

Updated 10 months ago

Generate a .pem file (2024)
Top Articles
How to Disable Network Level Authentication - Prajwal.org
Pikamoon
Katie Pavlich Bikini Photos
Pet For Sale Craigslist
Garrison Blacksmith Bench
Inducement Small Bribe
Autobell Car Wash Hickory Reviews
More Apt To Complain Crossword
ExploreLearning on LinkedIn: This month's featured product is our ExploreLearning Gizmos Pen Pack, the…
Sams Early Hours
Busted Barren County Ky
Tamilrockers Movies 2023 Download
Simplify: r^4+r^3-7r^2-r+6=0 Tiger Algebra Solver
Epro Warrant Search
Tygodnik Polityka - Polityka.pl
White Pages Corpus Christi
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Xfinity Outage Map Fredericksburg Va
Kingdom Tattoo Ithaca Mi
Scripchat Gratis
15 Primewire Alternatives for Viewing Free Streams (2024)
Gs Dental Associates
Acurafinancialservices Com Home Page
Β§ 855 BGB - Besitzdiener - Gesetze
Dashboard Unt
Evil Dead Rise Showtimes Near Sierra Vista Cinemas 16
Effingham Daily News Police Report
Tamil Movies - Ogomovies
Where to eat: the 50 best restaurants in Freiburg im Breisgau
Things to do in Pearl City: Honolulu, HI Travel Guide by 10Best
Albertville Memorial Funeral Home Obituaries
Vlacs Maestro Login
Craigslist/Phx
Craigslist Cars And Trucks Mcallen
Manuel Pihakis Obituary
Teenbeautyfitness
Jay Gould co*ck
Morlan Chevrolet Sikeston
Hermann Memorial Urgent Care Near Me
Ukg Dimensions Urmc
Ludvigsen Mortuary Fremont Nebraska
Deshuesadero El Pulpo
Cranston Sewer Tax
Gfs Ordering Online
Shipping Container Storage Containers 40'HCs - general for sale - by dealer - craigslist
Craigslist/Nashville
Candise Yang Acupuncture
Go Nutrients Intestinal Edge Reviews
Lagrone Funeral Chapel & Crematory Obituaries
Factorio Green Circuit Setup
What Responsibilities Are Listed In Duties 2 3 And 4
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 5616

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.