How can I find my Signing Certificate Fingerprint (SHA1)

When setting up my client ID settings on the Google Developer Console, it prompted me to enter my ‘Signing Certificate Fingerprint (SHA1)’.

Where can I find this signing certificate fingerprint?

Also,
I’ve been working under the assumption that this is the same as the Keystore you create under Publishing Settings.
Is this correct?
I’ve successfully created a keystore, but I have no idea how to view it.

Thank you for any help!

2 Likes

about what client ID are you talking about? For configuring Google Play Services?

Edit:

To get the release certificate fingerprint:

keytool -exportcert
-alias
-keystore
-list -v
To get the debug certificate fingerprint:
keytool -exportcert
-alias androiddebugkey
-keystore
-list -v

reference: Como configurar os serviços relacionados a jogos do Google Play  |  Serviços relacionados a jogos do Google Play  |  Google for Developers

I don’t know enough to understand that list of steps.
However, I got it working. I didn’t realize you had to have an apk of the game uploaded when you were authorizing the app on the google developer console. As soon as I uploaded an apk, the developer console filled in the SHA1 automatically

3 Likes

The following steps worked for me.

In the Unity editor open File → Build Settings.
Open Player Settings and in the inspector open the Publishing Setting tab.
Click on Create new keystore, then Browse keystore.
Save the file that is created, it should be in your project folder.
Enter a password.
In the Alias dropdown, create a new key.
Fill in the form that pops up.

Next, search your computer for keytool.exe.
Open a terminal window in keytool’s folder and type the commands.

For example:

keytool -exportcert -alias examplealias -keystore D:\mygames\mygame\user.keystore -list -v.

You’ll be asked for the password.

This should print the info to the console.

Hope this helps.

29 Likes

you can try acareddit: How to get Signing-certificate fingerprint (Android keystore)

7 Likes

If you end up having an issue with this, make sure none of the folders in your directory string have a space, or you will get command prompt errors. I just ran into this problem, removed the space, and everything works~

1 Like

C:\Users\dell>cd C:\Program Files\Java\jdk1.8.0_181\bin

C:\Program Files\Java\jdk1.8.0_181\bin>keytool -list -keystore C:\Users\dell\Desktop\Test\KeyStore.keystore

5 Likes

Just a little sharing of what I faced. I was able to trace the file and open it but when opening the file, it asked me for password which I was typing but nothing was shown on terminal at all. So I thought if password is not being typed. But this was being typed! and when I hit enter, the SHA1 was shown.

Thanks for this

1 Like

Thank you! :slight_smile:

Here is our tutorial on how to get the SHA fingerprint for authenticating Google play services.
Note that, the SHA fingerprint keeps changing based on the keystore you use.
If you build your apk/aab in

  1. Debug/Development mode : Default debug.keystore will be used
  2. Release mode: The keystore you set in the unity inspector will be used
  3. Production/Google Play : The apk downloaded from the google play has its own keystore and you can find the sha fingerprint in App Signing section.

How many SHA fingerprints I need to add for successful authentication?

It’s always handy to add multiple sha’s from different build modes as it helps to test locally instead of always downloading from play store.

Alternatively, if you have the apk with you, you can quickly check the sha of it with below command

keytool -printcert -jarfile PATH_TO_APK
1 Like

Thanks for this! I was about to give up haha then I found this old post, magic

For anybody having this problem download KeyStore Explorer. You can open up your key with the pass, double click it to view certificates. I stumbled on this and it was a life saver, hope it helps someone else

5 Likes

It really helped, THANKS

For anyone still having trouble with it just write this into command promt
keytool -alias (your alias) -keystore (your keystore file directory) -list -v

and its gonna fail if there is any spaces in any of the directories

2 Likes

thank you so much, it works!!

When I do this I only get a respons that “keytool error: java.lang.Exception: Only one command us allowed: both -exportcert and -list were specified”

Try this

keytool -exportcert -keystore YOUR_KEY_STORE_PATH -list -v

Example

keytool -exportcert -keystore essentialkit.keystore -list -v

If you already have your apk with you, you can give a try with below

keytool -printcert -jarfile PATH_TO_APK
1 Like