/[winpt]/trunk/Include/wptKeyCache.h
ViewVC logotype

Annotation of /trunk/Include/wptKeyCache.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 205 - (hide annotations)
Thu Apr 27 12:46:03 2006 UTC (18 years, 10 months ago) by twoaday
File MIME type: text/plain
File size: 4602 byte(s)
2006-04-27  Timo Schulz  <ts@g10code.de>
                                                                                
        * wptKeyManager.cpp (km_get_key_ptr): New.
        * wptListview.cpp (listview_get_item_text): Drop utf8 support.
        * wptKeyCache.cpp (keycache_decode_uids): New.
        (free_native_uids): New.
        * wptKeyEdit.cpp (uid_inf_colon_handler): Do utf8 decodig here.
                                                                                
2006-04-26  Timo Schulz  <ts@g10code.de>
                                                                                
        * wptKeylist.cpp (get_keyid_from_fpr): New.
        * wptDecryptClipDlg.cpp (clip_decrypt_dlg): Use it here.
        * wptVerifyList.cpp (verlist_add_sig): Likewise.


1 twoaday 38 /* wptKeyCache.h
2 twoaday 146 * Copyright (C) 2005, 2006 Timo Schulz
3 twoaday 38 *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (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
14     * GNU 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     #ifndef WPT_KEYCACHE_H
21     #define WPT_KEYCACHE_H
22    
23 twoaday 205 #include <gpgme.h>
24    
25     /* key cache specific update flags. */
26 twoaday 151 enum keycache_flag_t {
27     KC_FLAG_ADD = 1,
28     KC_FLAG_UPD = 2
29     };
30    
31 twoaday 182 /* key specifc attributes. */
32     enum keycache_attr_t {
33     KC_ATTR_PREFSYM = 11,
34     KC_ATTR_PREFKSERV = 24
35     };
36    
37    
38 twoaday 205 /* contains the UTF8 decoded user id. */
39     struct native_uid_s {
40     struct native_uid_s *next;
41     unsigned int malloced:1; /* 1 if the follow parts are actually
42     malloced or just referenced pointer. */
43     unsigned int revoked : 1;
44     gpgme_validity_t validity;
45    
46     char *uid;
47     char *name;
48     char *comment;
49     char *email;
50     };
51    
52    
53 twoaday 38 struct keycache_s {
54 twoaday 167 struct keycache_s *next;
55 twoaday 38 int flags;
56     gpgme_key_t key; /* actual key context. */
57 twoaday 167 unsigned int default_key:1; /* default signing key. */
58 twoaday 38 struct keycache_s *pubpart; /* corresponding public key. */
59     struct {
60     unsigned int is_protected:1; /* key is protected. */
61     unsigned int divert_to_card:1; /* secret key on card. */
62     unsigned int has_desig_rev:1; /* has desig. revokers. */
63     } gloflags;
64     struct {
65 twoaday 133 unsigned int flags;
66 twoaday 38 unsigned char *d; /* attribute (JPG) data. */
67     unsigned int len; /* attribute data length. */
68     gpgme_validity_t validity; /* attribute id validity. */
69     } attrib;
70     unsigned char *sym_prefs;/* symmetric cipher preferences. */
71 twoaday 182 char *pref_keyserver; /* if != NULL preferred keyserver. */
72 twoaday 38 char *card_type; /* if != NULL key stored on smart card. */
73 twoaday 205 struct native_uid_s *uids;
74 twoaday 38 };
75    
76     struct gpg_keycache_s {
77     struct keycache_s *item;
78     struct keycache_s *tmp;
79     int secret;
80     int pos;
81 twoaday 167 void (*cb) (void*, const char*, int, int, int);
82 twoaday 38 void *cb_value;
83     int cb_value2;
84     };
85     typedef struct gpg_keycache_s *gpg_keycache_t;
86    
87     gpgme_error_t gpg_keycache_new (gpg_keycache_t * r_ctx);
88     void gpg_keycache_release (gpg_keycache_t ctx);
89     void gpg_keycache_set_cb (gpg_keycache_t ctx,
90     void (*cb)(void *, const char *, int, int, int),
91 twoaday 167 void* cb_value1, int cb_value2);
92 twoaday 38 void gpg_keycache_rewind (gpg_keycache_t ctx);
93     int gpg_keycache_get_size (gpg_keycache_t ctx);
94     gpgme_error_t gpg_keycache_add_key (gpg_keycache_t ctx, gpgme_key_t key,
95     void **opaque);
96     gpgme_error_t gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec,
97     void *opaque, const char *keyid);
98 twoaday 167 gpgme_error_t gpg_keycache_find_key (gpg_keycache_t ctx, const char *pattern,
99 twoaday 38 int flags, gpgme_key_t * r_key);
100 twoaday 167 gpgme_error_t gpg_keycache_find_key2 (gpg_keycache_t ctx,
101     const char *pattern, int flags,
102     gpgme_key_t *r_key,
103     struct keycache_s **r_item);
104 twoaday 38 gpgme_error_t gpg_keycache_delete_key (gpg_keycache_t ctx,
105     const char * pattern);
106     gpgme_error_t gpg_keycache_init (gpg_keycache_t ctx, const char * pattern,
107     int secret);
108     gpgme_error_t gpg_keycache_next_key (gpg_keycache_t ctx, int flags,
109     gpgme_key_t * r_key);
110 twoaday 205 gpgme_error_t gpg_keycache_next_key2 (gpg_keycache_t ctx, int flags,
111     struct keycache_s **c, gpgme_key_t *r_key);
112 twoaday 38 gpgme_error_t gpg_keycache_prepare (gpg_keycache_t ctx,
113 twoaday 167 const char *pubring,
114     const char *secring);
115 twoaday 38 gpgme_error_t gpg_keycache_prepare_single (gpg_keycache_t ctx,
116     const char *keyid,
117     const char *pubr,
118     const char *secr);
119     gpgme_error_t gpg_keycache_sync (gpg_keycache_t pub, gpg_keycache_t sec);
120 twoaday 146 gpgme_error_t gpg_keycache_next_updated_key (gpg_keycache_t ctx,
121 twoaday 151 struct keycache_s **r_obj,
122     int *r_status);
123 twoaday 167 gpgme_error_t gpg_keycache_set_default_key (gpg_keycache_t ctx,
124     const char *pattern);
125     gpgme_error_t gpg_keycache_get_default_key (gpg_keycache_t ctx,
126     gpgme_key_t *r_key);
127 twoaday 182 gpgme_error_t gpg_keycache_update_attr (struct keycache_s *item,
128     int attr, int force);
129 twoaday 38
130     #endif /*WPT_KEYCACHE_H*/

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26