Next: , Up: Trust Item Management


7.5.1 Listing Trust Items

— Function: gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level)

The function gpgme_op_trustlist_start initiates a trust item listing operation inside the context ctx. It sets everything up so that subsequent invocations of gpgme_op_trustlist_next return the trust items in the list.

The string pattern contains an engine specific expression that is used to limit the list to all trust items matching the pattern. It can not be the empty string.

The argument max_level is currently ignored.

The context will be busy until either all trust items are received (and gpgme_op_trustlist_next returns GPG_ERR_EOF), or gpgme_op_trustlist_end is called to finish the operation.

The function returns the error code GPG_ERR_INV_VALUE if ctx is not a valid pointer, and passes through any errors that are reported by the crypto engine support routines.

— Function: gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item)

The function gpgme_op_trustlist_next returns the next trust item in the list created by a previous gpgme_op_trustlist_start operation in the context ctx. The trust item can be destroyed with gpgme_trust_item_release. See Manipulating Trust Items.

This is the only way to get at gpgme_trust_item_t objects in GPGME.

If the last trust item in the list has already been returned, gpgme_op_trustlist_next returns GPG_ERR_EOF.

The function returns the error code GPG_ERR_INV_VALUE if ctx or r_item is not a valid pointer, and GPG_ERR_ENOMEM if there is not enough memory for the operation.

— Function: gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx)

The function gpgme_op_trustlist_next ends a pending key list operation in the context ctx.

The function returns the error code GPG_ERR_INV_VALUE if ctx is not a valid pointer, and GPG_ERR_ENOMEM if at some time during the operation there was not enough memory available.