如何检查证书名称和别名在密钥库文件? [英] How to check certificate name and alias in keystore files?
问题描述
我有一堆的.keystore文件,并需要找到一个具体的CN和别名。有没有办法用密钥工具的jarsigner或其他一些工具,做吗?我找到了一种方法来检查,如果特定的密钥库用于签署特定的APK,但我还需要获得每个文件的别名和证书名称。
I have a bunch of .keystore files and need to find one with specific CN and alias. Is there a way to do it with keytool, jarsigner or some other tool? I found a way to check if specific keystore was used to sign a specific apk, but I also need to get the alias and certificate name in each of the files.
推荐答案
您可以运行下面的命令列出密钥存储文件的内容:
You can run the following command to list the content of your keystore file:
keytool -list -keystore .keystore
如果你正在寻找一个特定的别名,你也可以在命令中指定的:
If you are looking for a specific alias, you can also specify it in the command:
keytool -list -keystore .keystore -alias foo
如果没有找到别名,它会显示一个异常:
If the alias is not found, it will display an exception:
keytool的错误:java.lang.Exception的:别名不存在
keytool error: java.lang.Exception: Alias does not exist
这篇关于如何检查证书名称和别名在密钥库文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!