Jan 7, 2026
|
OVERVIEW: This page walks you through the process of token-based JAR Code Signing in Mac OS X platform. At the completion of this procedure, you will be able to sign a JAR file in Mac OS X platform. For more Code Signing guidelines, please refer to this page. |
|
SUGGESTION: Only if the timestamp trust chain does not validate, then import R6-R45 timestamp cross certificate in Java root CA certificate store. You can use this command line for the purpose: keytool -import -trustcacerts -alias myrootcert -file "C:\path\to\your\root_certificate.cer" -keystore "C:\path\to\your\cacerts" |
Install the 32-bit JDK and locate the JDK bin folder. Note: The default location is "Computer\Mac OS X\Library\Java\JavaVirtualMachine\jdkx.x.x_xxx\Contents\Home\bin".
Using sublime text or another text editor that supports multiple file formats, create a file named eToken.cfg in the bin folder with the following content as shown below.
Save the eToken.cfg in the bin folder.
Right-click the bin folder, and click Get Info.
Click the padlock at the bottom right, then change the permissions so you can read and write on that folder.
Open the terminal and then navigate to the jdkx.x.x_xxx\bin directory where jarsigner.exe, keytool.exe, and the eToken.cfg file you created are located.
Confirm your certificate alias with the terminal command:
keytool -list -keystore NONE -storetype PKCS11 -providerclass sun.security.pkcs11.SunPKCS11 -providerArg eToken.cfg
Enter your keystore passphrase (token password) when prompted.
Sign the JAR file using the following command:
jarsigner -tsa http://timestamp.globalsign.com/tsa/r45standard -storetype PKCS11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg eToken.cfg /directory/test.jar "certificateAlias"
Enter your keystore passphrase (token password) when prompted. Wait for the output, "jar signed".
Verify the signature by using the following command:
jarsigner -verify -verbose /directory/test.jar
You should be getting an output similar to the image below with "jar verified" at the end.
Check your certificate installation for SSL issues and vulnerabilities.