Monday, February 10, 2014

Java keystore - Copy key from one keystore to another

One day you may need to isolate some of your key(s) to different keystore. Here is the command for it,

keytool -importkeystore -srckeystore mystore.jck -destkeystore myotherstore.jks -srcstoretype jceks -deststoretype jks -srcstorepass mystorepass -deststorepass myotherstorepass -srcalias myserverkey -destalias myotherserverkey -srckeypass mykeypass -destkeypass myotherkeypass

Here is my Scenario - Why I needed to do it? to be added..... :-)