62 |
get_keyinfo (gpgme_key_t key) |
get_keyinfo (gpgme_key_t key) |
63 |
{ |
{ |
64 |
static char buf[64+16]; |
static char buf[64+16]; |
65 |
|
struct winpt_key_s k; |
66 |
|
|
67 |
|
memset (&k, 0, sizeof (k)); |
68 |
|
winpt_get_seckey (key->subkeys->keyid, &k); |
69 |
_snprintf (buf, DIM (buf)-1-16, "%d-bit %s key, ID %s", |
_snprintf (buf, DIM (buf)-1-16, "%d-bit %s key, ID %s", |
70 |
key->subkeys->length, |
key->subkeys->length, |
71 |
key->subkeys->pubkey_algo, |
get_key_pubalgo (key->subkeys->pubkey_algo), |
72 |
key->subkeys->keyid+8); |
key->subkeys->keyid+8); |
73 |
// XXX |
if (k.ext->gloflags.divert_to_card) |
74 |
//if (gpgme_key_get_ulong_attr (key, GPGME_ATTR_DIVERT_CARD, NULL, 0)) |
strcat (buf, " (Card)"); |
|
// strcat (buf, " (Card)"); |
|
75 |
return buf; |
return buf; |
76 |
} |
} |
77 |
|
|
227 |
if (s) |
if (s) |
228 |
uid = utf8_to_wincp (s, strlen (s)); |
uid = utf8_to_wincp (s, strlen (s)); |
229 |
_snprintf (keymsg, sizeof keymsg -1, |
_snprintf (keymsg, sizeof keymsg -1, |
230 |
_("pub %d/%s created: %s expires: %s\n\n" |
_("pub %d/%s created: %s expires: %s\n\n" |
231 |
"Primary key fingerprint: %s\n\n" |
"Primary key fingerprint: %s\n\n" |
232 |
"\t%s\n\n" |
"\t%s\n\n" |
233 |
"\nAre you really sure that you want to sign this key with YOUR key?\n"), |
"\nAre you really sure that you want to sign this key with YOUR key?\n"), |
321 |
ke->setLocalUser (k); |
ke->setLocalUser (k); |
322 |
|
|
323 |
err = ke->signKey (type, sig_class_choice, expires? keymsg : NULL); |
err = ke->signKey (type, sig_class_choice, expires? keymsg : NULL); |
324 |
memset (&pwd, 0, sizeof pwd); |
memset (&pwd, 0, sizeof pwd); |
|
delete ke; |
|
325 |
if (err) { |
if (err) { |
326 |
|
delete ke; |
327 |
msg_box (dlg, gpgme_strerror (err), _("Key Signing"), MB_ERR); |
msg_box (dlg, gpgme_strerror (err), _("Key Signing"), MB_ERR); |
328 |
return TRUE; |
return TRUE; |
329 |
} |
} |
330 |
status_box (dlg, _("Key successfully signed."), PGM_NAME); |
if (ke->getResultValue () != 0) |
331 |
key->update = 1; |
msg_box (dlg, _("This key is already signed by your key"), _("Key Signing"), MB_INFO); |
332 |
|
else { |
333 |
|
status_box (dlg, _("Key successfully signed."), PGM_NAME); |
334 |
|
key->update = 1; |
335 |
|
} |
336 |
|
delete ke; |
337 |
EndDialog (dlg, TRUE); |
EndDialog (dlg, TRUE); |
338 |
return TRUE; |
return TRUE; |
339 |
|
|