Keytool生成SHA1指纹而不是MD5?

时间:2012-03-11 10:14:31

标签: java android md5 sha1 keytool

我想在我的应用程序中使用Google地图,我已按照this教程生成了eventappkey.keystore的MD5指纹。但keytool生成SHA1指纹而不是MD5,因此我无法注册Google Api,因为谷歌接受密钥库的MD5指纹。

Command line snapshop (Window 7)

我看过其他建议使用jdk1.6的答案。但有没有更好的方法,所以我不需要转移到jdk1.6。任何建议都将不胜感激。

3 个答案:

答案 0 :(得分:20)

如果在命令行中添加-v(详细)选项,例如

keytool -v -list -alias alias_name -keystore my-release-key.keystore

它应该显示MD5指纹

答案 1 :(得分:2)

如果使用android studio,则使用此方法:

enter image description here

答案 2 :(得分:1)

Syntax:

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

Example:


C:\Program Files\Java\jdk1.7.0_71\bin>keytool -list -v -keystore c:\users\your_u
ser_name\.android\debug.keystore -alias androiddebugkey -storepass android -keyp
ass android
keytool error: java.lang.Exception: Keystore file does not exist: c:\users\your_
user_name\.android\debug.keystore
java.lang.Exception: Keystore file does not exist: c:\users\your_user_name\.andr
oid\debug.keystore
        at sun.security.tools.KeyTool.doCommands(KeyTool.java:738)
        at sun.security.tools.KeyTool.run(KeyTool.java:340)
        at sun.security.tools.KeyTool.main(KeyTool.java:333)

C:\Program Files\Java\jdk1.7.0_71\bin>keytool -list -v -keystore C:\Users\sriniv
as\.android\debug.keystore -alias androiddebugkey -storepass android -keypass an
droid
Alias name: androiddebugkey
Creation date: Apr 8, 2015
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 4e7c69e7
Valid from: Wed Apr 08 15:17:20 IST 2015 until: Fri Mar 31 15:17:20 IST 2045
Certificate fingerprints:
         MD5:  9D:C3:05:CB:FF:CA:06:31:8C:FC:FE:44:6C:94:BC:90
         SHA1: 2F:88:EF:9D:1B:3E:35:87:18:7D:56:B5:95:83:9A:EF:C1:B3:25:B4
         SHA256: 0F:D2:BC:2C:58:1B:16:3D:E3:5C:76:7D:C3:49:3A:A0:9D:95:4E:3E:6B:
71:0B:F7:2B:23:72:54:B8:57:62:A2
         Signature algorithm name: SHA256withRSA
         Version: 3