Openssl is not recognized as an internal or external command
I wish to generate an application signature for my app which will later be integrated with Facebook. In one of Facebook's tutorials, I found this command:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
In the tutorial, it says that by running this cmd, my process of generating the signature will start.
However, this command gives an error:
openssl is not recognized as an internal or external command
How can I get rid of this?
Well at the place of openssl ... you have to put actually the path to your openssl folder that you have downloaded. Your actual command should look like:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | "C:\Users\abc\openssl\bin\openssl.exe" sha1 -binary | "C:\Users\abc\openssl\bin\openssl.exe" base64
Remember, path that you will enter will be the path where you have installed the openssl...hope this helps..:-)
Edit:
you can download openssl for windows 32 and 64 bit from the respective links below:
OpenSSL for 64 Bits
OpenSSL for 32 Bits
Use the entire path, like this:
exportcert -alias androiddebugkey -keystore ~/.android
/debug.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\op
enssl.exe" base64
It worked for me.
Please follow these step, I hope your key working properly:
Step 1 You will need OpenSSL. You can download the binary from openssl-for-windows project on Google Code.
-
Step 2 Unzip the folder, then copy the path to the
bin
folder to the clipboard.For example, if the file is unzipped to the location
C:\Users\gaurav\openssl-0.9.8k_WIN32
, then copy the pathC:\Users\gaurav\openssl-0.9.8k_WIN32\bin
. -
Step 3 Add the path to your system environment path. After your
PATH
environment variable is set, open the cmd and type this command:C:\>keytool -exportcert -alias androiddebugkey -keystore [path to debug.keystore] | openssl sha1 -binary | openssl base64
Type your password when prompted. If the command works, then you will be shown a key.
This is worked for me successfully.
"C:\Program Files\Java\jdk1.6.0_26\bin\keytool.exe" -exportcert -alias sociallisting -keystore "D:\keystore\SocialListing" | "C:\cygwin\bin\openssl.exe" sha1 -binary | "C:\cygwin\bin\openssl.exe" base64
Be careful with below path :
- "C:\Program Files\Java\jdk1.6.0_26\bin\keytool.exe"
- "D:\keystore\SocialListing" or it can be like this "C:\Users\Shaon.android\debug.keystore"
- "C:\cygwin\bin\openssl.exe" or can be like this C:\Users\openssl\bin\openssl.exe
If command successfully work then you will see this command :
Enter keystore password : typeyourpassword
Encryptedhashkey**