3 ms·
I think the API is the GPGME library? https://gnupg.org/software/gpgme/index.html https://gnupg.org/software/gpgme/index.html ... which internally calls gnpg
by yrro 8y ago
I think the API is the GPGME library?
https://gnupg.org/software/gpgme/index.html https://gnupg.org/software/gpgme/index.html
... which internally calls gnpg using the --with-colons argument which is how you're supposed to get machine-readable output.
That said, maybe your use case isn't very accessible via the standard gpg commands. It sounds like you want to parse the ciphertext and extract the recipient keyids? You can do that with gpg --list-packets, but this is really intended for debugging, not automated consumption. That said it doesn't look too hard to parse, but who knows how stable it will be in the future.
- yrro 8y ago(for example) gpg --list-only --list-packets foo | gawk '/^:pubkey\>/ { print $9 }'