Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid keystore format. #48

Open
shayan4shayan opened this issue Apr 29, 2023 · 2 comments
Open

Invalid keystore format. #48

shayan4shayan opened this issue Apr 29, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@shayan4shayan
Copy link

shayan4shayan commented Apr 29, 2023

I'm trying to generate bin file using the command mentioned in readme file.

java -jar app/bundlesigner-0.1.13.jar genbin  -v --bundle app/bazaar/release/app-bazaar-release.aab --bin .  --v2-signing-enabled true --v3-signing-enabled false --ks ../release.jks

But I'm getting the following error that says the keystore file is invalid.
I don't know how it's invalid, cause I was able to generate bin file a month ago and there was nor problem at all.

Picked up _JAVA_OPTIONS: -Xmx1024M
Keystore password for signer #1: 
Failed to load signer "signer #1"
java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:666)
        at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:57)
        at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
        at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:71)
        at java.security.KeyStore.load(KeyStore.java:1445)
        at ir.cafebazaar.bundlesigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:364)
        at ir.cafebazaar.bundlesigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:250)
        at ir.cafebazaar.bundlesigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:183)
        at ir.cafebazaar.bundlesigner.BundleSignerTool.getSignerConfig(BundleSignerTool.java:448)
        at ir.cafebazaar.bundlesigner.BundleSignerTool.getContentDigest(BundleSignerTool.java:357)
        at ir.cafebazaar.bundlesigner.BundleSignerTool.main(BundleSignerTool.java:126)

java version

java -version
Picked up _JAVA_OPTIONS: -Xmx1024M
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.302-b08, mixed mode)

operation system: Windows 11

I'll be glad to provide any information necessary to find the cause and fix the problem.

@maze1377
Copy link
Collaborator

Based on my understanding of your issue, it seems that you are encountering problems with using a key generated by a newer version of Java when attempting to use an older version. To help address this, I suggest performing a local test by signing a sample application in our project using your current system and reporting any issues you encounter.

For your convenience, you can access the sample materials for local testing at the following link: Bundle Signer - Test Resources.

Please feel free to provide feedback and report any difficulties you face during the testing process. We'll be glad to assist you further.

@maze1377 maze1377 self-assigned this Sep 30, 2023
@maze1377 maze1377 added the question Further information is requested label Sep 30, 2023
@PuzzleTakX
Copy link

PuzzleTakX commented Jul 2, 2024

The warning you received indicates that your keystore was successfully converted to the JKS format, but it is recommended to migrate to the JKS format as it is an industry-standard format. Below are the steps to convert the keystore to the JKS format and use it:

Convert the keystore to JKS format:

If you want to convert the keystore to the JKS format, you can use the following command:

keytool -importkeystore -srckeystore key_name.jks -srcstoretype PKCS12 -destkeystore key_name.jks -deststoretype JKS

convert to pkcs12

keytool -importkeystore -srckeystore key_name.jks -destkeystore key_name.pkcs12 -deststoretype pkcs12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants