Home / Tutorials / How to Generate a CSR on Android

How to Generate a CSR on Android?

In this tutorial, we will show you how to generate a CSR on Android. Since Java is the official language of Android development, we’ll show you how to generate a CSR code via Java Keystore.

Along with the CSR, Java Keystore will also generate your private key file, required during the SSL installation.

Please, follow the instructions below:

Step 1: Create a keystore and a key file

Run the following command:

keytool -genkey -alias myalias -keyalg RSA –keysize 2048 -keystore c:\yoursite.keystore

Note: Remember your alias. You will need it later during the SSL installation.

Step 2: Enter your information

When prompted, submit your information as shown below:

  • What is your first and last name? Instead of your first and last name, enter the FQDN (fully-qualified domain name) you want to secure. For example, www.yoursite.com
  • What is the name of your organizational unit? Name the department within your organization requesting the SSL Certificate. For instance, IT
  • What is the name of your organization? Specify the full legal name of your company. For example, Your Company LLC
  • What is the name of your city or locality? Write the full name of the city where your company is registered
  • What is the name of your state or province? Enter the full name of the state or province where your company is located For example, California
  • What is the two-letter country code for this unit? Type your country’s official two-letter code. For instance, US. Here you can find the full list of country codes.

Press Y or type Yes to confirm your details.

Step 3: Create your CSR code

Run the following command:

keytool -certreq -keyalg RSA -alias myalias -file certreq.txt -keystore c:\yoursite.mykeystore

To locate your CSR file, run the command below:

type certreq.txt

Use any text editor such as Notepad to open the certreq.txt file. You will need to copy-paste its contents, including the BEGIN CERTIFICATE and END CERTIFICATE tags into the corresponding box during the SSL order process.