>_ IzzyLab

Hands-on task

This task is step 8 of the course “TLS and certificates”

Your own certificate authority

medium~7 min

Create your own CA: a private key /root/ca.key and a self-signed root certificate /root/ca.crt with CN IzzyLab Root CA valid for 3650 days.

What you'll practise:
  • openssl
  • self-signed certificate
  • root ca
  • x509
  • -subj

Topic breakdown

A root CA is technically an ordinary self-signed certificate, but with a special role: its private key is later used to sign other certificates, and the .crt itself is distributed as a trust anchor. It is issued via openssl req in -x509 mode with the key generated in place (-newkey, -nodes for no password), where the key and certificate are written to separate files by their own flags, and the long validity via -days. The subject name is set non-interactively via -subj, and since the CN contains spaces, the entire argument must be put in quotes, otherwise the shell will cut it into words.

What's checked

  1. CA certificate created
  2. CA key is valid
  3. ca.key matches ca.crt
  4. valid for 3650 days

What it looks like