Signtool usage with Nitrokey HSM

Hi,

I’m trying to do code signing with Nitrokey HSM 2, too. (Currently with a self-signed certificate)

Java code signing already works with the java jarsigner. But not with signtool. Tried:

signtool.exe sign /n "codesigntest" /csp "OpenSC CSP" /kc "codesigntest" /fd SHA256 /debug /v test.exe

Does not work. It only finds certificates in the windows cert store, not on the HSM.

When I export the certificate to a file and execute the signtool like this:

signtool sign /f CodeSignTest.cer /csp "OpenSC CSP" /k "0" test.exe

It is accessing the HSM, as I get a new error window:
image

Windows device manager shows as device “unknown smartcard”.
image

But OpenSC is installed.

Did you manage to get it working?