keytool error: java.lang.Exception: Certificate not imported, alias already exists
What if this is seen:
# keytool -importcert -keystore /path/to/my.keystore -storepass CorrectPass -trustcacerts -file ca.crt -noprompt -alias MyAlias
keytool error: java.lang.Exception: Certificate not imported, alias <MyAlias> already exists
#
Then you may do this to remove the CERT if you plan to redo it.
# keytool -delete -keystore /path/to/my.keystore -storepass CorrectPass -alias rhq-ca
#
Followed by this to see it gone:
# keytool –list -keystore /path/to/my.keystore -storepass CorrectPass
Keystore type: JKS
Keystore provider: SUNYour keystore contains 0 entries
#
Cheers,
TK