使用命令行中的 keytool,我向商店添加了一个新证书。但是我发现自己目前使用的令人愤怒的窗口管理器在剪切和粘贴方面失败了,并用 ? 替换了别名的一个字符。特点。如何更改或删除该别名?
keytool -list -keystore truststore
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 4 entries
hail.ucc.nau.edu:8636-cert-1?, Dec 1, 2017, trustedCertEntry,
......
keytool -delete -keystore truststore -alias 'hail.ucc.nau.edu:8636-cert-1?'
Enter keystore password:
keytool error: java.lang.Exception: Alias <hail.ucc.nau.edu:8636-cert-1?> does not exist
......
keytool -delete -keystore truststore -alias 'hail.ucc.nau.edu:8636-cert-1\?'
Enter keystore password:
keytool error: java.lang.Exception: Alias <hail.ucc.nau.edu:8636-cert-1\?> does not exist
......
keytool -delete -keystore truststore -alias 'hail.ucc.nau.edu:8636-cert-1'
Enter keystore password:
keytool error: java.lang.Exception: Alias <hail.ucc.nau.edu:8636-cert-1> does not exist
感谢您的帮助,
- rob.
最佳答案
您看到的特殊字符可能不是@Pavel Lechev 在评论中建议的实际字符。如果keytool
删除不起作用,您可以使用KeyStore Explorer软件来做到这一点。它有漂亮的 GUI,提供所有 keytool 功能。
或者您可以使用 KeyStore
api 编写一个小工具/类来删除不需要的别名。您可以列出所有别名,识别它并删除它(要识别别名,您可以执行 startsWith()
)。
关于keytool - 当别名包含异常字符(?)时,从信任库中删除证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47602504/