Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Signing Windows application on Linux-based distros

I have prepared an application and website where the customer can set several options for this application before he downloads it. Settings are stored in binary format on the end of the file (appended), then the edited file is sent to the end user. The problem is that the change of "contents" of the file will break the file signature - is there any chance to re-sign this changed file with any command line tools? I've tried to use Microsoft's SignTool, but it does not work properly on Linux.

like image 419
Tomasz Banasiak Avatar asked Aug 17 '13 10:08

Tomasz Banasiak


People also ask

Can I run Windows file on Linux?

Windows applications run on Linux through the use of third-party software. This capability does not exist inherently in the Linux kernel or operating system. The simplest and most prevalent software used for running Windows applications on Linux is a program called Wine.

What is Microsoft authenticode?

Authenticode is a Microsoft code-signing technology that identifies the publisher of Authenticode-signed software. Authenticode also verifies that the software has not been tampered with since it was signed and published. Authenticode uses cryptographic techniques to verify publisher identity and code integrity.

What is Osslsigncode?

osslsigncode is a small tool that implements part of the functionality of the Microsoft tool signtool.exe - more exactly the Authenticode signing and timestamping. But osslsigncode is based on OpenSSL and cURL, and thus should be able to compile on most platforms where these exist.


1 Answers

You can try osslsigncode

To sign an EXE or MSI file you can now do:

osslsigncode sign -certs <cert-file> -key <der-key-file> \         -n "Your Application" -i http://www.yourwebsite.com/ \         -in yourapp.exe -out yourapp-signed.exe 

or if you are using a PEM or PVK key file with a password together with a PEM certificate:

osslsigncode sign -certs <cert-file> \         -key <key-file> -pass <key-password> \         -n "Your Application" -i http://www.yourwebsite.com/ \         -in yourapp.exe -out yourapp-signed.exe 

or if you want to add a timestamp as well:

osslsigncode sign -certs <cert-file> -key <key-file> \         -n "Your Application" -i http://www.yourwebsite.com/ \         -t http://timestamp.verisign.com/scripts/timstamp.dll \         -in yourapp.exe -out yourapp-signed.exe 

You can use a certificate and key stored in a PKCS#12 container:

osslsigncode sign -pkcs12 <pkcs12-file> -pass <pkcs12-password> \         -n "Your Application" -i http://www.yourwebsite.com/ \         -in yourapp.exe -out yourapp-signed.exe 

To sign a CAB file containing java class files:

osslsigncode sign -certs <cert-file> -key <key-file> \         -n "Your Application" -i http://www.yourwebsite.com/ \         -jp low \         -in yourapp.cab -out yourapp-signed.cab 
like image 77
EFernandes Avatar answered Sep 28 '22 06:09

EFernandes