如何检查密钥库文件中的证书名称和别名? [英] How to check certificate name and alias in keystore files?
问题描述
我有一堆 .keystore 文件,需要找到一个具有特定 CN 和别名的文件.有没有办法用 keytool、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 (and alias name):
keytool -v -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屋!