导入证书时出错? [英] Error in importing Certificate?

查看:79
本文介绍了导入证书时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

keytool -genkey -keyalg RSA -dname "cn=rahul,ou=OU,o=DEV,c=IN" -alias rahul12 -keypass rahul12 -keystore rahul12.jks -storepass rahul12 -validity 366

keytool -certreq -keyalg RSA -alias rahul12 -keypass rahul12 -keystore rahul12.jks -storepass rahul12 -file rahul12.cert

keytool -import -alias rahul12 -file rahul12.cert -keystore rahul_adapter -storepass rahul_adapter

在第一条命令中,我正在生成密钥库,在第二条命令中,我正在生成证书,在第三步中,我将该证书导入rahul_adapter(通用密钥库)中.导入时给出错误 java.lang.Exception:输入的不是X.509证书.有人可以告诉我为什么收到此错误.如何解决该错误并且我还需要证书CSR(证书签名请求)格式而不是其他任何格式怎么做,请帮帮我吗????

In 1st command i am generating KeyStore, In 2nd command i am generating certificate and in 3rd step i am importing that certificate in rahul_adapter(universal keystore) . While importing it is giving Error java.lang.Exception: Input not an X.509 certificate.Can anybody tell me why i am getting this error.How to resolve that error and i also need certificate should be in CSR(Certificate Signing Requests) format not in any other format how to do that please help me????

推荐答案

答案很明显-第二步正在生成CSR,并将其导入到键盘锁中.

The answer to this is quite obvious - a CSR is being generate in the second step, and the same is being imported into the keytsore.

CSR与证书不同,必须使用它来从证书颁发机构获取实际的证书.

A CSR is not the same as a certificate, and it must be utilized to obtain the actual certificate from a certificate authority.

顺便说一句,如果这是您要设置的开发环境,那么最好使用自签名证书.此外,使用JDK 6作为 keytool的genkeypair选项.在JDK 6中会自动创建一个私钥和一个公钥(带有X.509证书),可以使用exportcert选项将其导出.

By the way, if this is a development environment that you are trying to setup, you are better off using self-signed certificates. Moreover, use JDK 6, as the genkeypair option of keytool in JDK 6 automatically creates a private key and a public key (with a X.509 certificate), which can be exported using the exportcert option.

这篇关于导入证书时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆