我希望为我的应用程序生成一个应用程序签名,以后将与Facebook集成。在Facebook的一个教程中,我发现了这个命令:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

在教程中,它说通过运行这个cmd,我的生成签名的进程将开始。

但是,这个命令会给出一个错误:

openssl is not recognized as an internal or external command

我怎样才能摆脱这个?


当前回答

Steps to create Hash Key. 
1: Download openssl from Openssl for Windows . I downloaded the Win64 version 
2:Unzip and copy all the files in the bin folder including openssl.exe(All file of bin folder) 
3:Goto to the folder where you installed JDK for me it’s C:\Program Files\Java\jdk1.8.0_05\bin 
4:Paste all the files you copied from Openssl’s bin folder to the Jdk folder. 

然后进入C:\Program Files\Java\ jdk1.8.0_05\bin,按shift键,右键单击并打开cmd

C:\Program Files\Java\jdk1.8.0_05\bin>//cmd path 

这是给Sha1的 "C:\User\ABC\.android. keytool -exportcert -alias androiddebugkey -keystore "Keystore " | openssl sha1 -binary | openssl base64 . Keystore //和ABC是系统名放置自己的系统名

其他回答

对于那些想要安装windows二进制版本openssl(32位和64位)的人,你可以在这里找到它:

http://slproweb.com/products/Win32OpenSSL.html

提供二进制发行版的网站的最新列表在这里

http://www.openssl.org/related/binaries.html

对于那些像我现在一样迷路的人,请关注乌萨马·萨瓦尔的回应 但如果:

“your_openssl_path / bin / openssl.exe”

不管用,试试看

your_openssl_path / bin / openssl.exe。

没有引号。

“c:\openssl\bin\openssl.exe”=>不适合我

c:\openssl\bin\openssl.exe =>为我工作

如果你在windows上并且安装了git,那么你可以使用git Bash运行open ssl命令。

转到要存储密钥的目录 右键单击并打开GIT Bash 在这里,您可以运行任何openssl命令。如。 openssl enc -aes-128-cbc -k test -P -md sha1

这对我来说很成功。

“C:\Program Files\Java\jdk1.6.0_26\bin\keytool.exe” -exportcert -alias sociallist -keystore “D:\keystore\SocialListing” |“C:\cygwin\bin\openssl.exe” sha1 -binary |“C:\cygwin\bin\openssl.exe” base64

注意以下路径:

“C: \ Program Files \ Java \ jdk1.6.0_26 \ bin \ keytool.exe” “D:\keystore\SocialListing”或者可以是这样的“C:\Users\Shaon.android\debug.keystore” “C:\cygwin\bin\openssl.exe”或者可以像这样:C:\ users \openssl\bin\openssl.exe

如果命令成功工作,那么你将看到这个命令:

输入keystore密码:typeyourpassword

Encryptedhashkey * *

使用整个路径,像这样:

exportcert -alias androiddebugkey -keystore ~/.android
/debug.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\op
enssl.exe" base64

这对我很管用。