Next: Sign, Previous: Verify, Up: Crypto Operations
The function
gpgme_op_decrypt_verify
decrypts the ciphertext in the data object cipher and stores it into the data object plain. If cipher contains signatures, they will be verified.After the operation completed,
gpgme_op_decrypt_result
andgpgme_op_verify_result
can be used to retrieve more information about the signatures.If the error code
GPG_ERR_NO_DATA
is returned, cipher does not contain any data to decrypt. However, it might still be signed. The information about detected signatures is available withgpgme_op_verify_result
in this case.The function returns the error code
GPG_ERR_NO_ERROR
if the ciphertext could be decrypted successfully,GPG_ERR_INV_VALUE
if ctx, cipher or plain is not a valid pointer,GPG_ERR_NO_DATA
if cipher does not contain any data to decrypt,GPG_ERR_DECRYPT_FAILED
if cipher is not a valid cipher text,GPG_ERR_BAD_PASSPHRASE
if the passphrase for the secret key could not be retrieved, and passes through any errors that are reported by the crypto engine support routines.
The function
gpgme_op_decrypt_verify_start
initiates agpgme_op_decrypt_verify
operation. It can be completed by callinggpgme_wait
on the context. See Waiting For Completion.The function returns the error code
GPG_ERR_NO_ERROR
if the operation could be started successfully,GPG_ERR_INV_VALUE
if ctx, cipher, plain or r_stat is not a valid pointer, andGPG_ERR_NO_DATA
if cipher does not contain any data to decrypt.