سؤال

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

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????

هل كانت مفيدة؟

المحلول

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.

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

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top