How to automate Keystore generation using the java keystore tool? w/o user interaction

前端 未结 3 1987
盖世英雄少女心
盖世英雄少女心 2020-12-12 18:54

I am trying to automate keystore generation using the Java keystore tool. The command I am using is :

keytool -keystore keystore -alias jetty -genkey -keyalg         


        
相关标签:
3条回答
  • 2020-12-12 19:14

    See the full documentation about command line or by typing keytool without any arguments.

    Specifically you may want to look options -storepass password -keypass password

    0 讨论(0)
  • 2020-12-12 19:27

    don't forget -noprompt, otherwise you will be asked to input Yes or No

    0 讨论(0)
  • 2020-12-12 19:30

    Try this:

    keytool -genkey -noprompt \
     -alias alias1 \
     -dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB" \
     -keystore keystore \
     -storepass password \
     -keypass password
    
    0 讨论(0)
提交回复
热议问题