From your description I assume you are on windows machine and your home is abc
So Now : Cause
When you run this command
keytool -genkey -alias tomcat -keyalg RSA
because you are not specifying an explicit keystore it will try to generate (and in your case as you are getting exception so to update) keystore
C:\users\abc>.keystore and of course you need to provide old password for .keystore while I believe you are providing your version (a new one).
- Either delete
C:\users\abc>location and try the command
- or try following command which will create a new xyzkeystore:
keytool -genkey -keystore xyzkeystore -alias tomcat -keyalg RSA
-genkey is old now rather use
-genkeypair althought both work equally.