26 |
#include <time.h> |
#include <time.h> |
27 |
|
|
28 |
#include "wptGPG.h" |
#include "wptGPG.h" |
29 |
|
#include "wptGPGME.h" |
30 |
#include "wptGpgCmds.h" |
#include "wptGpgCmds.h" |
31 |
#include "wptTypes.h" |
#include "wptTypes.h" |
32 |
#include "wptNLS.h" |
#include "wptNLS.h" |
876 |
|
|
877 |
|
|
878 |
int |
int |
879 |
|
gnupg_import_keypair (void) |
880 |
|
{ |
881 |
|
const char *file; |
882 |
|
gpgme_error_t err; |
883 |
|
GPGME gpgme; |
884 |
|
HWND hwnd = GetDesktopWindow (); |
885 |
|
|
886 |
|
file = get_fileopen_dlg (hwnd, _("Please choose your Key Pair"), |
887 |
|
"GPG Key File (*.gpg)\0*.gpg\0" |
888 |
|
"GPG Armored Key File (*.asc)\0*.asc\0\0", |
889 |
|
NULL); |
890 |
|
if (file == NULL) |
891 |
|
return WPTERR_FILE_OPEN; |
892 |
|
err = gpgme.importFromFile (file); |
893 |
|
if (err) |
894 |
|
msg_box (hwnd, gpgme_strerror (err), _("WinPT Error"), MB_ERR); |
895 |
|
else |
896 |
|
msg_box (hwnd, _("Key pair successfully imported."), "WinPT", MB_OK); |
897 |
|
return 0; |
898 |
|
} |
899 |
|
|
900 |
|
int |
901 |
gnupg_copy_keyrings (void) |
gnupg_copy_keyrings (void) |
902 |
{ |
{ |
903 |
const char *pring, *sring; |
const char *pring, *sring; |