0
votes

I'm not able to create hash key for Facebook login for my Android app.
According to the app documentations

Create a hash key for your certificate using the following command: keytool -exportcert -alias alias -keystore path | openssl sha1 -binary | openssl base64
I don't know where I went wrong
Here is what I get in command prompt:
 C:\Program Files\Java\jre7\bin>keytool -exportcert -alias debug.keystore -keystore ~/Desktop/debug.keystore | openssl sha1 -binary | openssl base64
WARNING: can't open config file: /etc/ssl/openssl.cnf
WARNING: can't open config file: /etc/ssl/openssl.cnf
pDmXQEAGdXS9sowPer3hqJqF17E=

C:\Program Files\Java\jre7\bin>

1
Does ~/Desktop/debug.keystore work on windows?Saeid

1 Answers

0
votes

First you have to download OpenSSL from here and unzip the content inside the folder C:\OpenSSL.

To obtain the keytool alias run the following command in cmd:

keytool -list -keystore .keystore

Now you can run the following command to get the Hash Key:

keytool -exportcert -alias <YOUR_KEYSTORE_ALIAS> -keystore <KEYSTORE_PATH> | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64

Summarizing, the command you are typing is wrong because instead of alias you are putting the keystore, in the keystore path you're missing the quotes and in the openssl you're not passing the openssl path.

Hope this solve your trouble. Regards.