MacGPG problem with: --import-options import-export

mrfreeze's Avatar


19 May, 2020 01:32 PM

gpg (GnuPG/MacGPG2) 2.2.17
libgcrypt 1.8.5

Have an ASC file containing numerous public keys, exported from GPG Keychain. I would like to 'extract' one key from this file and store it in a file of its own without having to import all of the keys to my new keyring. From what I have read (across, especially: the import-export option will allow me to do this.
The following command should output any keys from Keys3.asc which contain 'Tails' in their uid (there is one in there I promise ;) )

gpg --import-options import-export --import-filter keep-uid='uid =~ Tails' --armor --import Keys3.asc

However it is outputting all of the keys contained in Keys3.asc, rather than just the Tails one. The problem is the same whether or not I include the --armor option.

By way of testing, these commands work as expected:
gpg --import-filter keep-uid='uid =~ Tails' --import Keys3.asc
gpg --import-options import-show --import-filter keep-uid='uid =~ Tails' --import Keys3.asc

The following do not work as expected:
gpg --dry-run --import-options import-show --import-filter keep-uid='uid =~ Tails' --import Keys3.asc
gpg --import-options show-only --import-filter keep-uid='uid =~ Tails' --import Keys3.asc

Look forward to hearing your suggestions. Thanks in advance :), Bill

  1. Support Staff 1 Posted by Steve on 25 May, 2020 12:12 PM

    Steve's Avatar

    Hi mrfreeze,

    welcome to the GPGTools support platform. Sorry you are having problems using GPG Suite.

    This question is best asked at the gnupg users mailling list.

    If you discover a solution to this problem, you are welcome to share it in a follow up so that other users searching the web can discover it more easily.

    All the best,

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac