Encrypt to key outside of keyring

Matthias Fischer mmfische at web.de
Fri Dec 27 16:34:31 CET 2013


is there a way to encrypt data to a specific key, which is not in the keyring, but instead present as a single keyfile?

So instead of calling something like:
$ gpg --recipient <KEY-ID> -e <FILE>
you could write something like:
$ gpg --recipient-file <KEYFILE> -e <FILE>

I can achieve the wished behaviour by writing:
$ gpg --no-default-keyring --keyring /tmp/keyring.once --import <KEYFILE>
$ gpg --no-default-keyring --keyring /tmp/keyring.once --recipient <KEY-ID> -e <FILE>

but I would prefer it, if it could be done in one step and without creating a temporary file. It's also bothering, that I still have to tell the second command the KEY-ID, even if there is only a single key in the Keyfile.

If there doesn't exist an option like this yet (which is probably the case since I couldn't find it, but maybe I'm looking for the wrong thing), where could I fill in a feature request?


More information about the Gnupg-users mailing list