Ask a Question

Advanced Search

Solution ID : SO11251

Last Modified : 05/02/2018

How to install a Code Signing Certificate for Sun Java in x.509 format


If you have downloaded or received the Code Signing Certificate for Sun Java in x.509 format, please follow these instructions to install the Code Signing Certificate and the corresponding Intermediate CA certificates into your keystore.

Step 1: Install Code Signing Intermediate CA certificate into the keystore

  1. Download the Intermediate CA certificate here: INFO1739
  2. Copy the Intermediate CA certificate and paste it in a text editor such as Notepad or Vi.
  3. Make sure there are 5 dashes to either side of the BEGIN CERTIFICATE and END CERTIFICATE and that no white spaces, extra line breaks or additional characters have been inadvertently added.
  4. Save the file as intermediate.cer
  5. Use the following command to import this Certificate into the keystore:
    keytool -import -trustcacerts -alias Intermediate -keystore your_keystore_filename -file intermediate.cer


Step 2: Install Sun Java certificate into keystore

  1. Save the x.509 formatted file as sunjava.cer
  2. Use the following command to import the Sun Java Code Signing certificate into the keystore:
    keytool -import -trustcacerts -alias your_alias_name -keystore keystore_name -file sunjava.cer


Step 3: Confirm the contents of the keystore

  1. Enter the following command to list the contents of the keystore:
    keytool -list -v -keystore  your_keystore_filename >output_filename

  2. View the contents of the output file 
    Keystore type: JKS
    Keystore provider: SUN

    Your keystore contains 2 entries

    Alias name: alias
    Creation date: Jul 1, 2016
    Entry type: PrivateKeyEntry
    Certificate chain length: 3

  3. Verify the following information:

    The Code Signing Certificate for Sun Java certificate is imported into the alias with the "Entry Type" of PrivateKeyEntry or KeyEntry.  If not, please import the certificate into the Private Key alias.

    The Certificate chain length is 3.