Heath Borders
Heath Borders

Reputation: 32157

How do I export a single private key from the command line in OSX?

I need to export one private key (identity) from my OSX Keychain from the command line. Using security, I can only figure out how to export all private keys (identities) as a single pkcs12 (p12) file. How do I export a specific one?

Upvotes: 2

Views: 6511

Answers (1)

Heath Borders
Heath Borders

Reputation: 32157

https://github.com/torsten/keychain_access works, but it doesn't support filtering by type. I submitted a pull request for this functionality. Until it is accepted, you can try my fork.

./keychain_access -p password_for_exported_private_key "Name of private key"

Upvotes: 2

Related Questions