Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error has occurred. Unable to import an item. The contents of this item cannot be retrieved. Missing .pem file

I am struck with a problem. I installed the p12 certificates once into a MacBookPro and then deleted it, now when I am again trying to install it. Keychain is simply not accepting the certificate for strange reason.

After some googling, I hit upon this link: http://www.openradar.me/7092640

Which clearly says that there is a bug with Keychain and states a workaround too. But unfortunately I do not have the .pem file, since I have not made a backup of it thinking that p12 file is sufficient (which actually is, if not for this bug!). So how do I get the .pem file so that I can install the certificates back onto the same laptop using this workaround?

Thanks for any suggestions / ideas. Raj

like image 785
Raj Pawan Gumdal Avatar asked May 20 '11 18:05

Raj Pawan Gumdal


2 Answers

Quoting http://www.openradar.me/7092640:

You can use the 'security' command line tool:

security import priv_key.p12 -k ~/Library/Keychains/login.keychain

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

https://stackoverflow.com/a/16847082/14731 contains a similar answer.

like image 170
Gili Avatar answered Sep 28 '22 03:09

Gili


1., open Keychain Access. 2., On the Keychains panel right click on login. Select Lock Keychain "login". 3., Then unlock it. Then the import should work.

like image 37
Mr. G Avatar answered Sep 28 '22 03:09

Mr. G