Generally, the .p12 file is for others to use. This machine must be the certificate under the private key to generate the .p12 file, which means that the certificate you find in all items under the category cannot generate the .P12 file. Because it is not under the private key or it does not carry the private key.
When installing the certificate, if the certificate is installed in the system directory, the .P12 file cannot be generated. The reason is that the user's private key is generally not added to the system key, unless you manually add it, of course, I do not recommend this, as shown in the figure
Solution:
1. Drag (or copy) the certificate to the directory in the login, the type is: my certificate, key, certificate can generate a .P12 file, as shown in the figure
My certificate type
Key type
You need to find the certificate under the App ID Description private key of your registered APPID
You can generate a .P12 file
Under the certificate type
You will find a feature in these three categories. The certificate carries a private key or the .P12 file can be generated under the private key. The certificates found in all projects do not have this feature. This is why the certificate cannot generate a .P12 file. I saw that many solutions on the Internet are to revoke the certificate and regenerate it. In fact, you don't need to do this unless your Bundle ID is registered incorrectly.
Original address: https://www.jianshu.com/p/4dbfa4e7dec0