Building an Installer — Part 7

Signing the package

C4
2 min readJun 3, 2014

Again, not entirely straightforward. After searching around a while for a tutorial on how to sign a package, I mostly found a bunch of pointers to the Man Pages. There was, however, this one non-specific answer from StackOverflow:

Check for the private key in your keychain. You need both the key and the certificate to do the signing (together Apple calls this an “identity”).

That’s it. No other explanation. Thanks.

The Explanation

First I tried:

productsign --sign “iOS Developer: Travis Stuart Kirton (Travis Stuart Kirton)” C4Installer_0_01.pkg C4Installer_0_01_Signed.pkg

No luck. Then I tried:

productsign --sign “iPhone Developer: Travis Stuart Kirton (xxxxxxxxxx)” C4Installer_0_01.pkg C4Installer_0_01_Signed.pkg

No luck. Then I tried:

productsign --sign “iPhone Developer: Travis Stuart Kirton” C4Installer_0_01.pkg C4Installer_0_01_Signed.pkg

No luck. Annoyed. Search. Found the answer above… “Check for the private key”… So, I check for the private key. There is one. Then I try:

productsign --“Developer ID Installer: Travis Stuart Kirton (xxxxxxxxxx)” C4Installer_0_01.pkg C4Installer_0_01_Signed.pkg

No luck. Really annoyed. Then, I realize I’m creating an installer for an Xcode project that builds iOS apps. The installer will work on OSX and not iOS, so I need to have a Mac Developer ID Installer. I went to the Apple Dev portal and downloaded a copy of my certificate and tried the following:

productsign --sign “Mac Developer ID Installer: Travis Stuart Kirton” C4Installer_0_01.pkg C4Installer_0_01_Signed.pkg

No luck. WTF. Oh, yeah… Duh? “Check for the private key”… And, there isn’t one for the Mac Developer ID on my comp, because I just got this one. So, I screen share with the Mini sitting on my desk, export the Mac Developer ID Installer key that’s in the Keychain on that machine, copy it to my Pro, install it and open Keychain again. I check for Keys, find it, and copy the certificate’s common name, then I try:

productsign --sign “Developer ID Installer: Travis Stuart Kirton (xxxxxxxxxx)” C4Installer_0_01.pkg C4Installer_0_01_Signed.pkg

Done.

--

--