This directory contains rootless user-mode units for running step-ca-p11-kit with p11-kit and Podman.
Install these files in your user config:
~/.config/containers/systemd/:step-ca-p11-kit@.containerstep-ca-p11-kit.networkstep-ca-p11-kit@.volume
~/.config/systemd/user/:step-ca-p11-kit@.targetp11-kit-server@.servicep11-kit-server@.socketp11-kit-server@.target
- Generate env files:
./scripts/generate-instance-env.sh \
--instance prod \
--ca-name "Example CA" \
--dns "ca.example.local" \
--external-port 9443 \
--hsm-uri "pkcs11:token=RootCA" \
--private-key-pkcs11-uri "pkcs11:token=IssuingCA;id=%01;object=issuing;type=private?module-path=/usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-client.so&pin-source=file:///run/secrets/hsm-pin"
This writes:
%h/.config/p11-kit-server/prod.env%h/.config/step-ca/prod.env%h/.config/containers/systemd/step-ca-p11-kit@prod.container(symlink tostep-ca-p11-kit@.container)%h/.config/containers/systemd/step-ca-p11-kit@prod.container.d/10-publish-port.conf
- Create required Podman secrets for the instance:
podman secret create hsm-pin-prod /path/to/hsm-pin
podman secret create admin-password-prod /path/to/admin-password
podman secret create root-cert-prod /path/to/root.crt
podman secret create cert-prod /path/to/ca.crt
- Start services:
systemctl --user daemon-reload
systemctl --user enable --now p11-kit-server@prod.target
systemctl --user enable --now step-ca-p11-kit@prod.target
- The PKCS#11 socket is created at
%t/p11-kit/<instance>.sockand consumed inside the container as/run/p11-kit/<instance>.sock. step-ca-p11-kit@.containermounts instance-scoped Podman secrets to:/run/secrets/hsm-pin/run/secrets/admin-password/run/secrets/root.crt/run/secrets/ca.crt
step-ca-p11-kit@.containerusesPull=alwaysby default; use systemd drop-ins if you need different pull behavior.step-ca-p11-kit@.containerrunscosign verifyinExecStartPrebefore startup; installcosignon the host and update bothImage=andExecStartPre=together when overriding the image reference.scripts/generate-instance-env.shcreates%h/.config/containers/systemd/step-ca-p11-kit@<instance>.containeras a symlink to the templatestep-ca-p11-kit@.container.scripts/generate-instance-env.shwrites%h/.config/containers/systemd/step-ca-p11-kit@<instance>.container.d/10-publish-port.confwithPublishPort=<external>:9000so the container always listens on internal port9000while the host port remains configurable.