5
I want to programmatically determine who has signed a GPG clear sign file. Running gpg --verify
will tell me this, but it does so in a human-readable format. Is it possible to get this result in a machine-readable format?
I am not looking for methods to parse the human readable format, as it may change in future GPG versions. I need a robust solution.
What exactly do you feel is the difference between human readable and machine readable? Honestly in either case a parser has to be written. Seems sort of trivial to parse the data returned by that command. – Ramhound – 2014-05-19T18:29:14.033
1@Ramhound: The difference is that human-readable outputs vary depending on program version, system language, date format, locale (character set)... The parser would therefore need to be several times more complex. – user1686 – 2014-05-19T18:32:26.147
@grawity - Alright. My statement was to see if I could get provided clarification so the question is clear. I could generate a parser without a problem, everything you list, would remain the same for anything I wrote. – Ramhound – 2014-05-19T18:38:23.700
1
For example, the keybase-client code at first tried to parse the human-readable format, but ended up having to account for timezones (the output contains local time); different amounts of information between versions ("skip arbitrarily many lines"); user's settings (long vs short vs 0xlong vs 0xshort key IDs)... The new code is about the same size, but is easier to understand, obtains more information, and it's more-or-less promised that the output format will remain the same.
– user1686 – 2014-05-19T18:38:26.073In other words, it's a choice between writing robust code, and "not a bug, it works on MY machine". – user1686 – 2014-05-19T18:40:51.923