0:00–0:10
Recap
0:10–0:40
Lecture
0:40–1:50
Lab 5C
1:50–2:00
Debrief
0:00 – 0:10Recap · 10 min
0:10 – 0:40Lecture · 30 min

PKI trust chains, the strongswan-pki toolkit, and certificate lifecycle

Part 1 — PKI trust model (10 min)

Part 2 — strongswan-pki command syntax (12 min)

Part 3 — Distinguished Names (8 min)

0:40 – 1:50Lab 5C · 70 min

Lab 5C — Build the CA on S3, issue server certificates for S1 and S3, distribute files

Part 1 — Install strongswan-pki on S3 (5 min)

Part 2 — Generate the CA private key and certificate (15 min)

Part 3 — Generate S3's server certificate (15 min)

Part 4 — Generate S1's certificate (also on S3) (15 min)

Part 5 — Copy files to S1 (10 min)

Lab 5C complete when: CA key and cert exist on S3. S3 has its own key/cert pair. S1 has caKey.pem in cacerts/, s1Key.pem in private/, s1Cert.pem in certs/. ipsec pki --print shows correct details on all certs.
1:50 – 2:00Debrief · 10 min

Learning outcomes — by end of Day 3, students can…

Explain the PKI trust chainDescribe why trusting a root CA implicitly trusts all certificates it signed, and what a DN contains
Generate a CA with strongswan-pkiCreate a CA private key and self-signed root CA certificate, and inspect it with ipsec pki --print
Issue server certificatesGenerate a server private key and issue a certificate signed by the CA with correct SAN and flag settings
Distribute PKI files correctlyIdentify which three files S1 needs and copy them to the correct /etc/ipsec.d/ subdirectories

Common issues and fixes

IssueLikely causeFix
ipsec pki --issue fails with "CA is not a CA"--cakey is pointing to s3Key.pem (server key) instead of caKey.pem (CA key)Always use caKey.pem for the --cakey argument. The caKey is what signs other certs — it must be the CA's private key, not the server's
ipsec pki --print shows wrong CN or missing SANTypo in --dn or --san argument during cert issuanceRegenerate the cert with the correct DN. The certificate cannot be edited after issuance — it must be re-issued
SCP fails — permission denied copying to /etc/ipsec.d/SCP lands in /home/student first, then must be moved with sudoSCP to /home/student/ first. On S1: sudo mv ~/caCert.pem /etc/ipsec.d/cacerts/. Always chmod 600 private keys after moving
← Day 2 Lab 5C Handout Day 4 →