如何将现有的Java密钥库(.jks)文件导入Java安装? [英] How do I import an existing Java keystore (.jks) file into a Java installation?
问题描述
因此,我在使用LDAP时遇到了麻烦.我有一个集成测试用例,希望可以解决,但目前正在通过SSL握手遇到LDAPS安全问题.
So, I am having trouble with LDAP. I have an integration test case that hopefully will work out, but it is currently running into LDAPS security issues with the SSL handshake.
我能够使用Apache Directory Studio连接到LDAPS,并且它已将密钥库下载到文件"permanent.jks"中.
I am able to connect to the LDAPS with Apache Directory Studio, and it has downloaded the keystore into a file "permanent.jks".
可以,但是我希望我的集成测试能够使用此密钥库连接到LDAP服务器,该集成测试使用JRE驻留在Eclipse中.
That's ok, but I want my integration test, which resides in Eclipse using a JRE, to be able to connect to the LDAP server using this keystore.
如何获取此密钥库并将其导入到JRE中以供自己使用?
How can I take this keystore and import it into the JRE for its own use?
推荐答案
好的,这是我的过程:
keytool -list -v -keystore permanent.jks
-给我取别名.
keytool -export -alias alias_name -file certificate_name -keystore permanent.jks
-为我提供了导入证书.
keytool -export -alias alias_name -file certificate_name -keystore permanent.jks
- got me the certificate to import.
然后我可以使用键盘工具将其导入:
Then I could import it with the keytool:
keytool -import -alias alias_name -file certificate_name -keystore keystore location
正如@Christian Bongiorno所说,您的密钥库中不存在别名.
As @Christian Bongiorno says the alias can't already exist in your keystore.
这篇关于如何将现有的Java密钥库(.jks)文件导入Java安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!