Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing private key iphone developer in keychain

I'm trying to run an application on my iPhone, but I'm having problems with the code signing identity. Actually I have two certificate in my keychains, one for the distribution, and one for developing that does not have the private key. I tried to download again the certificate from developer.apple.com but I still can't have the private key. In fact I can't select the iPhone developer profile from Target -> Build settings -> Code signing Identity because I get the error:

Profile doesn't match any valid certificate/private key pair in your keychains.

Moreover in the organizer the status of the developer profile is:

Valid signing identity not found.

Do you have any suggestion?

like image 861
iconso Avatar asked Sep 05 '13 19:09

iconso


People also ask

What is a private key in keychain?

A private key, also known as a secret key, is a variable in cryptography that is used with an algorithm to encrypt and decrypt data. Secret keys should only be shared with the key's generator or parties authorized to decrypt the data.

How do I add a private key to my certificate?

Assign the existing private key to a new certificateSign in to the computer that issued the certificate request by using an account that has administrative permissions. Select Start, select Run, type mmc, and then select OK. On the File menu, select Add/Remove Snap-in. In the Add/Remove Snap-in dialog box, select Add.


3 Answers

If you had an older machine where you had created a CSR and downloaded the certificate originally, then export the certificate from its keychain. Save it as a .p12 file and then copy it to your new machine on which you are working currently. Double click the .p12 file to install it to your keychain. Expand and see if you see the private key.

If this is the original machine and you still do not have a private key in your keychain, you would have to request for a new certificate.

like image 126
Hetal Vora Avatar answered Oct 16 '22 14:10

Hetal Vora


If you don't have your private key in your keychain or stored anywhere else, then you cannot sign an app. There is no point in downloading the developer certificate from Apple. Your private key is NEVER sent to Apple at any point in the process. Only your public key is sent.

The private key & public key PAIR is created when you create a Certificate Signing Request using keychain. This is exactly what you need to do if you have lost your private key.

like image 38
Ruchira Randana Avatar answered Oct 16 '22 12:10

Ruchira Randana


We identified in our case that we were exporting the WRONG certificate, because Keychain Access has a UX deficiency in that when you use the search box, you don't see certificates with a name matching what you searched for, you see certificates tied to PRIVATE KEYS with a name that matches what you searched for.

Because of this confusing UX of Keychain access, we were continually exporting the wrong certificate (but had convinced ourselves it was right because the name matched). Once we identified it as the right certificate, our import problem & signing identity missing private keys messages went away

see Can't import Code-signing Public or Private keys using Keychain access (Mac OS X Mavericks) for complete notes.

like image 22
Jason FB Avatar answered Oct 16 '22 13:10

Jason FB