Is it possible to sign a Excel VBA project including timestamp?

前端 未结 1 360
失恋的感觉
失恋的感觉 2020-12-11 11:36

I sign VBA code in Excel files automatically with digital signature, which works well using X509Certificate2 and EPPlus. Now I want to include a timestamp, any idea where i

相关标签:
1条回答
  • 2020-12-11 12:07

    My request could be solved using Microsoft SignTool instead of EPPlus:

    I use Microsoft SignTool (from Microsoft Windows 10 SDK) with the Microsoft Office Subject Interface Packages for Digitally Signing VBA Projects.

    Detailled Information:

    1. Download and install the SDK.
      The folder including signtool.exe is e.g. C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86
      Be sure to use the x86 Folder.
    2. Download and extract the SIP Package.
      Read and follow the contained file readme.txt
    3. Choose your preferred parameters and options of signtool.exe

    Example: With the following command the VBA-Code inside the Excel file is signed with a countersignature using the certificate file including a private key. The Excel workbook itself will not be signed.

    signtool.exe sign /f "CertificateFile.pfx" /p "P@ssw0rd" /fd "SHA256" /tr "http://rfc3161timestamp.globalsign.com/advanced" /td "SHA256" "D:\ExcelFileWithVBA.xlsm"
    
    0 讨论(0)
提交回复
热议问题