A lightweight and educational Public Key Infrastructure (PKI) implementation using OpenSSL
Designed for security labs, real-world use cases, and infrastructure understanding.
🌍 Languages: 🇬🇧 English (default) | 🇫🇷 French version
make init-ca make user USER=bob
Make sure OpenSSL is installed on your system.
sudo apt install openssl
winget install ShiningLight.OpenSSL
brew install openssl
This project provides a complete PKI workflow:
- Root Certificate Authority (CA)
- User certificate generation (key + CSR)
- Certificate signing
- PKCS#12 export (.p12)
- Certificate revocation
- CRL (Certificate Revocation List)
👉 Built to demonstrate real PKI concepts without unnecessary complexity.
Imagine a company that wants to:
- secure internal communications
- ensure email authenticity
- implement certificate-based authentication
- 🔐 IT team creates a Root CA
- 👤 User certificate is generated
- ✍️ Certificate is signed by the CA
- 📦 User imports
.p12into Outlook / Thunderbird - 📧 Emails are now:
- signed (integrity + identity)
- encrypted (confidentiality)
- 🚫 If a user leaves → certificate is revoked
- 📋 CRL is updated and distributed
👉 This is exactly how enterprise PKI works (simplified).
+-------------------+
| Root CA |
| (private key 🔐) |
+---------+---------+
|
| signs
↓
+-----------------------------+
| User Certificate |
| (key + CSR → signed cert) |
+-------------+---------------+
|
| export
↓
+------------------+
| PKCS#12 |
| (.p12 / .pfx) |
+------------------+
|
↓
+-----------------------------+
| Email / Browser / API Auth |
+-----------------------------+
pki/users/bob/ ├── bob.key ├── bob.csr ├── bob.crt └── bob.p12
- Import
.p12into Outlook / Thunderbird - Send signed/encrypted emails
- Use certificate for authentication
sudo apt install openssl
brew install openssl
winget install ShiningLight.OpenSSL
./scripts/linux/01-create-root-ca.sh
./scripts/linux/02-create-user-key-csr.sh bob
./scripts/linux/03-sign-user-cert.sh bob
./scripts/linux/04-export-p12.sh bob
./scripts/linux/05-revoke-user-cert.sh bob
./scripts/linux/06-generate-crl.sh
Root CA │ ├── signs → User certificates │ └── manages → Revocation + CRL
- ❌ Never commit:
- private keys (
*.key) - PKCS#12 files (
*.p12)
- private keys (
- ✔️ Protect the CA private key
- ✔️ Use strong passphrases
- ✔️ Store CA offline (best practice)
- Minimal but realistic PKI
- Separation of CA config and certificate profiles
- Cross-platform support
- Script-based automation
- Intermediate CA support
- REST API (certificate lifecycle)
- Web UI
- Full automation (one-command provisioning)
Jean-Marc : BugJohn
PKI is at the core of modern security:
- TLS / HTTPS
- Email security (S/MIME)
- Identity & authentication
- Zero Trust architectures
👉 This project bridges theory and real-world implementation.
A Legacy version of this project is also available in the repository: Mini-PKI-LEGACY.
It reproduces a typical early 2000s implementation, based on .bat scripts and direct OpenSSL usage, without automation or abstraction.
fully functional and ready-to-use intentionally not maintained intended for educational purposes only
It provides a hands-on understanding of PKI fundamentals, without modern layers (ACME, APIs, automation).
⚠️ Do not use in production: no revocation management, no governance, and no modern security mechanisms.
➡️ A great way to realize that, in the end… nothing really changed 😉