Replace the backtracking _PEM_BLOCK regex with a forward-only scanner that indexes END markers by label, so repeated unterminated headers do not cause the regex to rescan the remaining input. Impact: 80 KiB payload went from 8.34 s to 0.001 s.
kca-core
Pure, I/O-free PKI domain logic for KCA. It knows how to generate and parse keys, build distinguished names, encode X.509 extensions, issue certificates, create CSRs and CRLs, apply templates, and convert every supported import and export format. It has no kaya, database or filesystem dependencies and is unit-tested in isolation.