Expanding on answers already in this thread, it is possible to provide the token password using the standard signtool program from microsoft.
1. Export your public certificate to a file from the SafeNet Client
|
|
My company offers consulting on how to prepare for TISAX, ISO27001, NIS2, CSMS and SOC2 audits. |
|
||
| Get in touch with us here: https://www.endpoint-cybersecurity.com/contact/ |

2. Find your private key container name

3. Find your reader name

4. Format it all together
The eToken CSP has hidden (or at least not widely advertised) functionality to parse the token password out of the container name.
The format is one of the following
[]=name
[reader]=name
[{{password}}]=name
[reader{{password}}]=name
Where:
readeris the “Reader name” from the SafeNet Client UIpasswordis your token passwordnameis the “Container name” from the SafeNet Client UI
Presumably you must specify the reader name if you have more than one reader connected – as I only have one reader I cannot confirm this.
5. Pass the information to signtool
/f certfile.cer/csp "eToken Base Cryptographic Provider"/k "<value from step 4>"- any other signtool flags you require
Example signtool command as follows
signtool sign /f mycert.cer /csp "eToken Base Cryptographic Provider" /k "[{{TokenPasswordHere}}]=KeyContainerNameHere" myfile.exe
Update:
This doesn't work after updating the key.
Check this thread for more details:
https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing
© Copyright 2019 Sorin Mustaca, All rights Reserved. Written For: Sorin Mustaca - Security & Technology
Want to work with me on this topic?
Check Endpoint Cybersecurity to see the consulting services we offer.
You must be logged in to post a comment.