1 |
/* wptKeyEditDlgs.cpp - GPG key edit dialogs |
/* wptKeyEditDlgs.cpp - GPG key edit dialogs |
2 |
* Copyright (C) 2002-2004 Timo Schulz |
* Copyright (C) 2002-2005 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
486 |
listbox_add_string( lb, "ElGamal (encrypt only)" ); |
listbox_add_string( lb, "ElGamal (encrypt only)" ); |
487 |
listbox_add_string( lb, "RSA (sign only)"); |
listbox_add_string( lb, "RSA (sign only)"); |
488 |
listbox_add_string( lb, "RSA (encrypt only)" ); |
listbox_add_string( lb, "RSA (encrypt only)" ); |
|
if (reg_prefs.expert) |
|
|
listbox_add_string (lb, "RSA (sign and encrypt)"); |
|
489 |
SetDlgItemInt( dlg, IDC_ADDSUBKEY_VALID, 0, FALSE ); |
SetDlgItemInt( dlg, IDC_ADDSUBKEY_VALID, 0, FALSE ); |
490 |
SetDlgItemInt( dlg, IDC_ADDSUBKEY_SIZE, 2048, FALSE ); |
SetDlgItemInt( dlg, IDC_ADDSUBKEY_SIZE, 2048, FALSE ); |
491 |
SetForegroundWindow( dlg ); |
SetForegroundWindow( dlg ); |
504 |
lb = GetDlgItem( dlg, IDC_ADDSUBKEY_ALGO ); |
lb = GetDlgItem( dlg, IDC_ADDSUBKEY_ALGO ); |
505 |
switch (listbox_get_cursel (lb)) { |
switch (listbox_get_cursel (lb)) { |
506 |
case 0: index = 2; break; |
case 0: index = 2; break; |
507 |
case 1: index = 3; break; |
case 1: index = 4; break; |
508 |
case 2: index = 4; break; |
case 2: index = 5; break; |
509 |
case 3: index = 5; break; |
case 3: index = 6; break; |
|
case 4: index = 6; break; |
|
510 |
default: |
default: |
511 |
msg_box( dlg, _("Please select one entry."), _("Add Subkey"), MB_ERR ); |
msg_box( dlg, _("Please select one entry."), _("Add Subkey"), MB_ERR ); |
512 |
return FALSE; |
return FALSE; |
546 |
keygen->bits = size; |
keygen->bits = size; |
547 |
switch (index) { |
switch (index) { |
548 |
case 2: keygen->algo = GPGME_PK_DSA; break; |
case 2: keygen->algo = GPGME_PK_DSA; break; |
549 |
case 3: keygen->algo = GPGME_PK_ELG_E; break; |
case 4: keygen->algo = GPGME_PK_ELG_E; break; |
550 |
case 4: keygen->algo = GPGME_PK_RSA_S; break; |
case 5: keygen->algo = GPGME_PK_RSA_S; break; |
551 |
case 5: keygen->algo = GPGME_PK_RSA_E; break; |
case 6: keygen->algo = GPGME_PK_RSA_E; break; |
|
case 6: keygen->algo = GPGME_PK_RSA; break; |
|
552 |
} |
} |
553 |
if (valid) |
if (valid) |
554 |
keygen->expire = time (NULL) + valid*24*60*60; |
keygen->expire = time (NULL) + valid*24*60*60; |