Next: Advanced Key Editing, Previous: Importing Keys, Up: Key Management
The function
gpgme_op_deletedeletes the key key from the key ring of the crypto engine used by ctx. If allow_secret is0, only public keys are deleted, otherwise secret keys are deleted as well, if that is supported.The function returns the error code
GPG_ERR_NO_ERRORif the key was deleted successfully,GPG_ERR_INV_VALUEif ctx or key is not a valid pointer,GPG_ERR_NO_PUBKEYif key could not be found in the keyring,GPG_ERR_AMBIGUOUS_NAMEif the key was not specified unambiguously, andGPG_ERR_CONFLICTif the secret key for key is available, but allow_secret is zero.
The function
gpgme_op_delete_startinitiates agpgme_op_deleteoperation. It can be completed by callinggpgme_waiton the context. See Waiting For Completion.The function returns the error code
GPG_ERR_NO_ERRORif the operation was started successfully, andGPG_ERR_INV_VALUEif ctx or key is not a valid pointer.