This article will assist you to troubleshoot common warning and error messages associated with KeyLocker and Click-to-Sign. Included are errors which are displayed when running a healthcheck as well as during file signing.
Healthcheck Errors:
Your client certificate path or password is incorrect. You will not be able to complete specific actions (such as sign, generate keypairs and approve releases) until these credentials are corrected.
This error can occur if the path set in your Environment Variables is incorrect.
Open your Environment Variables and ensure that the following variable is correct:
Another reason for this error is the use of an incorrect client certificate password.
A third possible cause is that the client certificate was generated and encrypted using AES and a SHA-256 signature hash. This is not supported by older versions of Windows.
Status: Connection failed
This error can be caused by using an invalid API key.
SignTool: Mapped: No
This status means that DigiCert KeyLocker Tools is unable to locate the path to signtool.exe.
Jarsigner: Mapped: No
This status means that DigiCert KeyLocker Tools is unable to locate the path to jarsigner.exe.
Click-to-Sign Configuration Errors:
Invalid api key or host server:
This error is caused by using an invalid API key string. To resolve this, please confirm that you have pasted the correct API key string into the API key field.
Another possible cause is using an incorrect URL in the Host field. The Host field should contain the following URL: https://clientauth.one.digicert.com
Invalid client certificate or passcode:
This message appears when either the path to the Client authentication certificate is incorrect or if an invalid Client authentication certificate password has been used.
To resolve this, ensure that you have specified the correct client certificate file and that you have entered the correct password for your client certificate.
Click-to-Sign Signing Errors:
Click-to-Sign produces a single error message whenever signing is unsuccessful:
Signing failed
Failed to sign “<file name>”
This error message can appear for a number of reasons. To confirm the cause, you will need to check the signing manager log files.
These files can be found here: C:\Users\<user name>\.signingmanager\logs
The primary log file for Click-to-Sign is named digicert-click-to-sign.log. This log file tracks all activity within the Click-to-Sign tool.
When a signing failure occurs, you will see the following lines in the log file:
INFO cts.SignStart - Sign failed for the file - C:\filestosignpath\myfile
INFO cts.SignStart - getting error message from cmd line
Once you have confirmed that a signing error has occurred, you will need to check one of the following log files:
Click-to-Sign / digicert-click-to-sign.log Errors:
INFO cts.SignStart - Sign failed for the file - C:\filestosignpath\myfile
INFO cts.SignStart - getting error message from cmd line
This error message confirms that there was a problem with the signing process. However, it does not indicate any specific cause for a failed signing attempt.
If this path has been mapped correctly, then the next step is to check the file named smctl.log for more information.
Click-to-Sign / smctl.log Errors:
level="error" msg="Error : - exec: \"signtool\": executable file not found in %PATH%: " executable="smctl" func="securesigning/cli/cli/command/sign.runCommand:78"
This error means that Click-to-Sign is unable to locate the path to signtool.exe.
level="error" msg="Error : - exec: \"jarsigner\": executable file not found in %PATH%: " executable="smctl" func="securesigning/cli/cli/command/sign.runCommand:78"
This status means that Click-to-Sign is unable to locate the path to jarsigner.exe.
level="error" msg="Error : jarsigner error: java.lang.Exception: Provider \"sun.security.pkcs11.SunPKCS11\" not found\r\n - exit status 1: " executable="smctl" func="securesigning/cli/cli/command/sign.runCommand:78"
This message means that the path to your PKCS11 properties file has not been mapped correctly. To resolve this, open Click-to-Sign and update the Pkcs11 configuration file field.
The default path is: C:\Program Files\DigiCert\DigiCert KeyLocker Tools\pkcs11properties.cfg
SignTool / smksp.log Errors:
level="error" msg="failed to sign: status_code=403, message={\"error\":{\"status\":\"access_denied\",\"message\":\"User - <User Name> does not have privileges to access the keypair - mykeylockertcert.\"}}, nested_error=<nil>" executable="signtool" func="main.SMKSPSignHashInternal:727
The above error means that you have not assigned a signer to your code signing certificate.
This message also appears if the incorrect keypair alias was specified in the signing command.
JarSigner / smpkcs11.log Errors:
level="error" msg="failed to sign, nested_error=\"hash signing failed for hash: 72e6ca0f8566785e48b00630f32c13af7945f7c6139b03ea87bc2f51fea62e76, keypair_id: e57271a3-53f5-4540-8d8a-23f8854cb7fd, signature_algorithm: SHA256withRSA: status_code=403, message={\"error\":{\"status\":\"access_denied\",\"message\":\"User - <User Name> does not have privileges to access the keypair - key_linux.\"}}, nested_error=<nil>\"" executable="jarsigner" func="securesigning/cli/pkcs11.(*Context).SignFinal:411"
The above error means that you have not assigned a signer to your code signing certificate.
This message also appears if the incorrect keypair alias was specified in the signing command.
For details on setting KeyLocker up for use with Click-to-Sign see Configure KeyLocker for Click-to-Sign.