Lost keystore alias but have file and password used for alias
Asked Answered
C

6

35

recently I added a new alias to my keystore to sign my app.

Now I lost the new generated file with the alias, but remember the password and the alias name and have an older copy the file. Is there a way to recreate the alias using this things?

Crowning answered 21/11, 2013 at 11:27 Comment(3)
you mean new keystone you lost..Posting
More or less, yes. If there is no random component in the creation of the alias, i should be able to recreate it.Crowning
@Crowning So finally did you find the solution?Lingual
R
71

You can list the contents of your keystore with the command:

keytool -list -keystore <name of keystore file>

To do this, you will need to provide the keystore password (not the alias password). This will tell you the aliases in the file, which are self-contained, allowing you to sign. If you wish, you could also extract keys using other options / tools.

Rodrich answered 21/11, 2013 at 11:38 Comment(6)
I know the alias is not in the file. Now looking for a way to recreate it somehow.Crowning
Not possible. If it were possible, if I knew your alias name then I could fabricate your signing key to impersonate your signature. The password has no bearing on the contents of the alias, only on the extraction of the signing key for that alias within the keystore. To answer your comment above -- there is, and must be, a random component in the generation, for security needs.Rodrich
So the alias content is generated random?Crowning
The alias is simply a name to help you locate the key. The key is the magic sauce, which is randomly generated. The alias can be changed without any affect on the key... so yes. Isn't this how you would design a system if security were important? If not, there would be no cryptographic strength to the process.Rodrich
Works like a charm, I had the file and the password but required the alias! Thanks!Earwitness
Use verbose to extract the full key info keytool -list -v -keystore <name of keystore file>.Magistracy
T
42

Open your key store (.jks) file with text editor. It will display binary form of data. The readable text in the first line is your key alias.

For example, your key alias in the following binary data is the key alias.

þíþí your key alias UYY_ 0‚þ0 +* ‚êa÷í–ØRö}ðžá䶈ùÎL\ô©2‘wå¥H¨V †¸®Àµ£ð×þ7—â;TÁÙcsª”ž˜4ÝÉ'AÀì,’„×S¼ðßÅ'€Õ¡ó‚˜ ö!y’Çåx|(woÁh4u-û†‚‡§Qȸ|ˆ³”ÜæûZŽ²a±O­´¢^À.ªbÅ“e†6 É秮j§˜y ößÿØ0Çd@ /Ã?®¦ìé¼/§Zq””Ê•©„=~Ùì¢>º}DàO<Ö¹SbpÎŒ@Ø„°^Í^e»>¾ü«nM( "Nbûh·2ðÁ0¯ç¿61êè“[.ÇzeYŽºXkuÄy*ôq¥FSs]:2“ì

Terramycin answered 31/8, 2016 at 7:22 Comment(3)
you are a lifesaver!Snifter
You are a legend!!Upchurch
That's Perfect, it's 100% workingFuturistic
D
10

http://tim12332013.blogspot.tw/2014/10/corona-sdk-android-keystore-lost-alias.html

look it may help you

keytool -list -v -keystore X:/XXXX /XXXX.keystore -storepass XXXX

Docent answered 14/10, 2014 at 3:25 Comment(1)
great answer ! helped me a lot !Prosaism
A
5

This worked for me:

keytool -list -v -keystore "file address"

Copy your alias name and TaDa!!!

Almeida answered 6/6, 2021 at 8:11 Comment(1)
you're a magician 😁 👍Phebe
H
1

The default alias in latest android studio version is "key0". You can try this if you haven't changed your alias value.

Holy answered 28/1, 2019 at 10:10 Comment(0)
F
0

This worked for me :

keytool -list -v -keystore "C:\Users\YourName\Path\To\my-release-key.keystore" -storepass yourpassword 

Make sure enclose the entire keystore path within double quotes""

Festoonery answered 23/2 at 15:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.