Ask a Question

Advanced Search

Alert ID : INFO897

Last Modified : 05/17/2018

Certificate Signing Request (CSR) Generation Instructions - Tomcat


This document provides Certificate Signing Request (CSR) Generation instructions for Tomcat server. If you are unable to use these instructions for your server, GeoTrust recommends that you contact the server vendor or the organization, which supports Tomcat.

Watch GeoTrust’s Tutorial Videos for a more visual experience!

Note:  If you are unable to view the video, please click here to go directly to the video source.

To generate a CSR, you will need to create a key pair for your server. These two items are a digital certificate key pair and cannot be separated. If you lose your public/private key file or your password and generate a new one, your SSL Certificate will no longer match and a replacement has to be made.

Step 1: Create a Keystore and Private Key

NOTE: A key length of 1024 bit is the default, but GeoTrust recommends the use of a 2048 bit key.

Please use JDK 1.3.1 or later.

  1. Create a certificate keystore and private key by executing the following command:
    Unix: $JAVA_HOME/bin/keytool -genkey -alias <your_alias_name> -keyalg RSA -keystore <your_keystore_filename> -keysize 2048
    NOTE: For Extended Validation certificates the key bit length must be 2048, add in the command above:  -keysize 2048

    This command will prompt for the following X.509 attributes of the certificate:

    Country Name (C): Use the two-letter code without punctuation for country, for example: US or CA. 

    State or Province (S): Spell out the state completely; do not abbreviate the state or province name, for example: California 

    Locality or City (L): The Locality field is the city or town name, for example: Berkeley. 

    Organization (O): If your company or department has an &, @, or any other symbol using the shift key in its name, you must spell out the symbol or omit it to enroll.  

    Organizational Unit (OU): This field is optional; but can be used to help identify certificates registered to an organization. The Organizational Unit (OU) field is the name of the department or organization unit making the request. 

    Common Name (CN): The Common Name is the Host + Domain Name. It looks like "" or "".  
    NOTE: When prompted for your "first - and last name", enter the desired Common Name.

    GeoTrust certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "" will receive a warning if accessing a site named "" or "", because "" and "" are different from "".

  2. Specify a password. The default value will be "changeit".
    For further information, please refer to the Tomcat Web site.

Step 2: Generate a CSR

  1. The CSR is then created using the following command:
    keytool -certreq -keyalg RSA -alias <your_alias_name> -file certreq.csr -keystore <your_keystore_filename>

  2. Create a copy of the keystore file. Having a back-up file of the keystore at this point can help resolve installation issues that can occur when importing the certificate into the original keystore file.
  3. To copy and paste the file certreq.csr into the enrollment form, open the file in a text editor that does not add extra characters (Notepad or Vi are recommended).
  4. Verify your CSR with the GeoTrust CSR Checker