.ie \n(.g .ds Aq \(aq .el .ds Aq ' .TH filter 1 "July 2022" "sq 0.26.0" "Sequoia Manual" .SH NAME filter \- Joins keys into a keyring applying a filter .SH SYNOPSIS \fBfilter\fR [\fB\-o\fR|\fB\-\-output\fR] [\fB\-\-userid\fR] [\fB\-\-name\fR] [\fB\-\-email\fR] [\fB\-\-domain\fR] [\fB\-\-handle\fR] [\fB\-P\fR|\fB\-\-prune\-certs\fR] [\fB\-B\fR|\fB\-\-binary\fR] [\fB\-\-to\-cert\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIFILE\fR] .SH DESCRIPTION Joins keys into a keyring applying a filter .PP 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. .PP If no filters are supplied, everything matches. .PP If multiple predicates are given, they are or\*(Aqed, 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. .SH OPTIONS .TP \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR Writes to FILE or stdout if omitted .TP \fB\-\-userid\fR=\fIUSERID\fR Case\-sensitively matches on the user id, requiring an exact match. .TP \fB\-\-name\fR=\fINAME\fR Parses user ids into name and email and case\-sensitively matches on the name, requiring an exact match. .TP \fB\-\-email\fR=\fIADDRESS\fR Parses user ids into name and email address and case\-sensitively matches on the email address, requiring an exact match. .TP \fB\-\-domain\fR=\fIFQDN\fR Parses user ids into name and email address and case\-sensitively matches on the domain of the email address, requiring an exact match. .TP \fB\-\-handle\fR=\fIFINGERPRINT|KEYID\fR Matches on both primary keys and subkeys, including those certificates that match the given fingerprint or key id. .TP \fB\-P\fR, \fB\-\-prune\-certs\fR Removes certificate components not matching the filter .TP \fB\-B\fR, \fB\-\-binary\fR Emits binary data .TP \fB\-\-to\-cert\fR 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. .TP \fB\-h\fR, \fB\-\-help\fR Print help information .TP [\fIFILE\fR] Reads from FILE or stdin if omitted .SH EXAMPLES Converts a key to a cert (i.e., remove any secret key material) .PP .nf .RS sq keyring filter \-\-to\-cert cat juliet.pgp .RE .fi .PP Gets the keys with a user id on example.org .PP .nf .RS sq keyring filter \-\-domain example.org keys.pgp .RE .fi .PP Gets the keys with a user id on example.org or example.net .PP .nf .RS sq keyring filter \-\-domain example.org \-\-domain example.net keys.pgp .RE .fi .PP Gets the keys with a user id with the name Juliet .PP .nf .RS sq keyring filter \-\-name Juliet keys.pgp .RE .fi .PP Gets the keys with a user id with the name Juliet on example.org .PP .nf .RS sq keyring filter \-\-domain example.org keys.pgp | \\ .RE .fi sq keyring filter \-\-name Juliet .PP Gets the keys with a user id on example.org, pruning other userids .PP .nf .RS sq keyring filter \-\-domain example.org \-\-prune\-certs certs.pgp .RE .fi .SH "SEE ALSO" For the full documentation see . .PP sq(1) sq\-armor(1) sq\-autocrypt(1) sq\-certify(1) sq\-dearmor(1) sq\-decrypt(1) sq\-encrypt(1) sq\-inspect(1) sq\-key(1) sq\-keyring(1) sq\-keyring\-join(1) sq\-keyring\-list(1) sq\-keyring\-merge(1) sq\-keyring\-split(1) sq\-keyserver(1) sq\-packet(1) sq\-revoke(1) sq\-sign(1) sq\-verify(1) sq\-wkd(1)