How to programmatically export a Certificates.p12 from 'My Certificates' in Keychain Access?

Viewed 122

Once I import *.cer files that I got by sending a CertificateSigningRequest.certSigningRequest to Apple I can export them as one Certificates.p12 (Personal Information Exchange) which contains all public and private keys of such certificates within Keychain Access, so that I can transfer them to another Mac where I can use them to sign as well.

I would like to automate this process for a wizard software that guides the user on publishing an app under his own account.

I figured out I can export all my identities using the security binary:

security export -k login.keychain -t identities -f pkcs12 -P MYPASSPHRASE -o Certificates.p12

I see no way to export only specific certificates in the My Certificate tab though.

How can this be done properly?

0 Answers
Related