Does anyone have a list of status codes returned by gpg.exe? I’m getting a return code 2 and have no what it means.The man page states: “The program returns 0 if everything was fine, 1 if at least a signature was bad, and other error codes for fatal errors.” But that is kind of nebulous.
It is generally not recommended to use the exit codes of GnuPG for anything real. I don’t know if a list exists.
The suggested way is to use the --status-fd (or --status-file) parameter and parse the output of that. This is documented in the details https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=doc/DETAILS;hb=refs/heads/master#l386
I think a big problem with the exit codes is that they might change between different versions, while the status output should be stable.
Thanks for the info. For what we do, decryption is just a part of a larger batch job and I wanted to see whether a simple test was sufficient to proceed to the next step.