File: gpgme.info, Node: Deleting Keys, Next: Changing Passphrases, Prev: Importing Keys, Up: Key Management 7.5.9 Deleting Keys ------------------- -- Function: gpgme_error_t gpgme_op_delete_ext (gpgme_ctx_t CTX, const gpgme_key_t KEY, unsigned int FLAGS) SINCE: 1.9.1 The function ‘gpgme_op_delete_ext’ deletes the key KEY from the key ring of the crypto engine used by CTX. FLAGS can be set to the bit-wise OR of the following flags: ‘GPGME_DELETE_ALLOW_SECRET’ SINCE: 1.9.1 If not set, only public keys are deleted. If set, secret keys are deleted as well, if that is supported. ‘GPGME_DELETE_FORCE’ SINCE: 1.9.1 If set, the user is not asked to confirm the deletion. The function returns the error code ‘GPG_ERR_NO_ERROR’ if the key was deleted successfully, ‘GPG_ERR_INV_VALUE’ if CTX or KEY is not a valid pointer, ‘GPG_ERR_NO_PUBKEY’ if KEY could not be found in the keyring, ‘GPG_ERR_AMBIGUOUS_NAME’ if the key was not specified unambiguously, and ‘GPG_ERR_CONFLICT’ if the secret key for KEY is available, but ALLOW_SECRET is zero. -- Function: gpgme_error_t gpgme_op_delete_ext_start (gpgme_ctx_t CTX, const gpgme_key_t KEY, unsigned int FLAGS) SINCE: 1.9.1 The function ‘gpgme_op_delete_ext_start’ initiates a ‘gpgme_op_delete’ operation. It can be completed by calling ‘gpgme_wait’ on the context. *Note Waiting For Completion::. The function returns the error code ‘GPG_ERR_NO_ERROR’ if the operation was started successfully, and ‘GPG_ERR_INV_VALUE’ if CTX or KEY is not a valid pointer. The following functions allow only to use one particular flag. -- Function: gpgme_error_t gpgme_op_delete (gpgme_ctx_t CTX, const gpgme_key_t KEY, int ALLOW_SECRET) Similar to ‘gpgme_op_delete_ext’, but only the flag ‘GPGME_DELETE_ALLOW_SECRET’ can be provided. -- Function: gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t CTX, const gpgme_key_t KEY, int ALLOW_SECRET) Similar to ‘gpgme_op_delete_ext_start’, but only the flag ‘GPGME_DELETE_ALLOW_SECRET’ can be provided.