Home GnuPG
Diffusion GnuPG 5137bf73ccc9

gpg: New option --import-filter
5137bf73ccc9Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

gpg: New option --import-filter

* g10/gpg.c (oImportFilter): New.
(opts): Add --import-filter.
(main): Handle option.
* g10/import.c: Include recsel.h, init.h, and mbox-util.h.
(import_keep_uid): New global var.
(cleanup_import_globals): New.
(parse_and_set_import_filter): New.
(filter_getval): New.
(apply_keep_uid_filter): New.
(import_one): Apply filter if set.

Funny new option. It can for example be used to export a key with
only one user id:

gpg --no-options --import --import-options import-export \
    --import-filter keep-uid='mbox=wk@gnupg.org'         \
   < full-key.pub > key-with-one-uid.pub

More features will eventually be added.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Jul 1 2016, 4:24 PM
Parents
rGf015552374d6: gpg: Allow to cache the mbox in a user id struct.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG5137bf73ccc9: gpg: New option --import-filter (authored by Werner Koch <wk@gnupg.org>).Jul 1 2016, 4:28 PM