export public key from keychain access

前端 未结 3 1110
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-31 11:55

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 t

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 12:28

    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 \ -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

提交回复
热议问题