What is a CSR, How to Create It, and the Role of the Private Key?

What is a CSR, How to Create It, and the Role of the Private Key?

Here's a detailed Knowledge Base (KB) Article explaining CSR (Certificate Signing Request), how to create it, and the critical role of the Private Key.


πŸ” Overview

A Certificate Signing Request (CSR) is a block of encoded text submitted to a Certificate Authority (CA) when applying for an SSL/TLS certificate. It includes information about the organization and the public key for the certificate.

This article will explain:

  • What a CSR is

  • How to create a CSR

  • What the private key is and why it is essential

  • Best practices for secure handling


πŸ“˜ What is a CSR?

A CSR (Certificate Signing Request) is a file generated on a server that is requesting an SSL certificate. It contains:

FieldDescription
Common NameThe Fully Qualified Domain Name (FQDN) like www.example.com
OrganizationThe legal name of your company
Location InfoCity, State, and Country
Public KeyUsed by the CA to generate the SSL cert
Hash AlgorithmSHA256 is commonly used

A CSR does not include the private key, but is mathematically linked to it.


πŸ” What is the Private Key?

The private key is a secret file generated with the CSR. It is used to:

  • Decrypt encrypted messages sent to your server

  • Digitally sign data to prove it came from your server

  • Work with the public key in the SSL certificate to enable HTTPS

⚠️ DO NOT share or expose your private key. If compromised, your secure connection is no longer secure.


🧩 What Information is in a CSR?

FieldExample
Common Name (CN)www.example.com
Organization (O)Example Inc.
Organizational UnitIT Department (optional)
Locality (L)New York
State (S)New York
Country (C)US
Email Addressadmin@example.com (optional)
Public Key AlgorithmRSA 2048-bit or ECC

πŸ› οΈ How to Create a CSR (and Private Key)

πŸ“ Windows Server (IIS)

  1. Open IIS Manager β†’ Click on the Server Name

  2. Go to Server Certificates β†’ Click Create Certificate Request

  3. Enter required CSR fields (CN, O, C, etc.)

  4. Select 2048 or 4096 bit RSA key

  5. Save the .req file (CSR).
    The private key is automatically stored in Windows.

πŸ“Ž Next Step: Submit the .req file to the Certificate Authority.


πŸ“ Linux (OpenSSL)

Run this command:

bash
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

You’ll be prompted to enter:

  • Country

  • State

  • Organization

  • Domain (CN)

This will generate:

  • yourdomain.csr β†’ The CSR to send to the CA

  • yourdomain.key β†’ Your private key (keep it safe!)


πŸ” Importance of the Private Key

πŸ”‘ FunctionDescription
DecryptionWorks with public key to decrypt messages
AuthenticationProves your server’s identity
Data IntegrityPrevents tampering during transmission
HTTPSEnables the SSL handshake
Non-recoverable if lostYou must reissue the cert if lost

πŸ›‘οΈ Security Tips

  • Store the private key on the same server that will use the SSL certificate.

  • Use file permissions to restrict access (e.g., chmod 600 yourdomain.key).

  • Never send the private key over email or upload it to untrusted storage.


🧾 Best Practices for Managing CSR and Private Key

ActionRecommendation
Generate key on serverAvoid using online CSR generators
Backup private key securelyEncrypt it or store in a secrets manager
Use strong algorithmsRSA 2048+ or ECC
Use different key pairsDon’t reuse keys across different certificates

πŸ›‘ What Happens if the Private Key is Lost or Compromised?

ScenarioAction
πŸ” LostCannot use the certificate. You must reissue the certificate with a new CSR.
πŸ•΅οΈ StolenSomeone could impersonate your server. You must revoke the certificate immediately.

    • Related Articles

    • What is SSL and How to Order an SSL Certificate?

      ? Overview SSL (Secure Sockets Layer), now technically referred to as TLS (Transport Layer Security), is a security protocol that encrypts data between a user’s browser and a web server. SSL ensures that sensitive information like login credentials, ...
    • How to Install an SSL Certificate on Windows Server 2012, 2016, 2019 & 2022 (IIS)?

      ? Purpose This article outlines step-by-step instructions to install and configure an SSL certificate on Windows Server using IIS Manager for different versions (2012 – 2022). This ensures secure HTTPS communication on websites hosted through IIS. ...
    • How to Verify Domain Ownership (Domain Validation for SSL)?

      Here's a detailed KB article explaining how to verify domain ownership (Domain Validation) during the SSL certificate issuance process. This is applicable for DV, OV, and EV certificates. ? Overview Before issuing an SSL certificate, a Certificate ...