yubico-piv-tool icon indicating copy to clipboard operation
yubico-piv-tool copied to clipboard

write documentation for windows codesigning

Open klali opened this issue 9 years ago • 6 comments

windows codesigning (both native and with osslsigncode) is possible, this should be documented.

klali avatar May 08 '15 06:05 klali

I would appreciate some docs on this :-)

ismail avatar Feb 19 '17 12:02 ismail

Any news?

denishonig avatar Jul 02 '20 09:07 denishonig

Any documentation on using osslsigncode please?

adamretter avatar Aug 24 '20 12:08 adamretter

@klali do you know how to sign with osslsigncode if cert is in yubikey? Thanks

denishonig avatar Sep 07 '20 09:09 denishonig

I know that it used to work with the opensc pkcs11 module and a command line like:

$ osslsigncode sign -pkcs11engine /path/to/engine_pkcs11.so -pkcs11module /path/to/opensc-pkcs11.so -key slot_1-id_2 -certs /path/to/cert.pem -h sha256 -comm -t "http://tsa.starfieldtech.com" in.exe out.exe

This obviously requires a version of osslsigncode with pkcs11 support (and I haven't tried it for several years).

klali avatar Sep 07 '20 09:09 klali

Just to put my 2 cents, I managed to use osslsigncode with yubico-piv-tool on Fedora 34 to sign with such a command:

osslsigncode sign -pkcs11engine /usr/lib64/engines-1.1/pkcs11.so -pkcs11module /usr/lib64/libykcs11.so.2 -key "pkcs11:id=%01;type=private?pin-value=XXXXXXXX" -certs ev-code-signing-chain.crt -h sha256 -ts http://ts.ssl.com not-signed.msi signed.msi

XXXXXXXX must be replaced by your yubikey pin for the 9a slot. Here I'm using -ts http://ts.ssl.com as I'm using my yubikey provider RFC3161 timestamp server, but you can use -t option in place if your timestamp server is not RFC3161 compliant. The -certs option point to a file where I concatenated my EV code-signing certificate with all CA and intermediate autority certificates.

I thanks @klali to point me on the right road ;-)

g-bougard avatar Jan 03 '22 14:01 g-bougard