简体   繁体   中英

export public key from keychain access

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?

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.

Same as DougW,

But first you must directing your terminal to directory of the key

Then change the pub_key to the name of key you will import

Example:

your key on folder Documents , and the key name is my_login.pem

So, you must write in terminal

$ cd Documents

$ security import my_login.pem -k ~/Library/Keychains/login.keychain

But be careful, you must need a backslash if you key name like

$ security import \<my_login.pem\> -k ~/Library/Keychains/login.keychain

Backslash for escape character as text

https://ubuntuforums.org/showthread.php?t=1976408

Don't understand the backslash here

For Your Information

And you can import keychains with change the directory, the directory show in here

keychains directory

just let your pointer on the kind of keychain you want to know

So it will be like this

security import **yourkeyname** -k ~/Library/Keychains/System.keychain

BE CAREFUL with this

You must know what you do

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM