Fix 'missing provider' exception for KeyStoreTypes which do not have specific provider#317
Open
ls-bit wants to merge 1 commit intoebourg:masterfrom
Open
Fix 'missing provider' exception for KeyStoreTypes which do not have specific provider#317ls-bit wants to merge 1 commit intoebourg:masterfrom
ls-bit wants to merge 1 commit intoebourg:masterfrom
Conversation
…specific provider e.g. using PKCS#12 keystore for signing
Owner
|
Thank you for the PR. How did you trigger this error? |
Author
|
For context, I was testing to integrate Jsign and marketplace-zip-signer. For that, I made changes to marketplace-zip-signer in my fork to allow passing the provider class and arg here https://github.com/ls-bit/marketplace-zip-signer/pull/1/files Then I ran following command: java -cp marketplace-zip-signer-cli.jar:jsign.jar org.jetbrains.zip.signer.ZipSigningTool sign \
-in test.zip \
-out signed.zip \
-ks NONE \
-ks-pass changeit \
-ks-provider-class net.jsign.jca.JsignJcaProvider \
-ks-provider-arg example.p12 \
-cert example.crt \
-ks-key-alias test \
-ks-type pkcs12 \
-ks-provider-name JsignFull stacktraceException in thread "main" java.lang.IllegalArgumentException: missing provider at java.base/sun.security.jca.GetInstance.getService(GetInstance.java:96) at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:218) at java.base/java.security.Signature.getInstance(Signature.java:449) at net.jsign.jca.JsignJcaProvider$JsignJcaSignature.engineInitSign(JsignJcaProvider.java:204) at java.base/java.security.Signature$Delegate.tryOperation(Signature.java:1322) at java.base/java.security.Signature$Delegate.chooseProvider(Signature.java:1276) at java.base/java.security.Signature$Delegate.engineInitSign(Signature.java:1360) at java.base/java.security.Signature.initSign(Signature.java:636) at org.jetbrains.zip.signer.signing.DefaultSignatureProvider.sign(DefaultSignatureProvider.kt:16) at org.jetbrains.zip.signer.signing.SigningKt.generateSignatureOverData(Signing.kt:41) at org.jetbrains.zip.signer.signing.SigningKt.generateSignerBlock(Signing.kt:27) at org.jetbrains.zip.signer.signing.ZipSigner.sign(ZipSigner.kt:81) at org.jetbrains.zip.signer.signing.ZipSigner.sign(ZipSigner.kt:31) at org.jetbrains.zip.signer.ZipSigningTool.sign(ZipSigningTool.kt:81) at org.jetbrains.zip.signer.ZipSigningTool.main(ZipSigningTool.kt:32)I will say that there is a non-zero chance that I am doing something wrong or that I got the implementation wrong |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of the KeyStoreTypes like PKCS12 do not seem to return a provider which lead to the exception below. This small patch seems to fix it.