ssl - How to create a certificate chain using keytool? -


i want create certificate chain in java follows:

ca.mycompany.com |--asia.mycompany.com    |--india.mycompany.com 

where ca.mycompany.com root certificate (self signed).

i know possible openssl. possible to achieve keytool?

if not, can achieve mozilla nss library?

there example in keytool documentation shows how this:

keytool -genkeypair -keystore root.jks -alias root -ext bc:c keytool -genkeypair -keystore ca.jks -alias ca -ext bc:c keytool -genkeypair -keystore server.jks -alias server  keytool -keystore root.jks -alias root -exportcert -rfc > root.pem  keytool -storepass <storepass> -keystore ca.jks -certreq -alias ca | keytool -storepass <storepass> -keystore root.jks -gencert -alias root -ext bc=0 -rfc > ca.pem keytool -keystore ca.jks -importcert -alias ca -file ca.pem  keytool -storepass <storepass> -keystore server.jks -certreq -alias server | keytool -storepass <storepass> -keystore ca.jks -gencert -alias ca -ext ku:c=dig,keyencipherment -rfc > server.pem cat root.pem ca.pem server.pem | keytool -keystore server.jks -importcert -alias server 

you can generate certificate chains pretty keystore explorer:

  1. create new key pair, implies creating self-signed certificate (the root ca).
  2. right click on root ca certificate , select "sign new key pair", creates sub ca certificate , key pair.
  3. right click on sub ca certificate , select "sign new key pair" again.

signing new certificate

the resulting chain:

enter image description here


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -