Problem CodeSigning a Mac app

Hi. I’m working with Xojo 2017r1.1 on a Mac with OSX 10.12.6 creating a desktop Mac app. I’m trying to codesign my app as I’ve done many times before. When it’s time to codesign my app, I open Terminal, and change to the directory that has my app in it. Then I type something like this but with the proper names instead of the placeholders below…

codesign -f -s “Developer ID Application: MyName GoesHere” “MyApplication.app”

Normally, after hitting return on that line, the cursor just comes back indicating no error. Now, I get an error message saying…

“error: The specified item could not be found in the keychain.”

I’m doing nothing (that I’m aware of) differently than I’ve always done, yet now it fails. I did just recently upgrade my Mac OS from 10.12.5 to 10.12.6 if that matters. And, I double-checked the App Store for updates to ensure there wasn’t an update for any of the apple developer tools. I haven’t been messing with the keychain in any way that I know of.

Anything ring a bell to anyone? Has my authority to codesign an app expired? Where would I find that out? Any ideas?

Thanks!

Perhaps you could check the Keychain app under the System Keychains. It would list when the certificate expires.

After signing, do a

codesign -d -vvvv “MyApplication.app”

to verify the status of the signing

Open your keychain and click on “my Certificates” it will tell you what you need to know.
While I’m typing, I would be remiss not to suggest you expend the modest sum to purchase AppWrapper. It tells you so much more than just signing your code and, IMHO, is an invaluable tool.

Thanks Edwin and Roger. (And, I’ll look into AppWrapper.) I did check the Keychain app. Under System, I found a Apple Timestamp Certification Authority and an Apple Worldwide Developer Relations Certificate Authority. I think those are the two of interest, and both have NOT expired. (Under My Certificates, I just have one “com.apple.systemdefault”, which I don’t think is relevant.) Anyway, I think I’m good in that my authority to codesign hasn’t expired, so that’s good, but I still haven’t figured what might have changed between when this all worked and now when it does not? Still learning…

Under the keychains, look for the entry which matches your certificate name. If it is not there, it’s probably got deleted somewhere along the way.

HA! Thanks Edwin. If I clicked LOGIN on the KeyChain app, and then click MY CERTIFICATES on the Category section, lo and behold, my certificate to sign apps expired around NOON today!!! Should’ve codesigned before noon I guess. :slight_smile: Anyway, guess I have to now figure how to re-up on my authority. Thanks for the help.

Really, do it. Use http://www.ohanaware.com/appwrapper/ and your issues will be much easier to solve or most probably, entirely gone. :slight_smile:

+1 for AppWrapper.

Ken, there’s even a demo of AppWrapper, a great way for you to diagnose this particular problem.

developer.Apple.com --> your account --> follow the instructions

Thanks everyone. Yup, AppWrapper looks like a no-brainer (even though, at present, my apps are NOT in the App Store.) And just to be argumentative, no matter how good AppWrapper is, it wouldn’t have fixed my problem…namely that my authority to codesign an app ran out around noon yesterday. This was a problem I have to fix by opening up my wallet. Don’t think AppWrrapper could help with that! I’ve already re-upped as a Mac Developer, but haven’t yet figured out how to re-up my codesign’ing ability. I did check the developer.apple.com account page, looked for my existing (and obviously expired) certificate but it comes up empty as if I’ve had no certificates. Anyway, I have an email to Apple Dev about it, and I’m sure I’ll be back up and codesigning soon. Thanks again for all who chimed in. This forum is an unbelievable resource.

Just a quickie update. I’m back up and running and able to codesign again. Not that you guys don’t already know this, but I found out a certificate that is expired cannot be renewed, but you just get a new one (which I did, and all is well.) Another pleasant surprise (to me at least) was that I did NOT have to pay for the certificate. As I remember 5 years ago when I last got a codesigning certificate, in addition to the $99 to become a Mac Developer (which you had to be in order to request a certificate) I also had to pay another fee for the certificate itself. My memory might be faulty, but I was delighted that I didn’t have to pay for the certificate now. Anyway, back up and running…

I think it might be :slight_smile: You’ve never had to pay for a certificate from Apple on top of your Developer membership. In past years you had to pay for a membership for the Mac side of things and a separate membership for iOS. Perhaps you’re thinking of that? Now there is just one combined membership.

Anyway, glad you got sorted.

Yup, that’s probably it!

Certificates are pretty much free on the Apple End. The only Developer membership fees is mainly for the App Store deployment.

Glad that you are back in business :slight_smile: