6 /* The PGP header structure walks through PGP data.
12 uint32_t r64ofs; // Set to PGP64_NA for binary data
13 } pgpcursor_st, *pgpcursor_t;
15 #define PGP64_NA (~(uint32_t) 0)
18 /* Setup a cursor on binary PGP data; always returns success. */
19 bool pgp_initcursor_binary (pgpcursor_t crs, uint8_t *data, uint32_t len);
21 /* Setup a cursor on radix64 PGP data; return success. */
22 bool pgp_initcursor_radix64 (pgpcursor_t crs, char *data, uint32_t len);
24 /* Fetch a byte from a pgpcursor; this may look either into binary data,
25 * or into radix64-encoded data. In the latter case, r64ofs is set to a
26 * value different from PGP64_NA and indicates an additional byte offset.
27 * In both cases, ptr points to the start of a fragment, and ofs and len
28 * deal with the binary number of bytes.
29 * This function returns 1 on success, 0 on failure.
31 bool pgp_getbyte (pgpcursor_t crs, uint8_t *output);
33 /* Parse a PGP header pointed to by a given cursor. Deliver a tag and an
34 * inner PGP cursor, while advancing the original PGP cursor beyond the
35 * tag. The function returns a success value or zero for failure.
36 * When sub is provided as NULL, it will not be entered.
38 bool pgp_enter (pgpcursor_t seq, uint8_t *tag, pgpcursor_t sub);