1 |
/* wptKeylist.h - Keylist element |
2 |
* Copyright (C) 2001-2004 Timo Schulz |
3 |
* |
4 |
* This file is part of WinPT. |
5 |
* |
6 |
* WinPT is free software; you can redistribute it and/or |
7 |
* modify it under the terms of the GNU General Public License |
8 |
* as published by the Free Software Foundation; either version 2 |
9 |
* of the License, or (at your option) any later version. |
10 |
* |
11 |
* WinPT is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
* General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with WinPT; if not, write to the Free Software Foundation, |
18 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#ifndef WPT_KEYLIST_H |
22 |
#define WPT_KEYLIST_H |
23 |
|
24 |
enum { |
25 |
KEYLIST_ALL = 0, |
26 |
KEYLIST_LIST = 1, |
27 |
KEYLIST_ENCRYPT = 2, |
28 |
KEYLIST_ENCRYPT_MIN = 4, |
29 |
KEYLIST_SIGN = 8, |
30 |
KEYLIST_FLAG_FILE = 16, |
31 |
KEYLIST_FLAG_SHORT = 32, |
32 |
}; |
33 |
|
34 |
enum { |
35 |
KEYFLAG_NONE = 0, |
36 |
KEYFLAG_EXPIRED = 1, |
37 |
KEYFLAG_REVOKED = 2, |
38 |
KEYFLAG_DISABLED = 4 |
39 |
}; |
40 |
|
41 |
|
42 |
struct siglog_context_s { |
43 |
char file[1024]; |
44 |
gpgme_sig_t sig; |
45 |
unsigned use_uid:1; |
46 |
const char * user_id; |
47 |
}; |
48 |
typedef struct siglog_context_s *siglog_context_t; |
49 |
|
50 |
/*-- keylist.c --*/ |
51 |
const char * get_key_algo( gpgme_key_t key, int keyidx ); |
52 |
const char * get_key_created( long timestamp ); |
53 |
const char * get_key_expire_date( long timestamp ); |
54 |
const char * get_key_type( gpgme_key_t key ); |
55 |
const char * get_key_size( gpgme_key_t key, int keyidx ); |
56 |
const char * get_key_fpr( gpgme_key_t key ); |
57 |
const char * get_key_trust (gpgme_key_t key, int uididx, int listmode); |
58 |
const char * get_key_trust_str (int val); |
59 |
int find_secret_key( gpgme_key_t key ); |
60 |
|
61 |
listview_ctrl_t keylist_load( HWND ctrl, gpgme_keycache_t pubkc, gpgme_keycache_t seckc, |
62 |
int mode, int sortby ); |
63 |
int keylist_reload( listview_ctrl_t lv, gpgme_keycache_t c, int mode, int sortby ); |
64 |
void keylist_delete( listview_ctrl_t lv ); |
65 |
gpgme_recipients_t keylist_get_recipients( listview_ctrl_t lv, |
66 |
int *r_force_trust, int *r_count ); |
67 |
gpgme_recipients_t keylist_enum_recipients( listview_ctrl_t lv, int listype ); |
68 |
int keylist_sort( listview_ctrl_t lv, int sortby ); |
69 |
|
70 |
/*-- wptImportList.cpp --*/ |
71 |
int implist_build( listview_ctrl_t *lv, HWND ctrl ); |
72 |
int implist_load( listview_ctrl_t lv, const char *file, |
73 |
int *r_revcerts, int *r_seckeys ); |
74 |
void implist_delete( listview_ctrl_t lv ); |
75 |
|
76 |
/*-- wptSigList.cpp --*/ |
77 |
listview_ctrl_t siglist_load( HWND ctrl, const char *keyid ); |
78 |
void siglist_delete( listview_ctrl_t lv ); |
79 |
|
80 |
/*-- wptVerifyList.cpp --*/ |
81 |
int verlist_build( listview_ctrl_t *lv, HWND ctrl, int fm_mode); |
82 |
void verlist_delete( listview_ctrl_t lv ); |
83 |
void verlist_alloc( listview_ctrl_t lv, int nentries ); |
84 |
int verlist_add_sig( listview_ctrl_t lv, gpgme_sig_t sig ); |
85 |
int verlist_add_sig_log( listview_ctrl_t lv, siglog_context_t log ); |
86 |
|
87 |
/*-- seclist --*/ |
88 |
struct keylist_s { |
89 |
struct keylist_s * next; |
90 |
gpgme_key_t key; |
91 |
}; |
92 |
typedef struct keylist_s * keylist_t; |
93 |
|
94 |
void seclist_destroy (keylist_t * list); |
95 |
void seclist_init (HWND dlg, int ctlid, int flags, keylist_t * ret_list); |
96 |
int seclist_select_key (HWND dlg, int ctlid, gpgme_key_t * ret_key); |
97 |
|
98 |
#endif /* WPT_KEYLIST_H */ |