Search code examples
ioskeychainapple-developer

Generate new iOS app distribution certificate from new MacBook


I have an iOS app that is live in the app store, and I need to generate a new distribution certificate for signing the app. From what I understand, the app will always use the same private key, but needs a new certificate generated annually.

I am not using the same MacBook that I used to generate the original certificate, but I have the .p12 file that was exported from the original MacBook. I have imported it into the Keychain and have been successfully signing releases of my app.

Now I need to know how to generate a new certificate from my private key. I tried right clicking on my private key in the Keychain Access app and selecting "Request a Certificate From a Certificate Authority". Unfortunately this only resulted in the following cryptic message:

"The specified item could not be found in the keychain"

How can I generate a new distribution certificate for my app?


Solution

  • Find your p12 file and do the following

    Generate the private key

    openssl pkcs12 -in your.p12 -nodes -out private.key -nocerts
    

    Generate the CSR

    openssl req -new -key private.key -out request.csr
    

    Then upload that to Apple