gpgme_set_keylist_modechanges the default behaviour of the key listing functions. The value in mode is a bitwise-or combination of one or multiple of the following bit values:
GPGME_KEYLIST_MODE_LOCALsymbol specifies that the local keyring should be searched for keys in the keylisting operation. This is the default.
GPGME_KEYLIST_MODE_EXTERNsymbol specifies that an external source should be searched for keys in the keylisting operation. The type of external source is dependant on the crypto engine used. For example, it can be a remote keyserver or LDAP certificate server.
GPGME_KEYLIST_MODE_SIGSsymbol specifies that the key signatures should be included in the listed keys.
GPGME_KEYLIST_MODE_SIG_NOTATIONSsymbol specifies that the signature notations on key signatures should be included in the listed keys. This only works if
GPGME_KEYLIST_MODE_SIGSis also enabled.
GPGME_KEYLIST_MODE_VALIDATEsymbol specifies that the backend should do key or certificate validation and not just get the validity information from an internal cache. This might be an expensive operation and is in general not useful. Currently only implemented for the S/MIME backend and ignored for other backends.
At least one of
GPGME_KEYLIST_MODE_EXTERNmust be specified. For future binary compatibility, you should get the current mode with
gpgme_get_keylist_modeand modify it by setting or clearing the appropriate bits, and then using that calulcated value in the
gpgme_set_keylisting_modeoperation. This will leave all other bits in the mode value intact (in particular those that are not used in the current version of the library).
The function returns the error code
GPG_ERR_NO_ERRORif the mode could be set correctly, and
GPG_ERR_INV_VALUEif ctx is not a valid pointer or mode is not a valid mode.
gpgme_get_keylist_modereturns the current key listing mode of the context ctx. This value can then be modified and used in a subsequent
gpgme_set_keylist_modeoperation to only affect the desired bits (and leave all others intact).
The function returns 0 if ctx is not a valid pointer, and the current mode otherwise. Note that 0 is not a valid mode value.