Q:

Import Keystore in order to Sign Applet

One of the security reps at my company gave me a keystore to use when I sign my applet.  However, I'm having issues actually importing the keystore.  I tried executing the following, but nothing happened... well almost nothing...  The keytool application prompted me for my password which I entered and then hit return.  The tool responded by placing the cursor on the next line and it just sat there for like 10 minutes at which time I killed the process.  I'm assuming that I'm doing something wrong and am hoping that someone can point me in the right direction.
C:/program files/java/jdk1.6.0_19/bin/keytool" -import -alias company -keystore D:/companysig.jks

Thanks,
Jeremy

A:

If you have a keystore, you can just use that keystore with the jarsigner command. For an example, see here (you inform the keystore to be used for signing, as well as the alias of the key to use):
http://www.owasp.org/index.php/Signing_jar_files_with_jarsigner
When you use they keytool import option, you will be importing a key you specify (that's in a file) to the keystore you specify. If you don't specify the file, the command probably wants to read the key from standard input, and the process was waiting for the key that never arrived. But in any case, in your case I don't see why you'd need to use this.
If you wish to import the whole keystore into another keystore you need to use the importkeystore option:
-importkeystore [-v] 
         [-srckeystore <srckeystore>] [-destkeystore <destkeystore>]
         [-srcstoretype <srcstoretype>] [-deststoretype <deststoretype>]
         [-srcstorepass <srcstorepass>] [-deststorepass <deststorepass>]
         [-srcprotected] [-destprotected]
         [-srcprovidername <srcprovidername>]
         [-destprovidername <destprovidername>]
         [-srcalias <srcalias> [-destalias <destalias>]
           [-srckeypass <srckeypass>] [-destkeypass <destkeypass>]]
         [-noprompt]
         [-providerclass <provider_class_name> [-providerarg <arg>]] ...
         [-providerpath <pathlist>]

