Skip to main content

KeyFetch

Type Alias KeyFetch 

Source
pub type KeyFetch = Arc<dyn Fn(&[Vec<u8>]) -> Vec<[u8; 16]> + Send + Sync>;
Expand description

Application-supplied “fetch a fresh key for THIS data” callback.

Invoked by DecryptingSectorSource when a read contains scrambled AACS units that NONE of the currently-held unit keys could decrypt. The argument is those still-scrambled 6144-byte aligned units (real on-disc ciphertext); the return is any additional unit keys to add to the pool and retry with — empty if the source can’t help. Mirrors the DVD model (try the held key, then ask the key source for the failing data) generalised to AACS.

The library performs NO key lookup or network I/O itself; this closure is the seam an application uses to call its key source (e.g. an online key service) with the exact ciphertext that failed. A stateless, shared Arc<Fn> — the decorator owns the only mutable state (its call-count cap and spent flag), so one closure is built once and cloned cheaply into every read path (sweep / patch / mux); no per-decorator factory is needed. Send + Sync so it can ride the mux highway’s producer thread.

Aliased Type§

pub struct KeyFetch { /* private fields */ }