ccache-io
Pure-Rust reader + writer for the MIT Kerberos credential-cache (v4) file format —
the on-disk shape of a krb5cc_* you drop into KRB5CCNAME. No FFI, no libkrb5,
no MIT runtime dependency; one thiserror dep, one file.
Why
Every Kerberos client and every Kerberos-aware pentest tool consumes or produces
ccache files, but the Rust ecosystem has been thin on decoders that work without
libkrb5 linked in. ccache-io closes that gap so a Rust app can:
- Import a ticket someone else acquired (MIT
kinit, a pentest toolkit, a stored operator ticket) and walk its principals + validity window. - Emit a ccache from its own auth code so the ticket is reusable by
klist,kvno, or any tool that readsKRB5CCNAME. - Round-trip an existing cache byte-exact for redaction, filtering, or rewriting.
Status
v0.1.0 — v4 format only (0x0504 magic). This covers every MIT krb5 release
since 1.4 (2005) and every modern Linux distribution's default. v3 (little-endian,
pre-2005) and the older FCC formats are out of scope for v0.1; they can be added
without breaking the API thanks to #[non_exhaustive] on the error enum.
The core round-trip is unit-tested against a hand-crafted, byte-defined fixture;
next milestones are (a) round-trip fixtures captured from live kinit runs, (b) a
kirbi (Windows KRB-CRED) codec alongside ccache.
Example
use Ccache;
let bytes = read?;
let cc = parse?;
for c in &cc.credentials
License
MIT.