Home » Android » android – SHA-1 fingerprint of keystore certificate

android – SHA-1 fingerprint of keystore certificate

Posted by: admin March 10, 2020 Leave a comment


Is the method for getting a SHA-1 fingerprint the same as the method of getting the a fingerprint? Previously, I was running this command:

Windows Command Prompt running keytool.exe

It’s not clear to me if the result I’m getting is the SHA-1 fingerprint. Can somebody clarify this?

How to&Answers:

Follow this tutorial for creating SHA1 fingerprint for Google Map v2

For Debug mode:

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

for Release mode:

keytool -list -v -keystore {keystore_name} -alias {alias_name}


keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test

On windows, when keytool command is not found, Go to your installed JDK Directory e.g. <YourJDKPath>\Java\jdk1.8.0_231\bin\, open command line and try the above commands for debug/release mode.


If you are using android studio use simple step

  1. Run your project
  2. Click on Gradle menu
  3. Expand Gradle Tasks tree
  4. Double click on android -> signingReport and see the magic
  5. It will tell you everything on the Run tab

enter image description here

Result Under Run Tab If Android Studio < 2.2
enter image description here

From android studio 2.2
Result will be available under Run console but use highlighted toggle button

enter image description here

Second Way is
Create new project in android studio New -> Google Maps Activity

enter image description here

then open google_maps_api.xml xml file as shown in pics you will see your SHA key

enter image description here


Easiest way for getting SHA1 Key in android studio both (Debug and release Mode)

  1. Open Android Studio
  2. Open Your Project
  3. Click on Gradle (From Right Side Panel, you will see Gradle Bar)
  4. Click on Refresh (Click on Refresh from Gradle Bar , you will see List Gradle scripts of your Project)
  5. Click on Your Project (Your Project Name form List)
  6. Click on Tasks/Android
  7. Double Click on signingReport (You will get SHA1 and MD5 in Run Bar)

If you are using new Android Studio it shows time to execute on top there is Toggle task execution mode click on that you will get you SHA-1 key. Check 2nd and 3rd reference images.

Check image for details
enter image description hereenter image description here

Generate SHA-1 for Release Mode

1-First add keystore config in your gradle How to add config in gradle.

2-After Adding Config in gradle change build variant. enter image description here

3-Then Follow Above Procedure you will get SHA-1 for release mode.

4-Check Image. enter image description here


Go to your java bin directory via the cmd:

C:\Program Files\Java\jdk1.7.0_25\bin>

Now type in the below comand in your cmd:

keytool -list -v -keystore "c:\users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android 


If you are using eclipse, go to:
You will find what you are looking there.

enter image description here


![Go to far left[![][1][1]

Please refer to the following images and get the SHA-1 key

View in console panel at bottom


Run the following command to get your sha1: keytool -v -list -keystore "< debug.keystore path >"
If you do not know the path of debug.keystore, you may find your debug.keystore path by checking windows-->preferences-->android-->build

I prepared step by step tutorial to show how you can use google map android v2 on emulator(android 4.2.2)
have a look at to my blog: http://umut.tekguc.info/en/content/google-android-map-v2-step-step


I saw lots of posts about this issue, so I will keep it simple + examples.

To get the SHA1 for ClientID for Sign In with Google+ and more actions:

General Form:

keytool -list -v -keystore <your_keystore_full_path> -alias <your_alias_name>

For Debug, replace with your debug.keystore path, for Example :

keytool -list -v -keystore C:\Users\DAVID\.android\debug.keystore -alias androiddebugkey

Password: android

For Release, replace with your keystore path and alias password, for Example :

keytool -list -v -keystore C:\ProjectsData\keystore\my-release-key.keystore -alias alias_name 

Password: Your alias password.


This is step by step process of what worked for me.

First run the app then follow steps below (also shown in screenshot)

  1. click signing report
  2. open gradle console dialog
  3. it should display your SHA-1 certificate number

enter image description here


from a Debug Keystore we can get the SHA1 value in Eclipse. Accessing from the menu:
Window -> Preferences -> Android -> Build

but it doesn´t work for a production Keystore.
enter image description here

So, to get the SHA1 value from a production Keystore go to:
Android Tools -> Export Signed Application Package. Follow the process for signing your apk and the SHA1 will showed as a certificate.

enter image description here


Simple Solution…

  1. Open your project into Android studio.
  2. Click on Gradle tab on right side. as below

enter image description here

follow the steps as below..
3. Expand :app module -> Tasks -> Android -> signing report.
enter image description here

  1. SHA-1 will generate.as shown in the console



Using Google Play app signing feature & Google APIs integration in your app?

  1. If you are using Google Play App Signing, don’t forget that release signing-certificate fingerprint needed for Google API credentials is not the regular upload signing keys (SHA-1) you obtain from your app by this method:

Upload signing certificate

  1. You can obtain your release SHA-1 only from App signing page of your Google Play console as shown below:-

If you use Google Play app signing, Google re-signs your app. Thats how your signing-certificate fingerprint is given by Google Play App Signing as shown below:

App Signing page - Google Play Console

Read more How to get Release SHA-1 (Signing-certificate fingerprint) if using ‘Google Play app signing’


In Gnu/Linux


You need key.jks, for example in my case this file it’s in folder in /Desktop/Keys



cd /usr/lib/jvm/java-1.7.0-openjdk-amd64

Now you need excecute this command

keytool -list -v -keystore /PATH/file.jks -alias YourAlias -storepass *** -keypass ***

remplacing this fields


For example

 keytool -list -v -keystore /home/david/Desktop/Keys/key.jks -alias MyAlias -storepass 456 -keypass 123

enter image description here

Good Luck!!


First there is same .jar file that in fb-sdk android-support-v4.jar.
Then generate SHA1 key using:

PackageInfo info;
try {

    info = getPackageManager().getPackageInfo(
        "com.example.worldmission", PackageManager.GET_SIGNATURES);

    for (Signature signature : info.signatures) {
        MessageDigest md;
        md = MessageDigest.getInstance("SHA");
        String something = new String(Base64.encode(md.digest(), 0));
        Log.e("Hash key", something);
        System.out.println("Hash key" + something);

} catch (NameNotFoundException e1) {
    Log.e("name not found", e1.toString());
} catch (NoSuchAlgorithmException e) {
    Log.e("no such an algorithm", e.toString());
} catch (Exception e) {
    Log.e("exception", e.toString());


keytool is a key and certificate management utility. It allows users
to administer their own public/private key pairs and associated
certificates for use in self-authentication (where the user
authenticates himself/herself to other users/services) or data
integrity and authentication services, using digital signatures.

For Windows

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


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

Authorization on Android uses a SHA1 fingerprint and package name to identify your app instead of a client ID and client secret.

enter image description here



//the simplest way to get SHA1

//add following command to your terminal and hit enter

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


You can get MD5 and SHA1 fingerprint for any workspace by going to Window>Preference>Android>Build in Eclipse.


Best way ever with all steps:

For Release Keystore SHA1 Key:

  1. Open Command Prompt
  2. C:\Users\hiren.patel>cd..
  3. C:\Users>cd..
  4. C:\>cd "Program Files"
  5. C:\Program Files>cd Java
  6. C:\Program Files\Java>cd jdk_version_code
  7. C:\Program Files\Java\jdk_version_code>cd bin
  8. C:\Program Files\Java\jdk_version_code\bin>keytool -list -v -keystore "D:\Hiren Data\My Root Folder\My Project Folder\keystore_title.jks" -alias my_alias_name -storepass my_store_password -keypass my_key_password

Replace below thing:

  1. jdk_version_code
  2. D:\Hiren Data\My Root Folder\My Project Folder\keystore_title.jks
  3. my_alias_name
  4. my_store_password
  5. my_key_password



If you are using Android Studio IDE then you can get SHA1 has value for your all build variants with one click.

Under Gradle Projects Window > Select Root Project > signingReport > double click

File Navigation


Open Run Window

Go To Variant: release for release

Go To Variant: debug for debug



Open Command Prompt in Windows and go to the following folder .

C:\Program Files\Java\jdk1.7.0_05\bin

Use commands cd <next directory name> to change directory to next.
Use command cd .. to change directory to the Prev

Now type the following command as it is :

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


If you are using android studio use simple steps:

  • Run your project

  • Click on Gradle menu

  • Expand Gradle task tree

  • Click on android-> signingReport

enter image description here
If there is nothing displayed(android studio 2.2) then

Click on Toggle tasks execution/text mode from Run bar


enter image description here

Right side Gradle –> signing project get all keys


I am using Ubuntu 12.0.4 and I have get the Certificate fingerprints in this way for release key store on command prompt
after generate keystore file , you can use this key for released app ,if you are using google map in your app ,so this can show the map properly inside app after release,, i got the result on command prompt below

[email protected]:~$ keytool -list -v -keystore /home/administrator/mykeystore/mykeystore.jks -alias myprojectalias

Enter keystore password:  ******

Alias name: myprojectalias

Creation date: 22 Apr, 2014

Entry type: PrivateKeyEntry

Certificate chain length: 1
Owner: CN=xyz, OU= xyz, O= xyz, L= xyz, ST= xyz, C=91
Issuer: CN= xyz, OU= xyz, O= xyz, L= xyz, ST= xyz, C=91

Serial number: 7c4rwrfdff
Valid from: Fri Apr 22 11:59:55 IST 2014 until: Tue Apr 14 11:59:55 IST 2039

Certificate fingerprints:
     MD5:  95:A2:4B:3A:0D:40:23:FF:F1:F3:45:26:F5:1C:CE:86
     SHA1: DF:95:Y6:7B:D7:0C:CD:25:04:11:54:FA:40:A7:1F:C5:44:94:AB:90
     SHA276: 00:7E:B6:EC:55:2D:C6:C9:43:EE:8A:42:BB:5E:14:BB:33:FD:A4:A8:B8:5C:2A:DE:65:5C:A3:FE:C0:14:A8:02
     Signature algorithm name: SHA276withRSA
     Version: 2


 ObjectId: Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 1E A1 57 F2 81 AR 57 D6   AC 54 65 89 E0 77 65 D9  ..W...Q..Tb..W6.
0010: 3B 38 9C E1             

On Windows Platform we can get the keystore for debug mode by using the below way

C:\Program Files\Java\jdk1.8.0_102\bin>keytool -l
.android\debug.keystore -alias androiddebugkey -s
Alias name: androiddebugkey
Creation date: Oct 21, 2016
Entry type: PrivateKeyEntry
Certificate chain length: 1
Owner: C=US, O=Android, CN=Android Debug
Issuer: C=US, O=Android, CN=Android Debug
Serial number: 1
Valid from: Fri Oct 21 00:50:00 IST 2016 until: S
Certificate fingerprints:
         MD5:  86:E3:2E:D7:0E:22:D6:23:2E:D8:E7:E
         SHA1: B4:6F:BE:13:AA:FF:E5:AB:58:20:A9:B
         SHA256: 15:88:E2:1E:42:6F:61:72:02:44:68
         Signature algorithm name: SHA1withRSA


In Addition to Lokesh Tiwar’s answer

For release builds add the following in the gradle:

android {

//Goes here

    signingConfigs {
        release {
            storeFile file("PATH TO THE KEY_STORE FILE")
            storePassword "PASSWORD"
            keyAlias "ALIAS_NAME"
            keyPassword "KEY_PASSWORD"
buildTypes {
        release {
            zipAlignEnabled true
            minifyEnabled false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'


Now running the signingReport as in Lokesh’s Answer would show the SHA 1 and MD5 keys for the release builds as well.



If you are using Android studio this very simple.

Create a new Google map activity and you can see sha1 fingerprint like below image.

New Google Map aCTIVITY



First go to jar file copy the keytool path then add into system path then run.. i hope this one is worked..


If you are using Google Play App Signing, instead of getting the SHA from the keystore, an easier way is to go to the Google Play Console > Your app > Release Management > App signing and look for your upload certificate.

Screenshot of the page where you get this info


I had a problem during opening with command

[keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test]

Therefore, i download https://sourceforge.net/projects/portecle/.
Then just open .jks file from the jar program. it will show you all relevant information

snapshot of the program


For local you get easily sha1 from android studio but for live please check below url :

Facebook Android Generate Key Hash

We mostly not done below steps so please check the link which is 100% correct.

8) If you see in openssl Bin folder, you will get a file with the name of debug.txt

9) Now either you can restart command prompt or work with existing command prompt

10) get back to C drive and give the path of openssl Bin folder

11) copy the following code and paste

openssl sha1 -binary debug.txt > debug_sha.txt

12) you will get debug_sha.txt in openssl bin folder

13) Again copy following code and paste

openssl base64 -in debug_sha.txt > debug_base64.txt

14) you will get debug_base64.txt in openssl bin folder

15) open debug_base64.txt file Here is your Key hash.


At ANDROID STUDIO do the following steps:

  1. Click Gradle menu on the right side of your ANDROID STUDIO IDE
  2. Expand Tasks tree
  3. Clink on signingReport

You will be able to see the signature at the bottom of IDE