After two evenings of work I'd like to try to summarize my experiences: first of all, error handling is very basic. You don't get very meaningful error messages (in fact, you don't get any error messages until you call
gnupg_seterrormode($gpg, GNUPG_ERROR_WARNING)…). Error messages like „get_key failed“ are not very obvious.
Also nice to know (and not obvious): you have to set the environment variable
GNUPGHOME to the full path to your keyring files. E.g. if your keyring is stored in
/var/www/easterhegg.ch/.gnupg/, you have to specify the
GNUPGHOME variable as follows:
All in all, the API is usable but error handling seems very basic.