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.