iOS app needs to access a p12 certificate - download

I am trying to develop an iOS application that requires downloading a .p12 certificate.
I am fairly new to this and would like some guidance as to how to accomplish this.
Appreciate your help, Thanks!

Convert the iPhone developer certificate to a P12 file on Mac OS
Once you have downloaded the Apple iPhone certificate from Apple, export it to the P12 certificate format. To do this on MacĀ® OS:
Open the Keychain Access application (in the Applications/Utilities
folder).
If you have not already added the certificate to Keychain, select
File > Import (Under "System"). Then navigate to the certificate file (the .cer file)
you obtained from Apple.
Select the Keys category in Keychain Access.
Select the private key associated with your iPhone Development
Certificate.
The private key is identified by the iPhone Developer:
public certificate that is paired with it.
Select File > Export Items.
Save your key in the Personal Information Exchange (.p12) file
format.

Related

Unable to test Flutter app on iPhone due to certificate issue

I built a Flutter app using Android Studio. Works fine on iPhone simulator.
When I go to test on my iPhone however by opening up workspace on Xcode and running it with my iPhone connected to my laptop, I get this error:
The certificate used to sign "Runner" has either expired or has been revoked. An updated certificate is required to sign and install the application.
I'm at a loss at what to do here. I am using a free apple developer account.
Any help appreciated!
You need a new certificate (development certificate) installed on your mac's keychain.
First go to the the apple developer console, then Certificates, Identifiers & Profiles => Certificates => Add Certificate (Plus Button) => Apple Developer Certificate.
In order to generate a new certificate you will need to export a new certificate request from your Mac's Keychain Assistant, in order to be able to sign new applications.
To do this: Go to the Keychain Assistant App => Keychain Access => Certificate Assistant => Request a Certificate from a Certificate Authority.
Go through the steps to generate this new certificate request and Save it to your Desktop.
Go back to your Browser, where you are trying to create a developer certificate through the Apple Portal, and upload the generated Certificate Request file.
A new certificate will be created, then download this certificate, and click on the downloaded file, and your MacOS (Depending on any Security Policy) will ask you to type your password to add the new certificate to your keychain.
This certificate will now be used by your Mac to sign all developer applications.
Please note that for production, you will also need another certificate (depending on whether you are uploading to the App Store or distributing via AdHoc).
Once you've done all this, go to the App's Provisioning profile on your Mac Account (via your Browser), then select your provisioning profile of your app, then click Edit. There should be a certificates section, please choose all of them to sign your app.
After this is all done, go to Xcode, then Manually download the provisioning profiles to your device => Clean => Rebuild => Deploy via Flutter. Please also make sure to remove any revoked (expired) certificates from your keychain (to clean up the memory bank).

How do I resolve problems with my Signing Certificates in Xcode

System Preferences / Manage Certificates
The above is a picture of the System Preferences/Manage Certificates area of Xcode (rev 11).
I know this is quite messy, but I'd like to ask the community for help in cleaning up my signing certificates for Xcode.
I am to the point where I cannot Archive any app in Xcode, even a "Hello World" app, due to the state of my signing certificates. I am a paid up developer on Apple Developer.
Below is a picture of the Key Chain Access of my system.
Thanks in advance.
LeonW53
[Key Chain Access Image][1]
I am a little the wiser now.
In order to submit to the Apple App Store, you need a Distribution Certificate and an IOS Distribution Certificate. Both must have the Public and Private key.
The Private Key refers to the computer from which the app will be submitted. The Private Key is password to the Mac that will archive the app and submit.
To start, you need to go onto your distribution Mac and open the Keychain Access app (Applications/Utilities/Keychain Access). Once in, at the top of the screen, go to Keychain Access/Certificate Assistant/Request a Certificate from a Certificate Authority.
Note 1The Request requires a user email address. Use the email address that you use to log into the Apple Developer Site. You do not need a common name. Select Request is Saved to Disk and Continue. You will be allowed to pick the name and Save Folder for the Certificate. Click Save.
You can create All of your Certificates from this one Certificate Signing Request.
Go into the Apple Developer Website and sign in (you need to be paid up to do this). Use the Apple ID that you used to save the Certificate.
Go to Certificates, Identifiers and Profiles.
Click Certificates in the left column. Click the + next to Certificates to add a new Certificate.
You will be asked to what kind of Certificate to Create.
You need to select Apple Development to develop an app on your mac. You may need an iOS App Development to develop iOS apps, but I haven't found this necessary
To Upload and Distribute your app, you need Apple Distribution and iOS Distribution.
Whichever one you pick, click Continue and you will be asked to Upload a Signing Certificate Request. Here you browse to the Certificate Signing Request that you saved (Note 1 above). Click Generate and the Certificate will be created. Click Download and the Certificate will be downloaded to the Downloads folder on your Mac.
You can create several different kind of certificates and you do NOT need to re-create the CSR -- use the same one over and over.
On your Mac, you can just double click the Certificates downloaded and they will be added to your Keychain.
In XCode, select the App root of the App Folder Tree and open "Signing and Capabilities". Select the Team that you have in the Apple Developer Site from the drop down list. Also select Automatically manage signings.
Also in XCode, you go to XCode/Preferences/Accounts. You should selected the Apple ID on the left which is the same as you log into the Apple Developer Account. On the right, you can select the Team which will do the Uploading and click Manage Certificates. You need valid iOS Development, Apple Development and Apple Distribution Certificates.
Note 2 If there are any Certificates that are missing the Private Key, this is because either the CSR was generated on a different PC to your current PC or that you were not logged in as the same developer on the Apple Developer Site. This happened to me, and it was because I wasn't logged into the Developer Site the same as I have logged on my PC in System Preferences.
If you Archive, and you have missing Private Keys, the Archive will ask you to log into Keychain using the password which unlocks the PC for EACH and every missing key. Once done, the archive will be created.
Note 3Make any mistake on this, and you will generate a failed archive with a non-zero exit code. Apple provide no clue as to how to solve this.
My current situation is that I have valid Apple Development, iOS Development and Apple Distribution Certificates and I can archive. In addition to the valid Apple Distribution Certificate, I have two Apple Distribution Certificates which are missing private keys. But, I can archive the app.
Be kind and be safe all.

Change Xcode Managed Signing Certificate for Team

I'm using xcode 9 and have a working distribution profile for releasing apps to the App Store. I'm using my team profile but the signing certificate is set to my iPhone developer cert and has my personal name on it. I would like to create a certificate that has the company name and use that to sign production release apps. How can I go about this?
Update --
When I look at the project structure in XCode, specifically the signing section, there are options to select which Team the app will be published with and directly under that is the signing certificate to be used. There is one cert displayed and its not changeable. That cert clearly shows as my "iPhone developer" certificate with my full name. I would like this to be a team certificate. I'm using XCode managed signing and the info icon next to the profile displays "Certificates: 1 Included. Includes newest signing certificate iPhone Developer: My Name (#####)".
When I look into the Keychain Access app I can see my developer cert, personal cert and team cert for iPhone Distribution (the one I would like to use). I'm not sure how to get this into the provisioning profile so it can be selected when signing an app.

Cannot import certificate into keychain

I am trying to deploy an iOS app to a device. There are two members in my team with developer enrollments.
My team member created a certificate from another mac and exported it. I then imported the certificate into my keychain app. The keychain app is showing the certificate but in Xcode organizer when I refresh from my own developer account xcode says Valid signing identity not found
Xcode version : 4.6.3
check these steps:
export p.12 file from certificate in first mac.
set password to file. (iv'e sometimes seen issues raised when password is not set)
open p.12 file in second mac.
type in password.
download and open appropriate provision file.
Did you try import from another mac and export team in organizer? I had such problems before but i can't remember truely. Your team is valid with green mark in Teams section in organizer?

You must have a valid Mac Application Certificate to create a Provisioning Profile

I can't create production certificate in Mac Developer Portal. Error is:
You must have a valid Mac Application Certificate to create a Provisioning Profile.
Although I have already created Mac Application Certificate and it is shown as valid. Any suggestions?
Does this help?...
Delete the cert and any profiles and create new ones.
Also make sure you are signed into the right Apple ID
(if your iTunes store account ID is different, don't have that open at the same time)

Resources