ChatGPT解决这个技术问题 Extra ChatGPT

How can I add private key to the distribution certificate?

Well, I've got my Developer Certificate linked with it's private key. Works Fine.

I've downloaded my iOS Profile of distributor, but it says Valid signing identity not found.

So I checked my certificates, and exactly, my developer certificate it's linked with its private key but not my distribution certificate. How can I link/add my private keys to this certificate!?

Will this solve the problem "Valid Signing identity not found"?


D
Daniel Martín

Yes, the error you are getting means that there is not a private key on your Mac associated with the distribution certificate you are trying to use to sign the app.

There are two possible solutions, depending on whether the computer who requested the distribution certificate is available or not.

If the computer who requested the distribution certificate is available (or there is a backup of the distribution assets somewhere)

From the computer where the distribution asset was generated, open Xcode. Click on Window, Organizer. Expand the Teams section. Select your team, select the certificate of "iOS Distribution" type, click Export and follow the instructions. Save the exported file and go to your computer. Repeat steps 1-3. Click Import and select the file you exported before.

If the computer where the distribution profile was created is not accessible anymore (and there is not a backup)

You have to revoke the certificate and create a new one.

You may need to ask your team admin or agent to give you some privileges in order to generate distribution certificates. Once you have enough privileges, follow these steps (accurate as of 15-May-2013):

Go to this webpage: https://developer.apple.com/devcenter/ios/index.action Click on "Member Center" and enter your iOS developer credentials. Click on "Certificates, Identifiers & Profiles". Click on "Certificates" under the "iOS Apps" section. Expand the Certificates section on the left, select Distribution, and click on your distribution certificate. Click Revoke and follow the instructions. Click on the plus sign to add a new certificate. Select "App Store and Ad Hoc" option, and click Continue. Follow the steps printed in the webpage. That involves opening the Keychain application on your Mac and generate a Certificate Signing Request from there. Click Continue. Upload the .csr file and click Continue. A certificate is generated for distribution. Download it and double click it to integrate it in your keychain.

Reopen Xcode and check your project configuration to see if you can now select an "iPhone Distribution" certificate (i.e. it's not grayed out).


I have donwloaded the certificate from "Member Center", I removed my old certificate and install the new one, but stills the same. In the Organizer I can see how the iOs Development Team has a green tick of being verified but the iOS Distribution doesn't have it! And what means in point 4 follow the instructions?
The certificate is not enough, you need the private key too. Can you export the certificate+private key from the machine where the distribution certificate was generated?
Organiser just shows me a list of builds, no team menu. Think this answer is outdated.
i guess this answer should be removed because its not relevant anymore
@andrewb for me, i can do the stuff here: developer.apple.com/account/resources/certificates/list
C
Community

Since the existing answers were written, Xcode's interface has been updated and they're no longer correct (notably the Click on Window, Organiser // Expand the Teams section step). Now the instructions for importing an existing certificate are as follows:

To export selected certificates Choose Xcode > Preferences. Click Accounts at the top of the window. Select the team you want to view, and click View Details. Control-click the certificate you want to export in the Signing Identities table and choose Export from the pop-up menu. Enter a filename in the Save As field and a password in both the Password and Verify fields. The file is encrypted and password protected. Click Save. The file is saved to the location you specified with a .p12 extension.

Source (Apple's documentation)

To import it, I found that Xcode's let-me-help-you menu didn't recognise the .p12 file. Instead, I simply imported it manually into Keychain, then Xcode built and archived without complaining.


J
Jorge Casariego

With Xcode 9 the interface has been updated and now the way I did to resolve the problem was this:

Choose Xcode > Preferences. Click Accounts at the top of the window. Select the team you want to view Click the gear icon () in the lower-left.

https://i.stack.imgur.com/qOW2w.png

Export Apple Id and Code Signing Assets After entering a filename in the Save As field and a password in both the Password and Verify fields you'll see a Window like this

https://i.stack.imgur.com/QftQ2.png

Click the gear icon () -> Click Import -> Select the file you exported in step 6


The export and re-import works for me. It solved my "Missing Private Key" problem in Xcode Preference - Account. However, it remains a mystery on why export/import helps in this case?
As often, there are several solutions applying to various stages of the software. The first one (by Daniel Martin) was impossible to execute because the respective UI elements have been removed, the second one (by andrewb) was executable but did not solve the problem, and the this one finally solved it. Maybe next year, another solution will be necessary...
B
Buntylm

This site explain step by step that what you need to do Certificates, Identifiers & Profiles and as your question

"Valid Signing identity not found"?

You need the private key that were used to sign the code base with provisioning profile. . If you don't have then you can generate a new signing request on the iOS developer portal.

For Export:

Xcode -> Organizer, select your team. Click Export. Specify a filename and a password, and click Save.`

For Import:

Xcode -> Organizer, select your team. Click Import. Select the file containing your code signing assets. Enter the password for the file, and click Open.


s
shine odigie

What you need to do is to create a Certificate Type (iOS Distributionfrom) from the link below

https://developer.apple.com/account/resources/certificates

Once this is done , download it into your Keychain on your computer.

Step 2: Go to the link below and create a profile

https://developer.apple.com/account/resources/profiles/list

While creating the profile make sure to select the same package ID for ur app.

Then download the profile u just created

Step 3: When pushing your App to the App store make sure to select Manual signing . Then select the profile u downloaded and import it and also select the certificate you created

this did it for me


k
kjyv

What worked for me after getting this error on the same machine the distribution certificate was created was this:

Open Xcode settings Select account select the proper Team click Manage Certificates click + button choose Apple Distribution

This added the proper certificate also to Keychain (which I thought I already downloaded and added manually before) and then xcodebuild was happy.


C
Community

For Developer certificate, you need to create a developer .mobileprovision profile and install add it to your XCode. In case you want to distribute the app using an adhoc distribution profile you will require AdHoc Distribution certificate and private key installed in your keychain.

If you have not created the cert, here are steps to create it. Incase it has already been created by someone in your team, ask him to share the cert and private key. If that someone is no longer in your team then you can revoke the cert from developer account and create new.


I've created the cert, and I installed I can see it in my keychain access. In The Certificates list I see the developer one, where I can expand it and see the private key, but the Distributor one I can not.
Okay. Login to your dev account and create ad hoc distribution, if not already created. If it is created, just ask that concerned person in your team/company to share the cert and key with you.
R
Rukshan

"Valid Signing identity not found" This is because you don't have the private key for distribution certificate.

If the distribution certificate was created originally on a different Mac you may need to import this private key from that Mac. This private key is not available to download from your provisioning portal.

When you import the correct private key to your mac , XCode's organizer will recognize your already downloaded distribution profile as a "Valid profile"

However if you do not have access to the original Mac which created those profiles, the only option you have is revoking profiles.


Z
Zen Of Kursat

since xcode5 organizer no longer team section exists. but the bold sentence was the answer for me. God thanks there is another mac to restore and import to problemmatic mac. now all is ok.


L
Logic

What i did is that , i created a new certificate for distribution form my Mac computer and gave signing identity from this Mac computer as well, and thats it