diff options
Diffstat (limited to 'src/verify.c')
-rw-r--r-- | src/verify.c | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/src/verify.c b/src/verify.c index 8d87cad3..19ac5d71 100644 --- a/src/verify.c +++ b/src/verify.c @@ -1309,109 +1309,3 @@ gpgme_get_sig_status (gpgme_ctx_t ctx, int idx, *r_created = sig->timestamp; return sig->fpr; } - - -/* Retrieve certain attributes of a signature. IDX is the index - number of the signature after a successful verify operation. WHAT - is an attribute where GPGME_ATTR_EXPIRE is probably the most useful - one. WHATIDX is to be passed as 0 for most attributes . */ -unsigned long -gpgme_get_sig_ulong_attr (gpgme_ctx_t ctx, int idx, - _gpgme_attr_t what, int whatidx) -{ - gpgme_verify_result_t result; - gpgme_signature_t sig; - - (void)whatidx; - - result = gpgme_op_verify_result (ctx); - sig = result->signatures; - - while (sig && idx) - { - sig = sig->next; - idx--; - } - if (!sig || idx) - return 0; - - switch (what) - { - case GPGME_ATTR_CREATED: - return sig->timestamp; - - case GPGME_ATTR_EXPIRE: - return sig->exp_timestamp; - - case GPGME_ATTR_VALIDITY: - return (unsigned long) sig->validity; - - case GPGME_ATTR_SIG_STATUS: - switch (gpg_err_code (sig->status)) - { - case GPG_ERR_NO_ERROR: - return GPGME_SIG_STAT_GOOD; - - case GPG_ERR_BAD_SIGNATURE: - return GPGME_SIG_STAT_BAD; - - case GPG_ERR_NO_PUBKEY: - return GPGME_SIG_STAT_NOKEY; - - case GPG_ERR_NO_DATA: - return GPGME_SIG_STAT_NOSIG; - - case GPG_ERR_SIG_EXPIRED: - return GPGME_SIG_STAT_GOOD_EXP; - - case GPG_ERR_KEY_EXPIRED: - return GPGME_SIG_STAT_GOOD_EXPKEY; - - default: - return GPGME_SIG_STAT_ERROR; - } - - case GPGME_ATTR_SIG_SUMMARY: - return sig->summary; - - default: - break; - } - return 0; -} - - -const char * -gpgme_get_sig_string_attr (gpgme_ctx_t ctx, int idx, - _gpgme_attr_t what, int whatidx) -{ - gpgme_verify_result_t result; - gpgme_signature_t sig; - - result = gpgme_op_verify_result (ctx); - sig = result->signatures; - - while (sig && idx) - { - sig = sig->next; - idx--; - } - if (!sig || idx) - return NULL; - - switch (what) - { - case GPGME_ATTR_FPR: - return sig->fpr; - - case GPGME_ATTR_ERRTOK: - if (whatidx == 1) - return sig->wrong_key_usage ? "Wrong_Key_Usage" : ""; - else - return ""; - default: - break; - } - - return NULL; -} |