I need to create a JKS keystore file on a secure domain (eg: https://example.com).
I am going to use this keystore file in my java netty-socketIO server side.
Configuration config = new Configuration();
config.setHostname("example.com");
config.setPort(3037);
config.setKeyStorePassword("password");
InputStream stream = new FileInputStream("C:/keystore.jks");
config.setKeyStore(stream);
I am not so sure what is the best way to create the jks file and what is needed for this one.
I am using windows vps for this java socket program.
Thanks in advance
You can use java's keytool tool. You should have java installed and the JDK bin folder in your PATH (if not run it from the JDK's bin directory).
Answer the questions with the values you want to store to your first key (myalias) and the tool will create a keystore including a key with alias myalias.
When done you can list the keys of the keystore with