Transfer email and migrate accounts with YippieMove.

Archive

Posts Tagged ‘Programming’

Signing code (Authenticode) in OS X with a Thawte Certificate

July 16th, 2009

Just some quick notes on signing Windows executables using a Mac. First, get Mono:

Download mono

I used version 2.4. Next, take a look at Mozilla’s code signing guide and work around the problems you run into using Zillabit Notes on Mono Authenticode.

It boils down to something like this:

  • Open your Thawte issued .SPC file in Windows using certmgr (just double click it).
  • Expand the certificate view in the left pane and click on Certificates.
  • The components of your SPC file will be displayed, normally consisting of your company certificate and then some signer root certificates.
  • For each of the certificates, go to Action / All Tasks / Export... and export the certificate as a DER .cer file.
  • Bring the exported files to your Mac and join them with cert2spc. E.g.:
    cert2spc cert1.cer cert2.cer cert3.cer my_fixed_certificate.spc
  • Use the newly generated SPC file to sign your code:
    signcode -spc my_fixed_certificate.spc -v my_private_certificate_key.pvk -a sha1 -$ commercial -n MyProductName -i http://www.mycompany.com -t http://timestamp.verisign.com/scripts/timstamp.dll MyProgram.exe
  • Verify by trying to run the executable in Windows.

A final note: don’t try to verify the signing using mono’s chktrust command. At least for me it always tells me the exe doesn’t have a signature.

siker Site , , , ,

Strange OS X SWT Table bug: scrollbar position wrong compared to content

June 8th, 2009

Today I saw a strange SWT bug which I couldn’t find much on when I searched for it online. In Mac OS X with a Table widget, sometimes pressing the Home or End keys on the keyboard would make the scrollbar move without the content actually moving. So for instance maybe you were scrolled towards the bottom and hit the Home key to get to the top: the bug would make you still see the same table rows even that the blue scrollbar marker would hop to the top. Even weirder, if you scrolled with the mouse wheel after that the scrollbar would snap right back to where you started and scroll like if you had never hit Home to begin with.

The solution was to add an SWT.KeyDown listener on the table and intercept any Home or End keyboard events. Set e.doit = false, then use table.setTopIndex() to change the viewing position in the table by hand. E.g. just reimplement the Home and End keys in your own code.

This worked fine for me.

siker Mac OS X, Programming , , , , ,

Multi-band Jasper Reports Graphic

October 22nd, 2006

In order to create a table in Jasper Report’s iReport I wanted to draw a box from the top left corner of the group header, accross the detail section, to the bottom right of the group footer. After a few attempts I believe this is impossible and I am recording that here in case someone else is searching the internet for multi-band graphics in iReports. Anyone know how?

My only resort was to draw the box by hand using line segments, and to create a new line segment per band.

siker Site