-
Install JDK
-
Jump into the JDK binary folder
cd C:\Program Files\Java\jdk-14.0.1\bin
-
Create a Java Signing Keystore with your existing .p12:
keytool -importkeystore -srckeystore c:\jarfiles\duff.p12 -srcstoretype pkcs12 -destkeystore c:\jarfiles\duff.jks -deststoretype JKS
-
Update the keystore if the previous command tells you to. It’ll say “The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using “keytool -importkeystore -srckeystore c:\jarfiles\duff.jks -destkeystore c:\jarfiles\duff.jks -deststoretype pkcs12”. Do that
keytool -importkeystore -srckeystore c:\jarfiles\duff.jks -destkeystore c:\jarfiles\duff.jks -deststoretype pkcs12
-
Confirm the Keystore alias because you’ll need it in the next command:
keytool -list -keystore c:\jarfiles\duff.jks -v
it’s right near the top of this output. Mine was “codesigningcert” as an example. -
Sign something to test:
jarsigner -tsa http://timestamp.digicert.com -keystore c:\jarfiles\duff.jks -storepass {PASSWORD} c:\jarfiles\myjar.jar codesigncert
-
Confirm it’s signed:
Verify: jarsigner -verify c:\jarfiles\myjar.jar -verbose -certs -strict
read