22 |
#define WPT_GPG_H |
#define WPT_GPG_H |
23 |
|
|
24 |
#include "w32gpgme.h" |
#include "w32gpgme.h" |
25 |
|
#include "wptKeyCache.h" |
26 |
#include "wptNLS.h" |
#include "wptNLS.h" |
27 |
|
|
28 |
|
|
30 |
|
|
31 |
#define key_is_useable(key) (!(key)->revoked && !(key)->expired && !(key)->disabled) |
#define key_is_useable(key) (!(key)->revoked && !(key)->expired && !(key)->disabled) |
32 |
|
|
33 |
enum { |
enum setup_t { |
34 |
SETUP_KEYGEN = 1, |
SETUP_KEYGEN = 1, |
35 |
SETUP_IMPORT = 2, |
SETUP_IMPORT = 2, |
36 |
SETUP_EXISTING = 3 |
SETUP_EXISTING = 3 |
37 |
}; |
}; |
38 |
|
|
39 |
enum { |
enum gpg_cmd_t { |
40 |
GPG_CMD_DECRYPT = 0, |
GPG_CMD_DECRYPT = 0, |
41 |
GPG_CMD_SIGN = 1 |
GPG_CMD_SIGN = 1 |
42 |
}; |
}; |
43 |
|
|
44 |
enum { |
enum keycache_t { |
45 |
KEYCACHE_PRV = 0, |
KEYCACHE_PRV = 0, |
46 |
KEYCACHE_PUB = 1 |
KEYCACHE_PUB = 1 |
47 |
}; |
}; |
48 |
|
|
49 |
enum { |
enum entry_t { |
50 |
ENTRY_OPAQUE = 1, |
ENTRY_OPAQUE = 1, |
51 |
ENTRY_SINGLE = 2, |
ENTRY_SINGLE = 2, |
52 |
ENTRY_MULTI = 3, |
ENTRY_MULTI = 3, |
108 |
}; |
}; |
109 |
|
|
110 |
struct passphrase_cb_s { |
struct passphrase_cb_s { |
111 |
int gpg_cmd; |
int gpg_cmd; /* sign or decrypt. */ |
112 |
int pwd_init; |
int pwd_init; /* 1 = passphrase request via dialog. */ |
113 |
char *pwd; |
char *pwd; /* actual passphrase. */ |
114 |
char info[1024]; /* hold up the info message */ |
char info[1024]; /* hold up the info message */ |
115 |
char *title; |
char *title; /* dialog title. */ |
116 |
char keyid[16+1]; |
char keyid[16+1]; /* keyid of the secret key the pwd can be used for. */ |
117 |
HWND hwnd; |
HWND hwnd; /* handle of the dialog window. */ |
118 |
int cancel; |
int cancel; /* 1 = user cancelled passphrase request. */ |
119 |
unsigned int is_card:1; |
unsigned int is_card:1; /* 1 = key stored on a smart card. */ |
120 |
unsigned int bad_pwd:1; |
unsigned int bad_pwd:1; /* 1 = last passphrase was bad. */ |
121 |
gpgme_ctx_t gpg; |
gpgme_ctx_t gpg; |
122 |
|
gpgme_recipient_t recipients; |
123 |
struct { |
struct { |
124 |
int sym_algo; |
int sym_algo; |
125 |
int s2k_mode; |
int s2k_mode; |
165 |
void init_gnupg_table (void); |
void init_gnupg_table (void); |
166 |
void free_gnupg_table (void); |
void free_gnupg_table (void); |
167 |
int keyring_check_last_access (void); |
int keyring_check_last_access (void); |
168 |
const char* gnupg_check_file_ext (const char * fname); |
const char* gnupg_check_file_ext (const char *fname, int *r_type); |
169 |
int gpg_check_permissions (int showmsg); |
int gpg_check_permissions (int showmsg); |
170 |
int gnupg_check_homedir (void); |
int gnupg_check_homedir (void); |
171 |
int gnupg_access_keyring (int _pub); |
int gnupg_access_keyring (int _pub); |
219 |
void release_group( gpg_group_t grp ); |
void release_group( gpg_group_t grp ); |
220 |
|
|
221 |
/*-- wptPassphraseCB.cpp --*/ |
/*-- wptPassphraseCB.cpp --*/ |
222 |
enum { |
enum passdlg_t { |
223 |
PASSDLG_REPEAT = 0, |
PASSDLG_REPEAT = 0, |
224 |
PASSDLG_INIT = 1, |
PASSDLG_INIT = 1, |
225 |
PASSDLG_STRICT = 2 |
PASSDLG_STRICT = 2 |
248 |
char **r_revcert); |
char **r_revcert); |
249 |
gpgme_error_t gpg_decode_c_string (const char *src, char **destp, size_t len); |
gpgme_error_t gpg_decode_c_string (const char *src, char **destp, size_t len); |
250 |
gpgme_error_t gpg_import_key_list (const char *fname, char **r_out); |
gpgme_error_t gpg_import_key_list (const char *fname, char **r_out); |
251 |
|
gpgme_error_t get_uat_validity (const char *keyid, gpgme_validity_t *r_valid); |
252 |
|
|
253 |
#endif /* WPT_GPG_H */ |
#endif /* WPT_GPG_H */ |