Anil Datt Blogs‎ > ‎

Importing SSH generated keys to weblogic DemoTrust java key store

posted Apr 23, 2013, 10:23 AM by Dathu Inc   [ updated Apr 23, 2013, 10:24 AM ]
java Keytool does not let you directly import the keys that are created using SSH-keygen into Java key store(.jks file).

Here are the steps to import it.

1. Convert the key to  X509 pem format

openssl req -new -x509 -key id_rsa -out id_pem

Answer the questions

into your certificate request.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
Country Name (2 letter code) [GB]:us
State or Province Name (full name) [Berkshire]:nj.................


.pem file is generated 

id_pem  id_rsa  known_hosts

2. Import the keys to weblogic demo trust store

    keytool -import -alias mykey -trustcacerts -file /home/dathu/.ssh/id_pem -keystore DemoTrust.jks

    Enter the password for the DemoTrust key store when prompted

    Trust this certificate? [no]:  yes
    Certificate was added to keystore