I'm maintaining several keys in a keyring and I regularly want to encrypt a file with every key in the keyring as a recipient. What is the best way to accomplish this if I do not want to specify each recipient individually with the --recipient or -r options?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
|||
|
migrated from stackoverflow.com Nov 20 '12 at 11:58
|
I'd start with something like this to auto-detect all the pubkeys in your keyring:
That should give you enough -- there are tons choices for how to proceed. One route: create a wrapper that runs gpg with that plus any args you pass it, e.g. add the following to
Example of running it:
This is nice if you always encrypt files and save output to files; otherwise, it might be simpler to have your script/function ONLY run the original detection-command -- this would allow more flexibility, e.g.:
|
|||
|
|