答案 0 :(得分:3)
我刚为Branch.io和Firebase做了这个。这正是我的MD5,SHA1和SHA256:
如果在Windows上,请导航到密钥库所在的文件夹。按住shift然后右键单击。你应该看到"打开命令提示符"在选项列表中。
当命令提示符打开时,键入以下内容,您将获得所需的一切:
keytool -list -v -keystore {yourkeystore}
然后它会要求输入密码。输入您的密码并按Enter键。然后,您将获得所有需要的信息。
SIDE NOTE
如果要保存信息以备将来使用,请右键单击并选择全选。点击进入,然后粘贴到您喜欢的文本编辑器中。使用您的密钥库保存它,以便您始终拥有该引用,以防您需要其他sdk' s / api。希望有所帮助。
如果在Windows上
按住Windows Home键并点击" X"。选择"系统"然后选择"高级系统设置"在左手侧。在弹出窗口中,单击环境变量。在系统变量部分下查找" JAVA HOME"如果没有,请单击“新建”。键入JAVA_HOME作为变量名称。为变量值输入以下内容:
C:\ Program Files \ Java \ jdk1.8.0_66
确保匹配您拥有的JDK版本
然后寻找" Path"变量并添加:
C:\ Program Files \ Java \ jre7 \ bin
确保它们与Java SDK和Runtime环境的位置匹配。然后,您将能够通过命令提示符从任何地方访问keytool。
答案 1 :(得分:0)
我认为您通过同时包含-exportcert
和-list
来混合两个单独的命令。我认为-exportcert
是你想要的。根据{{1}}:
man keytool
虽然紧随其后的是-exportcert
{-alias alias} {-file cert_file} {-storetype storetype} {-keystore keystore}
[-storepass storepass] {-providerName provider_name}
{-providerClass provider_class_name {-providerArg provider_arg}}
{-rfc} {-v} {-protected} {-Jjavaoption}
Reads from the keystore the certificate associated with alias and stores it in the
cert_file file. When no file is specified, the certificate is output to stdout.
The certificate is by default output in binary encoding. If the -rfc option is
specified, then the output in the printable encoding format defined by the Internet
RFC 1421 Certificate Encoding Standard.
If alias refers to a trusted certificate, then that certificate is output.
Otherwise, alias refers to a key entry with an associated certificate chain. In
that case, the first certificate in the chain is returned. This certificate
authenticates the public key of the entity addressed by alias.
This command was named -export in earlier releases. The old name is still supported
in this release. The new name, -exportcert, is preferred going forward.
的文档,但它是一个单独的命令,用于列出有关证书的信息,而不实际进行任何更改,导出任何内容等。