0

I'm trying to generate key hash for Facebook. I have installed openssl and also registered my app on Facebook. For generating the key hash, I'm using following command.

C:\Program Files\Java\jdk1.6.0\bin>keytool -exportcert -alias androiddebugkey -keystore C:\Documents and Settings\User\.android\debug.keystore|C:\OpenSSL\bin shal -binary|openssl base64

Which is giving me this response:

'C:\OpenSSL\bin' is not recognized as an internal or external command, operable program or batch file.

What does the error message mean and how can I fix the problem?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
android
  • 386
  • 1
  • 8
  • 21
  • i've created a tool for that, check this out : http://stackoverflow.com/a/17732453/2226605 up vote my answer if i helped you. – Shahar Apr 30 '14 at 21:50

3 Answers3

1

You can download and install openSSL from: http://slproweb.com/products/Win32OpenSSL.html

In my case OpenSSL was not installed properly due to some dependencies and I faced the same issue. Solution: Find the directory in which openSSL is extracted (in my case -- C:\OpenSSL-Win64)

and use the command with absolute path to openSSL

keytool -exportcert -alias androiddebugkey -keystore C:\Users\nnagella\.android\debug.keystore | C:\OpenSSL-Win64\bin\openssl sha1 -binary | C:\OpenSSL-Win64\bin\openssl base64
Nishanth
  • 1,801
  • 21
  • 25
0

The key part of the first command for the error message is:

|C:\OpenSSL\bin shal -binary|openssl base64

The first | means the output of the previous command (which may also have problems) should be fed to C:\OpenSSL\bin, but the shell is complaining that C:\OpenSSL\bin is not an executable - it is most likely a directory.

Maybe that should read:

| C:\OpenSSL\bin\sha1 -binary | C:\OpenSSL\bin\openssl base64

Your first command segment may also have problems:

C:\Program Files\Java\jdk1.6.0\bin>keytool -exportcert ...

That > should probably be a backslash:

C:\Program Files\Java\jdk1.6.0\bin\keytool -exportcert ...
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
0

You do not need to install openSSL. Just unzip and store it in C drive.Make a copy of your debug.keystore and store it in another drive. Say D drive. Try this

C:\Program Files\Java\jdk1.6.0\bin>keytool -exportcert -alias androiddebugkey -keystore "D:\NewFolder\debug.keystore"|"C:\OpenSSL\openssl--0.9.8k_WIN32\bin\openssl" shal1 -binary"|"C:\OpenSSL\openssl--0.9.8k_WIN32\bin\openssl" base64

Ensure your change your OPENSSL version. Mine was 0.9.8 yours might be different

Rashmi.B
  • 1,787
  • 2
  • 18
  • 34