5 Replies Latest reply: Jul 15, 2010 5:51 AM by 843811 RSS

    keytool command help?

    843811
      Hello,

      I am having problems using the keytool from the command line. I am using Java 5.

      I issue the following command.
      keytool.exe -import -noprompt -trustcacerts -alias 'temporary *.raleigh.ibm.com' 
      -file C:\Program Files\IBM\TeamConcertBuild\temporary.cer 
      -storepass changeit
      -keystore C:\Program Files\IBM\WebSphere\AppServer\java\jre\lib\security\cacerts
      I keep getting usage errors. Does the above command look correct?

      thanks in advance
        • 1. Re: keytool command help?
          843811
          Mind reading is not on my CV. What is the exact error message?
          • 2. Re: keytool command help?
            843811
            Sry...:)

            It returns the usage format.
            C:\Program Files\IBM\WebSphere\AppServer\java\bin>keytool.exe -import -noprompt
            -trustcacerts -alias 'temporary *.raleigh.ibm.com' -file C:\Program Files\IBM\Te
            amConcertBuild\temporary.cer -storepass changeit -keystore C:\Program Files\IBM\
            WebSphere\AppServer\java\jre\lib\security\cacerts
            keytool usage:
            
            -certreq     [-v] [-protected]
                         [-alias <alias>] [-sigalg <sigalg>]
                         [-file <csr_file>] [-keypass <keypass>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -delete      [-v] [-protected] -alias <alias>
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -export      [-v] [-rfc] [-protected]
                         [-alias <alias>] [-file <cert_file>]
                         [-keystore <keystore>] [-storepass <storepass>] [-pkcs12]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -genkey      [-v] [-protected]
                         [-alias <alias>]
                         [-keyalg <keyalg>] [-keysize <keysize>]
                         [-sigalg <sigalg>] [-dname <dname>]
                         [-validity <valDays>] [-keypass <keypass>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -help
            
            -identitydb  [-v] [-protected]
                         [-file <idb_file>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -import      [-v] [-noprompt] [-trustcacerts] [-protected]
                         [-alias <alias>]
                         [-file <cert_file>] [-keypass <keypass>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -keyclone    [-v] [-protected]
                         [-alias <alias>] -dest <dest_alias>
                         [-keypass <keypass>] [-new <new_keypass>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -keypasswd   [-v] [-all | -alias <alias>]
                         [-keypass <old_keypass>] [-new <new_keypass>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -list        [-v | -rfc] [-protected]
                         [-alias <alias>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -printcert   [-v] [-file <cert_file>]
            
            -selfcert    [-v] [-protected]
                         [-alias <alias>]
                         [-dname <dname>] [-validity <valDays>]
                         [-keypass <keypass>] [-sigalg <sigalg>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            
            -storepasswd [-v] [-all] [-new <new_storepass>]
                         [-keystore <keystore>] [-storepass <storepass>]
                         [-storetype <storetype>] [-providerName <name>]
                         [-providerClass <provider_class_name> [-providerArg <arg>]] ...
            • 3. Re: keytool command help?
              843811
              Ah have it.

              The space between *'temporary *'* was causing it.

              thanks
              • 4. Re: keytool command help?
                843811
                Also need to put the paths in quotes.............so the correct format is
                keytool.exe -import -noprompt -trustcacerts -alias 'temporary*.raleigh.ibm.com' -file "C:\Program Files\IBM\TeamConcertBuild\temporary.cer" -storepass changeit -keystore "C:\Program Files\IBM\WebSphere\AppServer\java\jre\lib\security\cacerts"
                • 5. Re: keytool command help?
                  843811
                  s_m_n_30 wrote:
                  Ah have it.
                  Well done. It is much better to find the cause of the problem yourself. The lack of quotes round the paths I could see would cause a problem but since I have never tried to put a space in an alias I have never met that one. I learn something new every day!