Jarsigner Errors and Solutions
Certificate Chain Not Found Error
jarsigner: Certificate chain not found for: <Certificate Alias>. <Certificate Alias> CA must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.Problem
This error message appears when the Certificate Alias provided is incorrect or the certificate corresponding to the alias has been deleted in the Windows Key Storage. Without a valid alias referencing a certificate entry the signing process cannot proceed.
Solution
To resolve this issue, follow these steps:- Verify the Certificate Alias: Ensure that the Certificate Alias provided in the command matches the one that was generated in the README.
- Reinstall the Required Certificates:
- If the certificate is missing or was deleted, rerun the SIGN+ Installer to reinstall the necessary certificates.
- Ensure the installer completes successfully without errors.
- Retry the Command:
- After verifying or reinstalling the certificate, reattempt the command with the correct alias.
Signer’s certificate chain is invalid warning when signing and verifying a jar
Warning:
The signer's certificate chain is invalid. Reason: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetProblem
This warning occurs when signing or verifying a JAR file using a certificate generated with a private trust. The issue arises because the root and intermediate certificates associated with the private trust have not been imported into the JDK cacerts KeyStore. Without these certificates, the Java security framework cannot validate the certificate chain, leading to the invalid chain warning.
Solution
To resolve this warning, you can either:- Use a Public Trust:
- Use certificates issued by a publicly trusted Certificate Authority (CA). These public CAs are already included in the JDK cacerts KeyStore by default, ensuring that the certificate chain can be validated without additional configuration.
- Import Certificates into the JDK cacerts KeyStore:
- If using a private trust, manually import the Root CA certificate and the Intermediate Issuing CA certificate into the JDK cacerts KeyStore.
Jarsigner: Not a Private Key
jarsigner: key associated with <Certificate Alias> not a private keyProblem
This error occurs when the AppViewX CSP Library or its dependent library files are missing or have been deleted. Without these libraries, the system cannot access or associate the private key required for the signing operation.
Solution
To resolve this error, follow these steps:- Reinstall the AppViewX CSP Library:
- Locate the SIGN+_Package that was previously downloaded.
- Run the SIGN+_Installer included in the package. This installer will reinstall and restore the required library files, including the AppViewX CSP Library and its dependencies.
- Retry the Signing Command: After the installation is complete, rerun the signing command that was generated in the README.
Java: ProviderException
Error Message
Jarsigner with PKCS#11 Windowsjarsigner error: java.security.ProviderException: Library C:\Windows\System32\AVXPKCS11V1.dll does not existJarsigner
with PKCS#11
Linuxjarsigner error: java.lang.reflect.InvocationTargetExceptionJSign
and APKSigner with
PKCS#11java.security.ProviderException: Failed to create a SunPKCS11 provider from the configuration <Path to AVXPKCS11V1.cfg>Problem
These error messages occur when the AppViewX PKCS#11 Library or its dependent library files are missing, have been deleted, or have been moved from their original installation location. This prevents the signing tools or PKCS11? from accessing the necessary libraries for PKCS#11 operations.
- Locate the SIGN+_Package that contains the SIGN+_Installer.
- Run the SIGN+_Installer to reinstall and restore the
AppViewX PKCS#11 Library along with its dependencies. This step will
ensure that:
- The required files (e.g., AVXPKCS11V1.dll for Windows or equivalent libraries for Linux) are copied to their correct locations.
- The configuration file (AVXPKCS11V1.cfg) is updated and correctly placed.
- Verify Library Installation: After running the
installer, ensure that:
- On Windows, the AVXPKCS11V1.dll file is present in the C:\Windows\System32\ directory.
- On Linux, verify the location of the PKCS#11 library file and ensure the configuration file path matches the installation.
- Retry the Signing Command: Execute the signing command again with the correct configuration and library paths that’s generated in the README.