keytool错误:java.security.KeyStoreException:未找到DER

时间:2018-01-26 10:37:50

标签: java security ssl https keytool

您好我是SSL握手新手。我从浏览器下载了服务器证书并尝试使用keytool创建密钥库。我存储的证书作为.cer与der编码。但我正在追随

keytool error: java.security.KeyStoreException: DER not found

我尝试过以下命令

  keytool -importkeystore -v -srckeystore certificate.cer -srcstoretype DER- destkeystore avg_clientcerts.keystore.jks -deststoretype JKS -storetype JKS

并使用.der扩展名更改证书

keytool -importkeystore -v -srckeystore certificate.der -srcstoretype DER -destkeystore avg_clientcerts.keystore.jks -deststoretype JKS -storetype JKS

错误

keytool error: java.security.KeyStoreException: DER not found
java.security.KeyStoreException: DER not found
    at java.security.KeyStore.getInstance(KeyStore.java:851)
    at sun.security.tools.keytool.Main.loadSourceKeyStore(Main.java:2020)
    at sun.security.tools.keytool.Main.doCommands(Main.java:1074)
    at sun.security.tools.keytool.Main.run(Main.java:366)
    at sun.security.tools.keytool.Main.main(Main.java:359)
Caused by: java.security.NoSuchAlgorithmException: DER KeyStore not available
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
    at java.security.Security.getImpl(Security.java:695)
    at java.security.KeyStore.getInstance(KeyStore.java:848)
    ... 4 more

这就是我导入证书的方式

enter image description here

1 个答案:

答案 0 :(得分:1)

据我所知,您正在尝试将公共证书导入您的应用程序,以便在您尝试访问的服务器与您尝试访问的服务器之间进行安全通信通过全球CA,你可能不应该这样做,但似乎,它没有。

然后你应该做什么,而不是创建一个密钥库,而是将公钥导入你现有的密钥库。

简而言之,你的命令应该类似于以下内容。

python run.py
OpenCV Error: The function/feature is not implemented (The library is compiled without QT support) in displayOverlay, file /build/opencv/src/opencv-3.4.0/modules/highgui/src/window.cpp, line 528
Traceback (most recent call last):
  File "run.py", line 203, in <module>
    change_img_index(0)
  File "run.py", line 25, in change_img_index
    "" + str(last_img_index), 1000)
cv2.error: /build/opencv/src/opencv-3.4.0/modules/highgui/src/window.cpp:528: error: (-213) The library is compiled without QT support in function displayOverlay

here是关于此过程的详细解释