Missing Private key solution - IOS certificate.cer as p12 file

How to use an Apple certificate multiple times - export p12 file

Why export .p12 files

: Because Apple stipulates that the .cer certificate can only exist on one machine, so if you want to use it on another computer, you need to export it as a .p12 file and install it on another mac computer that does not have the .cer file installed. 

When we develop applications with more than three Mac devices, we want to apply for a new certificate. If our certificate contains 3 publishing certificates and 2 development certificates, we can find that we can no longer apply for development certificates and publishing certificates. (Generally, there should be only one development certificate and one publishing certificate in our certificate interface. There is no need to generate so many certificates. Certificates are generally re-added after they expire.)

As shown in the picture:

At this time, when you click "+" again, you will find that you cannot click the development and publishing certificates, that is, you cannot add the development certificates and publishing certificates:

There are two ways to solve the problem of not being able to add a certificate.

The first method - "revoke" (not recommended):

"revoke" the previous certificate, as shown in the figure:

Then regenerate a new certificate.

This method is possible, but it will cause the corresponding Provisioning Profiles to become invalid, which is a minor problem. However, it is a waste of time to reapply for a certificate or even a description document, so this approach is not recommended.

The second method - ".p12" (recommended):

Each of our certificates can generate a .p12 file. This file is an encrypted file. As long as the password is known, it can be used by all mac devices, so that the device does not need to re-apply for development and release certificates on the Apple developer website. , you can use it.

Note: Generally, .p12 files are for others to use. The machine must already have a certificate with a secret key to generate a .p12 file, as shown in the figure:

Open the keychain, select the certificate we need, right-click, and select "Export "iPhone Distribition:```":

Fill in a name for the .p12 file and click Save:

Fill in a "password" and the "verification" is the same as the password:

Click OK, and a .p12 file will be formed on the desktop:

To successfully install on someone else's computer, two files are required:

  • The ".p12" file exported by this certificate.

  • The "description file" corresponding to the "certificate" in Apple Developer

If you need it for development, you need these two files:

The .p12 file itself is an encrypted certificate, so these two files can be used by other mac devices:

After getting these two files, double-click "Certificate" and ".p12" file in sequence (you need to enter a password, the password is the password set when generating .p12 at that time), the function is to add it to the keychain, so that our computer has Proof of development, "description file" (the function is to place it in xcode to let xcode know the legality of our development), you can use it after adding it

Guess you like

Origin blog.csdn.net/u013712343/article/details/132412769