8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Misc » Here

Signing JAR Files

This article describes the method for creating a keystore and signing JAR files.

Create Keystore (keytool)

Before you can sign a jar file you need a keystore. If one doesn't already exist, you can create it using the keytool utility. The keytool utility is normally found under the JDK bin directory, so you may find it in several locations on your server. For example, on Oracle Application Server and WebLogic environments you would find it in at least the following locations:

Navigate to the users home directory.

$ cd ~
$ # Or
$ cd $HOME

Use the keytool utility to generate the keystore. The default name for the keystore is ".keystore", but this can be overridden with the "-keystore" parameter.

$ $ORACLE_HOME/jdk/bin/keytool -genkey -alias myapp -keyalg RSA -keystore .keystore_myapp

Enter keystore password:  mypassword
What is your first and last name?
  [Unknown]:  Joe Bloggs
What is the name of your organizational unit?
  [Unknown]:  My Department
What is the name of your organization?
  [Unknown]:  My Company
What is the name of your City or Locality?
  [Unknown]:  My City
What is the name of your State or Province?
  [Unknown]:  My State
What is the two-letter country code for this unit?
  [Unknown]:  UK
Is CN=Joe Bloggs, OU=My Department, O=My Company, L=My City, ST=My State, C=UK correct?
  [no]:  yes

Enter key password for <myapp>
        (RETURN if same as keystore password):

$

See the linked documentation for more information about the keytool command line syntax.

Sign JAR Files (jarsigner)

Once the keystore is created, you can use the jarsigner utility to sign the JAR files. The jarsigner utility is normally found under the JDK bin directory, so you may find it in several locations on your server. For example, on Oracle Application Server and WebLogic environments you would find it in at least the following locations:

Sign the JARs using the information from the keystore.

$ORACLE_HOME/jdk/bin/jarsigner -keystore .keystore_myapp -storepass mypassword $ORACLE_HOME/forms/java/frmall.jar myapp

See the linked documentation for more information about the jarsigner command line syntax.

WebLogic 11g

You can read how to sign JAR files for WebLogic 11g here.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.