Can't import public key into OSX Keychain

980

Solution 1

Its a bug in OSX. You can import from the command line as per this answer:

https://stackoverflow.com/a/11979625/59198

The command is:

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

You'll then need to rename the key in keychain.app

Solution 2

The certificate actually contains a copy of the public key (along with a name, and a signature from the certificate authority saying that name and that public key go together). Normally you don't need to deal with the public key as a separate item if you're using a certificate-based system like SMIME. If you wanted to, you could extract a copy of the public key from the certificate using the openssl x509 command.

(I wonder if Keychain is refusing to import the public key because it thinks it already has a copy, in the certificate? Keychain's error messages are usually pretty vague.)

Solution 3

A .p12 file can hold your key pair. You'll be prompted for a password if it contains your private key. Keychain will show the private key in a nested way. If imported correctly it should show under 'My Certificates'.

Share:
980

Related videos on Youtube

user14082345
Author by

user14082345

Updated on September 18, 2022

Comments

  • user14082345
    user14082345 almost 2 years

    I have a problem to use sumproduct with array formula in Google Sheet which seems workable in Excel. The formula returns only 1st array value (E8*F8) which what I have to do is to get total sales price from everyday.

    Below is the formula I used:

    =SUMPRODUCT(ARRAYFORMULA(INDEX(E8:J8,,column(A1:C1)*2-1)),ARRAYFORMULA(INDEX(E8:J8,,column(A1:C1)*2)))
    

    Below is the table view:

    enter image description here

    • Admin
      Admin over 10 years
      why do you want to import the public key? It is the private key that you need to import. The public key is left on teh server, the private key is exported to the client, and that's it.
    • Admin
      Admin over 10 years
      Fair enough - so there no way of importing a public key manually via Keychain (e.g. if someone supplied their public key to you as a file, rather than sending you an email)?
    • Admin
      Admin over 10 years
      You can use scp to copy all files from one to the other, during the period in which password connection is allowed. Then when you have all keys in place, you may disable password login.
    • Erik Tyler
      Erik Tyler over 2 years
      Are you expecting a return of 92 in cell K8? It also seems to me that, while you have data in E8:J8, you will likely want to expand those columns to include more dates than just three. Is that correct? Furthermore, you have formulas happening further down the column, beginning in Row 185. I'm not sure what those are supposed to be doing. And you have totals in Row 186. Are you sure you will only ever need data in Rows 8 - 185? If so, a single array formula can produce all results for Col K.
  • huggie
    huggie almost 8 years
    Where does it import to? I still can't find it in the keychain.
  • Chris
    Chris almost 8 years
    @huggie It loads it with a really generic name in the keychain, something like 'public key' possibly, look for something new in there.
  • Cheyne
    Cheyne about 4 years
    Wow.. This saved me. Spent over an hour stuck on that
  • Gábor
    Gábor over 3 years
    Only that you can't rename, at least not in recent versions (I tried on Catalina). And, needless to say, this bug is still there. After six years or so.
  • Chris
    Chris over 3 years
    Nowadays (6 years later!) I recommend just letting Xcode automatically manage all your signing, it does a better job of it than it used to.
  • j3141592653589793238
    j3141592653589793238 almost 3 years
    Seriously, what is this? This issue is still present as of Aug 2021.