Skip to content

Instantly share code, notes, and snippets.

@trollixx
Created April 13, 2015 06:08
Show Gist options
  • Save trollixx/6abc5c3769c621ecc485 to your computer and use it in GitHub Desktop.
Save trollixx/6abc5c3769c621ecc485 to your computer and use it in GitHub Desktop.
Signing Windows executables on Linux
#!/bin/bash
# Based on http://development.adaptris.net/users/lchan/blog/2013/06/07/signing-windows-installers-on-linux/
openssl pkcs12 -in $1 -nocerts -nodes -out .key.pem
openssl pkcs12 -in $1 -nokeys -nodes -out .cert.pem
openssl rsa -in .key.pem -outform DER -out .authenticode.key
openssl crl2pkcs7 -nocrl -certfile .cert.pem -outform DER -out .authenticode.spc
osslsigncode -spc .authenticode.spc -key .authenticode.key -t http://timestamp.verisign.com/scripts/timstamp.dll -in $2 -out $3
rm .key.pem .cert.pem .authenticode.key .authenticode.spc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment