nqinsp, nqfiles
— read what a capsule says, without checking
it
libnoqtis, -lnoqtis
#include
<noqtis.h>
int
nqinsp(const
char *dir, nqrep
**rep);
int
nqfiles(const
char *dir, nqrep
**rep);
nqinsp()
reads the seal noqtis.sig and the manifest
noqtis.json of the capsule in
dir
(noqtis-capsule(5))
with the same strict readers as
nqchk(3) (canonical
JSON, the exact fields, the manifest in its canonical layout) and stores a
report in *rep
(nqrep(3)). It
checks nothing else: not the manifest's SHA-256, the signature, the
timestamp or any file in the folder.
When both parse, the report ends with rows that always pass, one per fact:
info.format’info.alg’info.key’info.created’info.files’info.bytes’info.timestamp’present’ or
‘none’info.meta’Before them come the rows of the strict readers
(‘seal.*, ‘’),
as in nqchk(3).manifest.*,
‘’path’
nqfiles()
is nqinsp() with one
‘info.file’ row per listed file among
the reader's rows, in manifest order: the file's size in bytes, in decimal,
its SHA-256 as 64 lower-case hex digits, and its path (normal form,
‘/’ between folders), with a space
between. Only paths the checker's rules accept are listed, so a caller may
fetch each one into a folder of its own, as ‘noqtis
check url’ does, and then check that
folder.
Both return NQOK when the seal and the
manifest parse; NQEDEC when one does not
(*rep holds the failing rows);
NQEARG for a NULL argument and
NQEMEM when memory runs out (no report). Free the
report with nqrepfree().