Implement decryption.
* src/agent.h (struct key_info_s, key_info_t): Move to ... * src/cert.h (struct key_info_s): here. * src/agent.c (learn_status_cb): Set usage info. (scute_agent_learn): Use "SCD LEARN" instead of "LEARN" (struct pkdecrypt_parm_s): New. (pkdecrypt_data_cb): New. (pkdecrypt_inq_cb): New. (pkdecrypt_parse_result): New. (scute_agent_decrypt): New. * src/cert-object.c (scute_attr_prv): Set decrypt flag. Replace arg 'grip' by 'kinfo'. Change callers. * src/gpgsm.c (struct search_cb_parm): Replace 'grip' by 'kinfo'. (scute_gpgsm_get_cert): Replace args 'grip' and 'certref' by 'kinfo'. * src/slots.c (struct session): Add 'decryption_key'. Change callers. (slot_create_session): Init decryption_key. (session_sign): Allow NULL for PSIGNATURE but still return the required length. (session_init_decrypt): New. (session_decrypt): New.
Tested with a Yubikey PIV card. Requires recent fix for gpg-agent to
allow for the flags parameter in the decrypt input. That parameter is
actually suggested by Libgcrypt.
- Signed-off-by: Werner Koch <wk@gnupg.org>