64-bit versions of Microsoft Windows drivers require Kernel Mode Signing.
To sign 64-bit kernal-mode drivers using an Extended Validation (EV) Code Signing certificate, you will need to download and install the following:
- Windows Driver Kit WDK (Must be installed to acquire the following required tools)
- Microsoft cross certificate which is located at the bottom of the page labeled MSCV-VSClass3.cer
Note: Please ignore Cross Root (MSCV-VSClass3.cer) if signing Microsoft Windows 10 drivers
- SafeNet eToken Drivers
The below signtool examples use several of the arguments that SignTool supports:
Sign: Configures the tool to sign the intended file
Verify: Verifies the digital signature of files by determining whether the signing certificate was issued by a trusted authority, whether the signing certificate has been revoked, and, optionally, whether the signing certificate is valid for a specific policy.
/ac: Adds the cross-certificate from the CrossCertificateFile file to the digital signature
/fd: Specifies the file digest algorithm to use for creating file signatures. The default is SHA1.
/kp: Performs the verification by using the x64 kernel-mode driver signing policy.
/n: Specifies the Common Name of a certificate. Use this option if you have certificates issued to more then one organization in your certificate store.
/s: Specifies a certificate store (If the certificate is imported into the Personal store, the SPCCertificateStore is MY)
/t: Specifies that the digital signature will be timestamped by the Time-Stamp Authority (TSA) indicated by the URL
- /tr: Specifies the URL of the RFC 3161 time stamp server. This option cannot be used with the /t option.
/v: Specifies the verbose option for successful execution and warning messages.
Note: The timestamping URL is http://timestamp.digicert.com
To successfully sign driver files, please follow these steps:
- Insert the Safenet USB token into the computer.
- Use inf2cat.exe to validate the driver package INF file and create a valid catalog file. If successful, a catalog file (*.cat) will be created.
- Use signtool.exe to sign the catalog (*.cat) and all driver (*.sys) files as below.
NOTE: Replace "C:\driver.sys" with the name of the specific file you are signing. This will need to be run against all of the drivers and the catalog.
NOTE: SignTool will use SHA-1 as the default signature digest algorithm, even if you are using a SHA-256 certificate. Please use the command to add the appropriate signature digest algorithm.
SHA-1 with Timestamp:
SHA-256 with RFC 3161 Timestamp:
signtool sign /v /ac "C:\Authenticode\After_10-10-10_MSCV-VSClass3.cer" /s MY /n Company Name /fd sha256 /tr http://timestamp.digicert.com C:\driver.sys"
NOTE: If there are multiple certificates installed in your Personal certificate store, use the /sha1 option to specify the hash value of the EV Code Signing Certificate.
This would be the thumbprint value of your EV Code Signing Certificate. Please ensure to remove all spaces for the thumbprint value.
signtool sign /v /ac "C:\Authenticode\After_10-10-10_MSCV-VSClass3.cer" /s MY /sha1 sha1_thumbprint_value /n "Company Name" /t http://timestamp.digicert.com "C:\driver.sys"
- After running one of the above commands, you will be prompted to enter in your Token Password:
Note: If you want to batch sign your files, you will need to enable single logon for the SafeNet Token. Please refer to the this solution. Once you have enabled single logon and have logged into the Token, you will be able to batch sign your files without being prompted for the Token Password every time.
- You will receive a message that the file has been successfully signed.
- To verify that the file was properly cross-signed, use the following syntax:
signtool verify /v /kp "C:\driver.sys"
- Verify the Cross Certificate Chain and confirm that it chains to the Microsoft Code Verification Root. For Example:
For more information, refer to the following documents from the Microsoft knowledge base: