You are here: All articles » Programming » Code signing for Open Source executable
-
Code signing for Open Source executable
written: 8 years ago
category: Programming
Previous
Next
I just hassled various hours with code signing, certificates, and terms I am not handling every day with. So, here's my working tutorial for signing an .exe file using signtool.exe from Microsoft.
- Go to certum.eu and buy a certificate for code signing. At the time of this writing, I paid roughly 15 EUR for a one year lasting certificate. After placing the order, you will have to
- verify your email address
- send them your scanned identinty card, and e.g. your scanned driving license per email.
-
Once the certificate has been activated, take Firefox and log on to your account at certum.eu. Now, click "Certificates Management", then click the certificate you just created. Now, click the "Install online" button:
-
Now, go to your Firefox settings (Einstellungen) => "Advanced" (Erweitert). Then click "Certificates", then click "Show certificates". In the upcoming dialog, click the tab "Your certificates", then click the newly installed certificate. Now, click "Backup" and save that to a .p12 file somewhere on your harddisk. You will be asked for a password - just remember it for later:
- Now you need signtool.exe from Microsoft. Pick the right version of the Windows SDK from their archive page. You can safely uncheck everything except for Developer Tools => Tools when installing. After installing, you have the signtool.exe in C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\ (or similar)
-
Now you have everything you need. The rest is a nice command line:
If that went fine, you will see such a message:C:\>Program Files\Microsoft SDKs\Windows\v6.1\Bin\signtool.exe sign /f c:\somepath\fromfirefox.p12 /p yourpassword /t https://timestamp.comodoca.com/authenticode c:\somepath\myapp.exe
Done Adding Additional Store Successfully signed and timestamped: c:\somepath\myapp.exe
Comments:
Leave a comment
- Go to certum.eu and buy a certificate for code signing. At the time of this writing, I paid roughly 15 EUR for a one year lasting certificate. After placing the order, you will have to
hast Du es auch schon einmal mit den kostenlosen Zertifikaten von startssl.com versucht? Die Zertifikate dieser CA sind auch weltweit gültig.
Viele Grüße
Ulf
Der ganze Kram mit Zertifikaten und deren Einrichtung ist für mich recht neu. Was ich aber wusste war dass die Zertifikate Geld kosten, und das in einer Höhe die das für kleine OpenSource-Projekte uninteressant machen. Ich hatte dann von certum.eu gelesen dass man dort kostengünstig ein Zertifikat fürs Code Signing bekommt. Sind die Zertifikate von startssl.com denn auch für Code Signing gültig?
Für erweiterte Identitätsbestimmung (EV) bezahlt man bei StartSSL mehr, das ist dann aber ebenso wie bei anderen CAs auch nur für Firmen möglich.
Dafür sind die dortigen Zertifikate auch zwei Jahre gültig.
Worauf man achten sollte, ist das sogenannte Lifetime Signing (bzw. daß dieses *nicht* aktiviert ist). Wenn du deine Programme signierst, solltest du als erstes immer einen Zeitstempel in die Signatur einfügen. Aber selbst dann kommt es drauf an welche Eigenschaften das Zertifikat hat. Unter den EKUs sollte, für den Fall daß es sich um ein derlei beschnittenes Zertifikat handelt, Lifetime Signing (1.3.6.1.4.1.311.10.3.13) existieren. In dem Fall wird die Signatur mit Auslaufen des Zertifikats ungültig. Ohne diese EKU bleibt eine mit Zeitstempel versehene Signatur quasi beliebig lange gültig - unabhängig davon ob das Zertifikat selbst bereits abgelaufen ist oder nicht.