SQ(1)

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

SYNOPSIS
sq 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

  Subcommand options

-B, --binary
    Emits binary data

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

--domain=FQDN
    Parses user ids into name and email address and case-sensitively matches on the domain of the email address, requiring an exact match.

--email=ADDRESS
    Parses user ids into name and email address and case-sensitively matches on the email address, requiring an exact match.

--handle=FINGERPRINT|KEYID
    Matches on both primary keys and subkeys, including those certificates that match the given fingerprint or key id.

--name=NAME
    Parses user ids into name and email and case-sensitively matches on the name, requiring an exact match.

-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
    Case-sensitively matches on the user id, requiring an exact match.

FILE
    Reads from FILE or stdin if omitted

  Global options

--cert-store=PATH
    Specifies the location of the certificate store. By default, sq uses the OpenPGP certificate directory at `$HOME/.local/share/pgp.cert.d`, and creates it if it does not exist.

-f, --force
    Overwrites existing files

-h, --help
    Print help (see a summary with '-h')

--keyring=PATH
    Specifies the location of a keyring to use. Keyrings are used in addition to any certificate store. The content of the keyring is not imported into the certificate store. When a certificate is looked up, it is looked up in all keyrings and any certificate store, and the results are merged together.

--known-notation=NOTATION
    Adds NOTATION to the list of known notations. This is used when validating signatures. Signatures that have unknown notations with the critical bit set are considered invalid.

--no-cert-store
    Disables the use of a certificate store. Normally sq uses the user's standard cert-d, which is located in `$HOME/.local/share/pgp.cert.d`.

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

--output-version=VERSION
    Produces output variant VERSION, such as 0.0.0. The default is the newest version. The output version is separate from the version of the sq program. To see the current supported versions, use output-versions subcommand.

--pep-cert-store=PATH
    Specifies the location of a pEp certificate store. sq does not use a pEp certificate store by default; it must be explicitly enabled using this argument or the corresponding environment variable, PEP_CERT_STORE. The pEp Engine's default certificate store is at `$HOME/.pEp/keys.db`.

--time=TIME
    Sets the reference time as an ISO 8601 formatted timestamp. Normally, commands use the current time as the reference time. This argument allows the user to use a difference reference time. For instance, when creating a key using `sq key generate`, the creation time is normally set to the current time, but can be overridden using this option. Similarly, when verifying a message, the message is verified with respect to the current time. This option allows the user to use a different time.

    TIME is interpreted as an ISO 8601 timestamp. To set the certification time to July 21, 2013 at midnight UTC, you can do:

    $ sq --time 20130721 verify msg.pgp

    To include a time, say 5:50 AM, add a T, the time and optionally the timezone (the default timezone is UTC):

    $ sq --time 20130721T0550+0200 verify msg.pgp

--trust-root=FINGERPRINT|KEYID
    Considers the specified certificate to be a trust root. Trust roots are used by trust models, e.g., the Web of Trust, to authenticate certificates and User IDs.

-v, --verbose
    Be more verbose.

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), sq-keyring(1).

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

VERSION
0.33.0 (sequoia-openpgp 1.17.0)