-
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: 1 comment 6 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.
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: