mdverify: Verify the bundled data store against its signed manifest

View source: R/data_store.R

mdverifyR Documentation

Verify the bundled data store against its signed manifest

Description

Every file rmoriedata ships is listed with its SHA-256 in a manifest, and the manifest is signed with an XMSS (RFC 8391, SHA-256) key whose public half ships with the package. Loading a table checks its file against the manifest; this function checks all of them at once. What the session has cached from a file found changed or missing (a table loaded by mdload(), the catalog, the schema) is dropped, so the next load reads the file again and refuses it.

Usage

mdverify()

Details

A file present in the installed store but absent from the manifest is reported too, hidden (dot) files included, as a row with listed = FALSE and ok = FALSE: a file added to the store is as much a change as a file altered in it.

What is covered: every file under the package's extdata directory (or the directory named by options(rmoriedata.store = )), which holds every table, dictionary, catalog and Parquet copy that mdload(), mdpath(), mddict(), siuload() and cihitbls() read. What is not covered: the package's R code, its compiled code, and the two lazy-data objects complaint_sample and arrest_sample (stored in the package's data database, not in extdata); these are installed files of the package itself, which tools::checkMD5sums("rmoriedata") checks against the MD5 file of a CRAN install.

A listed path that holds anything but the file (it is missing, a directory, a FIFO, a device, a link that loops or leaves the store, or cannot be read) is a row with ok = FALSE; nothing at such a path is waited on.

Value

A data frame with one row per manifest entry, then one per unlisted file (in the byte order of their paths, the same in every locale): path, bytes, sha256 (the manifest digest, or the file's own for an unlisted file: NA when it is not a regular file or is larger than 1 GiB), listed, ok (the file on disk is listed and matches). The attribute "signature" is TRUE when the manifest's signature verified, and the function errors if it did not.

Examples

v <- mdverify()
all(v$ok)
attr(v, "signature")

rmoriedata documentation built on Nov. 18, 2026, 5:06 p.m.