Integrity

For a drag-and-drop check in the browser, use the verify page. Viewer banners come from the published k2f/public/contracts/banners.json.

Viewer banners

Viewers must display an integrity banner derived from IntegrityStatus:

BannerWhen
SIGNEDValid signature and hash chain
UNSIGNEDValid, unsigned
SIGNED_BUT_BROKENSignature file invalid or tampered
BROKEN_INTEGRITYContent, appearance, engine, or font failure
UNLOCKEDPackage not compiled

BROKEN_INTEGRITY and SIGNED_BUT_BROKEN must not be treated as signed.

Integrity verification

k2f verify and inspect_package return status codes:

CodeMeaning
VALIDLock matches semantic content, theme, fonts, and engine
UNSIGNEDValid hash chain, no signature file
SIGNEDValid hash chain and valid Ed25519 signature
SIGNED_BUT_BROKENSignature present but hash or crypto check failed
UNLOCKEDNo document.K2F.lock
CONTENT_CHANGEDSemantic tree changed since lock
APPEARANCE_CHANGEDTheme, fonts, or page config changed since lock
ENGINE_MISMATCHengine_version or engine_commit_sha differs from reader
FONT_MISSINGRequired embedded fonts absent

Additional package errors: SCHEMA_INVALID, NODE_ID, UNEXPECTED_PATH, UNKNOWN_PAINT_OP, PDF_IS_NOT_A_SOURCE.

Verify codes

From k2f/public/contracts/verify-codes.json.