diff options
author | Werner Koch <wk@gnupg.org> | 2022-11-25 16:04:54 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2022-11-25 16:04:54 +0100 |
commit | 1324dc3490b02c4ff818655db1474c594f04e4ec (patch) | |
tree | b9c72c1068de3d8e2d7238e2d9a7f3c1e1a82651 /doc | |
parent | dirmngr: Silence ocsp debug output. (diff) | |
download | gnupg2-1324dc3490b02c4ff818655db1474c594f04e4ec.tar.xz gnupg2-1324dc3490b02c4ff818655db1474c594f04e4ec.zip |
gpg: New option --list-filter
* g10/gpg.c (oListFilter): New.
(opts): Add --list-filter.
(main): Parse oListFilter.
* g10/keylist.c: Include init.h and recsel.h.
(struct list_filter_s, list_filter): New.
(release_list_filter): New.
(cleanup_keylist_globals): New.
(parse_and_set_list_filter): New.
(list_keyblock): Implement --list-filter type "select".
* g10/import.c (impex_filter_getval): Add scope support and new
property names "key-size", "algostr", "origin", "lastupd", and "url".
--
This option is pretty useful to select keys based on their properties.
The scope thing can be sued to limit a selection to just the primary
key or to subkeys. For example:
gpg -k --list-filter 'select=revoked-f && sub/algostr=ed25519'
Lists all non-revoked keys with an ed25519 (signing)-subkey.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gpg.texi | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/doc/gpg.texi b/doc/gpg.texi index 25065f8e4..ed75a613a 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -1338,6 +1338,13 @@ Assume "yes" on most questions. Should not be used in an option file. Assume "no" on most questions. Should not be used in an option file. +@item --list-filter @{select=@var{expr}@} +@opindex list-filter +A list filter can be used to output only certain keys during key +listsin command. For the availbale property names, see the description +of @option{--import-filter}. + + @item --list-options @var{parameters} @opindex list-options This is a space or comma delimited string that gives options used when @@ -2550,11 +2557,21 @@ The available filter types are: Self-signatures are not considered. Currently only implemented for --import-filter. + @item select + This filter is only implemented by @option{--list-filter}. All + property names may be used. + @end table For the syntax of the expression see the chapter "FILTER EXPRESSIONS". The property names for the expressions depend on the actual filter -type and are indicated in the following table. +type and are indicated in the following table. Note that all property +names may also be used by @option{--list-filter}. + +Property names may be prefix with a scope delimited by a slash. Valid +scopes are "pub" for public and secret primary keys, "sub" for public +and secret subkeys, "uid" for for user-ID packets, and "sig" for +signature packets. Invalid scopes are currently ignored. The available properties are: @@ -2567,10 +2584,18 @@ The available properties are: The addr-spec part of a user id with mailbox or the empty string. (keep-uid) + @item algostr + A string with the key algorithm description. For example "rsa3072" + or "ed25519". + @item key_algo A number with the public key algorithm of a key or subkey packet. (drop-subkey) + @item key_size + A number with the effective key size of a key or subkey packet. + (drop-subkey) + @item key_created @itemx key_created_d The first is the timestamp a public key or subkey packet was @@ -2593,7 +2618,7 @@ The available properties are: been revoked. @item disabled - Boolean indicating whether a primary key is disabled. (not used) + Boolean indicating whether a primary key is disabled. @item secret Boolean indicating whether a key or subkey is a secret one. @@ -2616,6 +2641,18 @@ The available properties are: @item sig_digest_algo A number with the digest algorithm of a signature packet. (drop-sig) + @item origin + A string with the key origin or a question mark. For example the + string ``wkd'' is used if a key originated from a Web Key Directory + lookup. + + @item lastupd + The timestamp the key was last updated from a keyserver or the Web + Key Directory. + + @item url + A string with the the URL associated wit the last key lookup. + @end table @item --export-options @var{parameters} |