简体   繁体   English

无法导入.p12密钥库

[英]Unable to import .p12 keystore

I created a .p12 keystore using openssl from a pkcs8 keystore. 我使用来自pkcs8密钥库的openssl创建了一个.p12密钥库。 Now I'm trying to import the private key using java Keytool into a new JKS keystore. 现在我正在尝试使用Java Keytool将私钥导入到新的JKS密钥库中。 I tried the command: 我试过这个命令:

keytool -importkeystore -srckeystore newKS.p12 -srcstoretype pkcs12 -srcstorepass pass -destkeystore exportedJks.jks -deststoretype jks -deststorepass pass keytool -importkeystore -srckeystore newKS.p12 -srcstoretype pkcs12 -srcstorepass pass -destkeystore exportedJks.jks -deststoretype jks -deststorepass pass

But I get the following error message: 但是我收到以下错误消息:

keytool error: java.security.UnrecoverableKeyException: Get Key failed: EC KeyFactory not available keytool错误:java.security.UnrecoverableKeyException:获取密钥失败:EC KeyFactory不可用

How can I resolve this error so I can import this key into a new JKS keystore? 如何解决此错误,以便将此密钥导入新的JKS密钥库?

The error message means that the Java runtime could not find a crypto provider for ECC (elliptic curve cryptography) algorithms. 错误消息表示Java运行时无法找到ECC(椭圆曲线加密)算法的加密提供程序。

Java 6 contains only basic support for ECC: It knows the OIDs of most EC algorithms and therefore knows that it must find an "EC KeyFactory". Java 6仅包含对ECC的基本支持:它知道大多数EC算法的OID,因此知道它必须找到“EC KeyFactory”。 However, by default no provider is installed that can handle these algorithms. 但是,默认情况下,没有安装可以处理这些算法的提供程序。

The SunEC provider with full ECC support was added in Java 7, so the easiest solution for this problem is to use keytool from a Java 7 or 8 runtime. 在Java 7中添加了具有完全ECC支持的SunEC提供程序 ,因此针对此问题的最简单的解决方案是使用来自Java 7或8运行时的keytool。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM