user8004594
user8004594

Reputation:

Xcode: Missing private key

I'm trying to add iOS Distribution and iOS Development certificates to another mac, but after downloading and installing I get the error missing private key. How to fix it?

Upvotes: 7

Views: 20410

Answers (4)

tschumann
tschumann

Reputation: 3246

It seems like the private key somehow ends up on the computer of whoever created the certificate. The only way I could get the private key was to open Xcode and go to Xcode -> Settings... -> Accounts -> Manage Certificates... and ctrl+click on the iOS Distribution certificate and Export Certificate. This exported a .p12 file that seems to contain the certificate and private key.

Upvotes: 0

Juliocromo
Juliocromo

Reputation: 21

I fix it deleting the certified from http://developer.apple.com and create a new one since manage certifies on xCode

Upvotes: 2

Koesh
Koesh

Reputation: 471

Make sure you are not copying only the public key (.cer).

You should export the private key (.p12) through the Keychain Access.app from the old mac:

  • In the certificates tab, look for your iPhone Distribution: John Doe or iPhone Developer: John Doe
  • Click on export.
  • You will need to enter a password to generate a .p12 file containing the private key of your certificate.

This file is what you should copy to the new mac, where you will need to import it (using the password). You should be able to use the provisioning profiles when the certificate is installed on the Keychain Access.app

Upvotes: 7

Aakash
Aakash

Reputation: 2269

You need to export the private keys from the system from which they were created (the system whose CSR was used to created the certificates). Without private keys you the certificates do not work.

Upvotes: 3

Related Questions