SQ(1)

NAME
sq keyring filter - Joins keys into a keyring applying a filter

SYNOPSIS
sq [GLOBAL OPTIONS] keyring filter [OPTIONS] FILE

DESCRIPTION
Joins keys into a keyring applying a filter.

This can be used to filter keys based on given predicates, e.g. whether they have a user id containing an email address with a certain domain. Additionally, the keys can be pruned to only include components matching the predicates.

If no filters are supplied, everything matches.

If multiple predicates are given, they are or'ed, i.e. a key matches if any of the predicates match. To require all predicates to match, chain multiple invocations of this command. See EXAMPLES for inspiration.

OPTIONS

  Global options

-f, --force
    Overwrites existing files

--help
    Print help information

--known-notation=NOTATION
    Adds NOTATION to the list of known notations

--output-format=FORMAT
    Produces output in FORMAT, if possible

--output-version=VERSION
    Produces output variant VERSION.

--version
    Print version information

  Subcommand options

-B, --binary
    Emits binary data

-P, --prune-certs
    Removes certificate components not matching the filter

--domain=FQDN
    Matches on email domain FQDN

--email=ADDRESS
    Matches on email ADDRESS

--handle=FINGERPRINT|KEYID
    Matches on (sub)key fingerprints and key ids

--help
    Print help information

--name=NAME
    Matches on NAME

-o, --output=FILE
    Writes to FILE or stdout if omitted

--to-cert
    Converts any keys in the input to certificates. Converting a key to a certificate removes secret key material from the key thereby turning it into a certificate.

--userid=USERID
    Matches on USERID

--version
    Print version information

EXAMPLES

Converts a key to a cert (i.e., remove any secret key material)

    sq keyring filter --to-cert cat juliet.pgp

Gets the keys with a user id on example.org

    sq keyring filter --domain example.org keys.pgp

Gets the keys with a user id on example.org or example.net

    sq keyring filter --domain example.org --domain example.net keys.pgp

Gets the keys with a user id with the name Juliet

    sq keyring filter --name Juliet keys.pgp

Gets the keys with a user id with the name Juliet on example.org

    sq keyring filter --domain example.org keys.pgp | \

  sq keyring filter --name Juliet

Gets the keys with a user id on example.org, pruning other userids

    sq keyring filter --domain example.org --prune-certs certs.pgp

SEE ALSO
sq(1).

For the full documentation see <https://docs.sequoia-pgp.org/sq/>.

VERSION
0.28.0 (sequoia-openpgp 1.13.0, using Nettle)