The keytool command is part of the Java 2 JDK release.
Complete documentation can be found at sun-keytool.html.
The keytool command will do most of what you need: listing contents,
setting aliases, adding new trust certificates. The one thing it does
not
do (prior to Java 6) is to import a trusted entry, e.g. cert and key.
OSCARS provides wrappers in tools/utils
that simplify the use keytool by suggesting the location of the
keystore and finding the password from the related configuration file.
These wrappers should be used to edit
$CATALINA_HOME/shared/classes/repo/{OSCARS.jks, ssl-keystore.jks}. You
can use keytool to edit keystores in other locations.
openssl x509 -in 'CAcert.der' -inform DER -outform PEM -out 'CAcert.pem'To import into a keystore:
keytool -import -keystore 'OSCARS.jks' -file 'CAcert.pem' -trustcacerts -alias 'CA'
copyKey.sh -a <alias of keyEntry>
[-inpkcs12 <filename of input
keyStore> | -injks
<filename of input
keyStore> ]
-out <filename of output keystore>
It will prompt for the password of the input keystore, the
password of the keyEntry in the input keystore and the password for the
output key store. Normally the password of a keyEntry is the same the
keystore. If this is the case just reply with a CR. If the -inpkcs12
option is used the entry will be imported from a pkcs12 file. If -injks
is used it will be imported from another jks keystore.