$ keytool -genkeypair -alias mydemo.keystore -keyalg RSA -validity 100 -keystore mydemo.keystore Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Re-enter new password: What is your first and last name? [Unknown]: 111 What is the name of your organizational unit? [Unknown]: logit What is the name of your organization? [Unknown]: logit What is the name of your City or Locality? [Unknown]: changsha What is the name of your State or Province? [Unknown]: hn What is the two-letter country code for this unit? [Unknown]: ch Is CN=111, OU=logit, O=logit, L=changsha, ST=hn, C=ch correct? [no]: y
Enter key password for <mydemo.keystore> (RETURN if same as keystore password):