ccache-io 0.1.0

Pure-Rust MIT Kerberos credential-cache (ccache v4) reader + writer — round-trip a `krb5cc_*` file, walk its principals + tickets, or emit one from your own auth code. No FFI, no `libkrb5`, no MIT runtime dependency.
Documentation
  • Coverage
  • 100%
    54 out of 54 items documented1 out of 12 items with examples
  • Size
  • Source code size: 28.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 399.1 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • icedracon

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 reads KRB5CCNAME.
  • 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_io::Ccache;

let bytes = std::fs::read("/tmp/krb5cc_1000")?;
let cc = Ccache::parse(&bytes)?;
for c in &cc.credentials {
    println!("{} → {}  (endtime={})", c.client.canonical(), c.server.canonical(), c.endtime);
}

License

MIT.