EJBCA Beginner Guide: From CA to Certificate Enrollment

Date: 2020/11/22
Categories: Tech
Tags: x509, PKI, EJBCA

X509 is a complicated thing and EJBCA makes it easier to grasp. Eww you may find EJBCA is complicated as well. This post will guide you to specific case as example:

CA that can issuing certificates for high education instutution. High education institution as end user can signing PDF files for their student certification.

This post is not the best practice example but it can introduce you to how EJBCA works. Let’s go.

EJBCA Preparation on local environment

docker-compose.yaml:

version: '3'

services:
  db:
    image: postgres:13-alpine
    env_file: .env
    restart: always
    volumes:
     - ./data:/data

  ejbca:
    image: primekey/ejbca-ce:6.15.2.6
    env_file: .env
    restart: always
    ports:
      - 80:8080
      - 443:8443
    depends_on:
      - db

.env:

# EJBCA
TLS_SETUP_ENABLED=simple
DATABASE_USER=postgres
DATABASE_PASSWORD=kLTPk5Ty9K3JHykCS38YBHDTVwXkVCgjsQs7HaT8wwT5VcY5G54tMbSNt6uCEztM
DATABASE_JDBC_URL=jdbc:postgresql://db/postgres

# DB
POSTGRES_PASSWORD=kLTPk5Ty9K3JHykCS38YBHDTVwXkVCgjsQs7HaT8wwT5VcY5G54tMbSNt6uCEztM
PGDATA="/data"

Spin them up with docker-compose up -d --force-recreate. It’ll take some minutes until EJBCA is ready to serve you.

Some notes:

Issuing Root CA

Issuing Intermediate CA

Preparing Certificate Profiles

Any attempt of issuing new certificate will require a certificate profile that define what kind of certificate that will be created. Let’s assume that we want to create certificate profile for high education institutions and it will be used to signing ijazah. Let’s name it HIGHEDUINSTITUTION.

Preparing End Entity Profile

Certificate Profile defines the technical aspects of the certificate. On the other hand, EEP defines the entity aspects that related to identity.

Let’s try to issuing and enrolling a new certificate for education institution

Let’s enroll the certificate

At this point, you may check the new issued certificate against the certificate chain.

Next post

I’ll write about authentication, roles and security on maintaining EJBCA instance.



>> Home