Mojiiz
Mojiiz

Reputation: 7958

How to get MD5 from debug.keystore file?

I use some command to get MD5 private key from debug.keystore file but actually I get SHA1 private key instead of MD5. I do not know how to get MD5.

This is command that I use.

keytool -list -alias androiddebugkey -keystore (path_to_debug_keystore).keystore -storepass android -keypass android

Upvotes: 31

Views: 38769

Answers (11)

Abhinav Saxena
Abhinav Saxena

Reputation: 2044

I saw that answer in the link:

How to get 'MD5' instance from keystore instead of 'SHA' ?

Reason being, in the other answers, the command line is used to get the SHA, MD5, but a program can elaborate to explicitly get the MD5 instance from a signature. In the above case, you are specifying SHA, hence you will get SHA only.

Happy Coding :-)

Upvotes: 0

Enzokie
Enzokie

Reputation: 7415

Make sure your are currently in jdk/bin in your terminal

For Linux or OS X, open a terminal window and enter the following:

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

For Windows Vista and Windows 7, run:

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

If you are successful in above step you will get:

Alias name: androiddebugkey
Creation date: Jan 01, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 4aa9b300
Valid from: Mon Jan 01 08:04:04 UTC 2013 until: Mon Jan 01 18:04:04 PST 2033
Certificate fingerprints:
     MD5:  AE:9F:95:D0:A6:86:89:BC:A8:70:BA:34:FF:6A:AC:F9
     SHA1: BB:0D:AC:74:D3:21:E1:43:07:71:9B:62:90:AF:A1:66:6E:44:5D:75
     Signature algorithm name: SHA1withRSA
     Version: 3

Upvotes: 2

user1252459
user1252459

Reputation: 563

If you are using Eclipse or ADT you can go to Preferences -> Android -> Build and there you will see your debug keystore MD5 and SHA1 fingerprints.

Upvotes: 2

Robby Pond
Robby Pond

Reputation: 73484

When I did it I used this.

keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android -v

Looks like your keystore file isn't correct.

Upvotes: 33

Mitul Goti
Mitul Goti

Reputation: 2619

This will help you definately. Please refer this screen shot.....

enter image description here

Upvotes: 2

Praveen
Praveen

Reputation: 51

Thanks everyone. Now i got my MD5 private key. I used JDK7. For your reference,

C:\Program Files\Java\jdk1.7.0\bin>keytool.exe -list -v -keystore "C:\Documents
and Settings\Administrator\.android\debug.keystore" -storepass android -keypass
android

Upvotes: 5

bebadbutneverbesad
bebadbutneverbesad

Reputation: 21

I had the same problem use java jdk6 not jdk7 ... work for me

Upvotes: 1

user1202032
user1202032

Reputation: 1479

You do not need to downgrade your jdk!

You should add '-v' to your keytool command, as already suggested.

keytool -list -v -keystore ~/.android/debug.keystore

This is because you are using jdk7 which, unlike jdk6, does not print the MD5 certificate fingerprint by default.

The android documentation does not mention this (as per postdate)

Upvotes: 22

rafaelrezend
rafaelrezend

Reputation: 1025

Try to simply add a -v to your command. Then you will get fingerprints in MD5, SHA1 and SHA256. The MD5 one should be accepted by Google API Signup. =)

Upvotes: 43

Mojiiz
Mojiiz

Reputation: 7958

Thanks for everyone. I can generate my MD5 private key. I know the some problem. If I use java version 7, I will get SHA1 but when I downgrade java version such as jdk1.6, I will also get MD5.

Upvotes: 0

Jorgesys
Jorgesys

Reputation: 126455

you have the right sintaxis, be sure where is your keystore file located...

this is my example:

keytool -list -alias androiddebugkey -keystore "C:\Documents and Settings\jorgesys\.android\debug.keystore" -storepass android -keypass android

and the result must be something like...

androiddebugkey, 25/09/2010, PrivateKeyEntry,
Certificate fingerprint (MD5):
32:46:AA:56:D9:71:8B:2A:0B:34:A1:B6:96:1E:87:59

if you don't remember your user and password you will create another keystore...

keytool -genkey -v -keystore "C:\android\gruporeforma.keystore" -alias gruporeforma -keyalg RSA -validity 10000

Upvotes: 3

Related Questions