Android Question Keystore - key associated with b4a not a private key


Licensed User
Longtime User
During creating secondary google keystore key, I replaced it in b4a IDE without mining for password of original key. I was thinking that this is project related, and saved within one project because it's easily visible in IDE. I have no copy of password, later on I tried brute force and "smart dictionary brute force", but nothing helped so far.

Then on a copy of keystore file I changed password with method like this ..

When I load it into b4a IDE and give it new password, pressing ok on "private sign key" dialog accepts them, and all looks ok.

But on compilation I get following error:
jarsigner: key associated with b4a not a private key

I tried "clean project" option, but result is same ..

Key signature in mentioned dialog of b4a IDE looks like this (some values for this post I replaced with xxx, others are original):

Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: b4a
Creation date: 12.12.2013.
Entry type: PrivateKeyEntry
Certificate chain length: 1
Owner: CN=xxx, O=NoOrg, C=HR
Issuer: CN=xxx, O=NoOrg, C=HR
Serial number: xxx
Valid from: Thu Dec 12 20:26:18 CET 2013 until: Thu Apr 11 21:26:18 CEST 2052
Certificate fingerprints:
Signature algorithm name: SHA1withDSA
Version: 3
#1: ObjectId: Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 22 3E DA 00 9E 31 6E C4 A0 F6 52 5C 5A B3 E3 36 ">...1n...R\Z..6
0010: 62 BC 95 E0 b...

What seams to be a problem, why it says that this is not private key?


Licensed User
Longtime User
You will not be able to use the key if you don't remember the password.

I'm aware of that, but as I sad .. I changed password of keystore file with specified tool, and b4a IDE is accepting keystore file and by "decryption" of it I return info like quote above. Only by compilation of my application i get error "key associated with b4a not a private key". I'm curious why this message happens. Is keystore file changed more than just password?
Upvote 0


Active Member
Licensed User
Longtime User
Hi, I'm getting the same error when I tried to import old key from existing published app to use with b4a.

I used following command to create a new keystore compatible with b4a:
keytool -importkeystore -srckeystore play.keystore -destkeystore b4a.keystore -srcalias alias -destalias b4a

When I select b4a.keystore as sign key file and give correct password, b4a is able to show me details of the key.
However, I get the error 'jarsigner: key associated with b4a not a private key' when I try to compile.

What could be going wrong?

FYI: I had created the old one using this command:
keytool -genkey -v -keystore play.keystore -alias alias -keyalg RSA -keysize 2048 -validity 10000

Update 1: With above command, key password was still different from keystore password. On changing key password to be same as keystore password (Using -destkeypass option), the error I get is:
jarsigner error: private key algorithm is not compatible with signature algorithm.

Update 2: Above error is due to my key being signed with SHA256withRSA, whereas B4A supports only SHA1withDSA. I don't think keys can be converted across, so the only options are:
1) B4A supports other algorithms
2) Use a batch file to sign apks externally
Last edited:
Upvote 0


Active Member
Licensed User
Longtime User
I created them before I knew about B4A :)

I have some apps built using Eclipse, signed with non-B4A certificates and published.
I was planning to re-write them using B4A.
Upvote 0