Key ID

Private keys allow you to access and authenticate communication with some app services β€” such as APNs, DeviceCheck, MusicKit, and WeatherKit.

Create Key ID

  1. In Certificates, Identifiers & Profiles, click Keys in the sidebar, then click the add button (+) on the top left.

  2. Under Key Name, enter a unique name for the key.

  3. Select the checkbox Sign in with Apple and click Configure next to it. You can use any other service you want to enable. (Sign in with Apple is used just for demo purposes).

  4. On the next page, choose the app identifier you want to use and press the Save button.

  5. Click Continue

  6. Review the key configuration, then click Register.

  7. Download the key; it’s saved as a text file with a .p8 file extension.

  8. Click Done.

Key file .p8

The key file can only be downloaded once during the creation process. Once the key has been created, it cannot be downloaded again. It is important to keep the .p8 key file in a secure location, as it is used to verify the authenticity of the Sign in with Apple service and protect user data.

If you lose the .p8 key file or need to download it again, you will need to create a new one.

Extract the public key from the Key file

To extract the public key from the .p8 key file, you will need to use a command line tool called "openssl". This tool is included with most Unix-based operating systems, such as Linux and macOS, and can also be installed on Windows.

To extract the public key from the .p8 key file using openssl, follow these steps:

  1. Open a terminal window.

  2. Navigate to the directory where the .p8 key file is located.

  3. Enter the following command:

openssl ec -in [key file name] -pubout

Replace [key file name] with the name of your .p8 key file. For example:

openssl ec -in mykey.p8 -pubout

  1. The public key will be printed on the terminal window. You can copy and paste the key into your desired location.

Find the Key ID using Apple Developer Portal

  1. In Certificates, Identifiers & Profiles, click Keys in the sidebar, then click the add button (+) on the top left.

  2. Select the private key to view details

  3. The key identifier appears below the key name

Last updated