I want to archive my app for distribution on two computers. I exported the private key successfully and imported it to my second machine, however run into errors when imported the public key.
Everywhere I search people always mention only exporting of the private key - why is that? how can I export the public key and transfer it successfully? what am I doing wrong?
In the Keychain Access app on your Mac, select the items you want to export in the Keychain Access window. Choose File > Export Items.
If you migrate your data to a different Mac using Setup Assistant, your keychains are automatically transferred to the new computer. If you didn't use Setup Assistant, the best way to copy your keychains to a new computer is to export and then import them using Keychain Access.
To export your private key and certificate, open the Keychain Access Application and select the "Keys" category. Control-click the private key associated with your iOS Distribution Certificate and click Export Items in the menu.
The Keychain Access app is located in the Utilities folder in your Applications folder. If you launch it, you'll see a number of items in the sidebar: different keychains, such as Login, and, if you have the iCloud Keychain active (see below), you'll see an entry for that.
It's been broken since 2009 as reflected in this bug report.
In case that report wanders off the internet, here's the relevant instructions to import a public key pem file. You'll want to execute this in Terminal.
security import pub_key.pem -k ~/Library/Keychains/login.keychain
When you export you private key, you should get a .p12 file. Import that file on the other machine. It should have everything in it you need. You don't need to specifically export and import the public key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With