gnupg: GPGSM LISTKEYS
5.6.6 List available keys
-------------------------
To list the keys in the internal database or using an external key
provider, the command:
LISTKEYS PATTERN
is used. To allow multiple patterns (which are ORed during the
search) quoting is required: Spaces are to be translated into "+" or
into "%20"; in turn this requires that the usual escape quoting rules
are done.
LISTSECRETKEYS PATTERN
Lists only the keys where a secret key is available.
The list commands are affected by the option
OPTION list-mode=MODE
where mode may be:
'0'
Use default (which is usually the same as 1).
'1'
List only the internal keys.
'2'
List only the external keys.
'3'
List internal and external keys.
Note that options are valid for the entire session.