How to combine p12 certificate files

November 22, 2023 · 1 min read

If you have 2 .p12 files (say certificates_1.p12 and certificates_2.p12 ), each encrypted with its own password, you can merge certificates_1.p12 into certificates_2.p12 with the following command:

keytool -importkeystore -srckeystore certificates_1.p12 -srcstoretype PKCS12 -destkeystore certificates_2.p12 -deststoretype PKCS12

This was the case when we wanted to update the certificates we use to code-sign our macOS app and we needed to combine the old certificates with the new ones so that the automatic update system would work.

Ilias Trichopoulos

Written by Ilias Trichopoulos who lives in Zurich creating stuff. You should follow his playlists on Spotify and his DJ sets on SoundCloud!