The OpenPGP engine features a Trust-On-First-Use (TOFU) key validation model. For resolving conflicts it is necessary to declare the policy for a key. See the GnuPG manual for details on the TOFU implementation.
gpgme_tofu_policy_t type specifies the set of possible
policy values that are supported by GPGME:
Set the policy to “auto”.
Set the policy to “good”.
Set the policy to “bad”.
Set the policy to “ask”.
Set the policy to “unknown”.
To change the policy for a key the following functions can be used:
gpgme_op_tofu_policy changes the TOFU policy of
key. The valid values for policy are listed above. As of
now this function does only work for OpenPGP and requires at least
version 2.1.10 of GnuPG.
The function returns zero on success,
the engine does not support the command, or a bunch of other error
gpgme_op_tofu_policy_start initiates a
gpgme_op_tofu_policy operation. It can be completed by calling
gpgme_wait on the context. See Waiting For Completion.
The function returns
0 if the operation was started successfully,
and an error code if one of the arguments is not valid or the oepration
could not be started.