Skip to content

nqinsp(3)

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);

() 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’
the manifest's format
‘info.alg’
the seal's algorithm
‘info.key’
the SHA-256 of the seal's public key, 64 lower-case hex digits
‘info.created’
the creation time
‘info.files’
the number of files listed, in decimal
‘info.bytes’
their total size, in decimal
‘info.timestamp’
‘present’ or ‘none’
‘info.meta’
the manifest's meta object as canonical JSON, only when it has one

Before them come the rows of the strict readers (‘seal.*, ‘manifest.*, ‘path’’’), as in nqchk(3).

() 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().

noqtis-inspect(1), nqchk(3), nqrep(3), noqtis-capsule(5)