Knowledge Base

Fixing VBA Macro Digital Signature error

You may encounter an error while signing a VBA Macro using a code signing certificate installed in a SafeNet Token. This article will help you understand why the error occurs and the workaround to enable you sign the VBA Macro.

Error: "There was a problem with the digital certificate. The VBA project could not be signed. The signature will be discarded."


Root Cause: Microsoft Excel VBA uses a MD5 hash padding for one of the triple signing procedures in case to support cross-version compatibility. The usage of MD5 might not be obvious, as the certificate and key material on the smartcard / eToken are based on more modern and secure algorithms.  This is the reason why you get an error while signing a Excel Macro using your the code signing certificate stored on a SafeNet token.

Solution: For signing Microsoft Excel macros, the deprecated algorithms need to be activated by adding a registry key under "HKEY_LOCAL_MACHINE\SOFTWARESafeNet\Authentication\SAC\"

Steps to Modify the Registry to enable the Deprecated Cryptographic Algorithms.
  1. Open the Windows Registry Editor.
    1. Run > Regedit
  2. Expand to HKEY_LOCAL_MACHINE\SOFTWARE\SafeNet\Authentication\SAC\
  3. Right Click on “SAC” Key to create a new Key, and name it as “Crypto”
  4. Right Click on “Crypto” key and add new String value.
    1. Value Name : Disable-Crypto
    2. Value Data : None
  5. After updating the registry, you should restart the computer to apply the changes.
This procedure will help you fix the problem and allow you to sign the VBA Macro without any problem.

Reference: SafeNet Article Details KB0024651
 

Need assistance?

Contact our team for help with your purchase or issuing your certificate.

Live chat

Call us today