Keyrings file format

Robert J. Hansen rjh at
Wed Jan 7 06:04:06 CET 2009

David Shaw wrote:
> That is not correct.  The whole point of --with-colons is that it is a
> stable interface.  It exists for exactly what you are doing: being
> used from another program.

I've written code to parse --with-colons a few times, and while I
haven't found it very hard to get it working to the 90% point, strange
or peculiar keys will often cause code to break or behave weirdly.  A
lot of this is due to the lack of a BNF for a key entry.  E.g., my first
time writing a parser for --with-colons, I assumed that every key
possessed at least one UID.  This assumption is not sound, as it's
apparently possible to craft keys with no UIDs.

It would be nice if in the HACKING document there was a concise BNF for
the key format, to spare other people the headaches of discovering the
sharp edges the hard way.

More information about the Gnupg-devel mailing list