-
Hello, Following discussion #178, I'm trying to sign a JAR file with a key stored in a Google Cloud HSM, in a Windows environment. setlocal
@set GOOGLE_TOKEN=file:D:\Path\To\Signature\token
"%JAVA_HOME%\bin\jarsigner" -J-cp -JE:\Downloads\Prog\java\jsign-6.0.jar -J--add-modules -Jjava.sql ^
-providerClass net.jsign.jca.JsignJcaProvider ^
-providerArg projects/myproject/locations/europe/keyRings/TheKeyRing ^
-keystore NONE ^
-storetype GOOGLECLOUD ^
-storepass "%GOOGLE_TOKEN%" ^
-tsa $http://timestamp.entrust.net/TSS/RFC3161sha2TS ^
-digestalg SHA-256 ^
-tsadigestalg SHA-256 ^
-signedjar MyProject.signed.jar ^
-certchain "D:\Path\With spaces\to\public_key\Certificate_google_cloud.cer" ^
MyProject.jar ^
KeyName/cryptoKeyVersions/1 Where JAVA_HOME points to a java 11.0.24+8 installation. Sadly, this fails with the following message:
Yes, that's the entire error message, there is nothing after the "from" word. Looking around here or at large did provide any hint as to what I missed, but to me me it's like there is an empty parameter that I did not provide. Any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
Did you try with the latest snapshot ? https://github.com/ebourg/jsign/actions/runs/10063296846/artifacts/1731567034 |
Beta Was this translation helpful? Give feedback.
-
Hi, I am also trying to sign my jar file, faced exactly same issues as mentioned in this thread ("Failed to load certificate from"). Followed the solution proposed (just the alias name) and it indeed fixed the above issue. Below is the command that I used:
and it says:
I dint get the Now comes the problem: When I try to verify the signed jar, I get the below error:
@obones, have you tried verifying the jar after it was signed? @ebourg, any help would be really appreciated. Note: I am on Mac trying to sign a jar file and the jsign was downloaded by apache-maven in my pom.xml:
|
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the pointer. I will try reverting the order and get back
to you shortly.
…On Fri, Jul 4, 2025 at 12:23 PM Emmanuel Bourg ***@***.***> wrote:
Actually I think the issue is simply your $CODE_SIGNING_CERT file, try
reverting its order.
—
Reply to this email directly, view it on GitHub
<#246 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVRAEA5WBIZU6PMN5N47FPL3GYQGTAVCNFSM6AAAAACAWQ3BN6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNRVHE3TQMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
I just did, and it does not change the result.
However, I finally found what was wrong: Using the version alias!
If I give
KeyName/cryptoKeyVersions/1
as the last argument, I get the "Failed to load certificate from" error. But if I only giveKeyName
then it successfully signs the JAR.There are warnings, but I'm quite confident they don't come from your code: