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

Diff of /trunk/Include/wptKeyCache.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 146 by twoaday, Fri Jan 13 14:20:51 2006 UTC revision 214 by twoaday, Sun May 14 18:40:36 2006 UTC
# Line 20  Line 20 
20  #ifndef WPT_KEYCACHE_H  #ifndef WPT_KEYCACHE_H
21  #define WPT_KEYCACHE_H  #define WPT_KEYCACHE_H
22    
23    #include <gpgme.h>
24    
25    struct gpg_desig_rev_s;
26    typedef struct gpg_desig_rev_s *gpg_desig_rev_t;
27    
28    /* key cache specific update flags. */
29    enum keycache_flag_t {
30        KC_FLAG_ADD = 1,
31        KC_FLAG_UPD = 2
32    };
33    
34    /* key specifc attributes. */
35    enum keycache_attr_t {
36        KC_ATTR_PREFSYM     = 11,
37        KC_ATTR_PREFKSERV   = 24
38    };
39    
40    
41    /* contains the UTF8 decoded user id. */
42    struct native_uid_s {
43        struct native_uid_s *next;
44        unsigned int malloced:1;        /* 1 if the follow parts are actually
45                                           malloced or just referenced pointer. */
46        unsigned int revoked : 1;
47        gpgme_validity_t validity;
48    
49        gpgme_key_sig_t signatures;
50    
51        char *uid;
52        char *name;
53        char *comment;
54        char *email;
55    };
56    
57    
58  struct keycache_s {  struct keycache_s {
59      struct keycache_s * next;      struct keycache_s *next;
60      int flags;      int flags;
61      gpgme_key_t key;                    /* actual key context. */      gpgme_key_t key;                    /* actual key context. */
62        unsigned int default_key:1;         /* default signing key. */
63      struct keycache_s *pubpart;         /* corresponding public key. */      struct keycache_s *pubpart;         /* corresponding public key. */
64      struct {      struct {
65          unsigned int is_protected:1;    /* key is protected. */          unsigned int is_protected:1;    /* key is protected. */
# Line 37  struct keycache_s { Line 73  struct keycache_s {
73          gpgme_validity_t validity;  /* attribute id validity. */          gpgme_validity_t validity;  /* attribute id validity. */
74      } attrib;      } attrib;
75      unsigned char *sym_prefs;/* symmetric cipher preferences. */      unsigned char *sym_prefs;/* symmetric cipher preferences. */
76        char *pref_keyserver;   /* if != NULL preferred keyserver. */
77        unsigned short pref_keyserver_port;
78      char *card_type;        /* if != NULL key stored on smart card. */      char *card_type;        /* if != NULL key stored on smart card. */
79        struct native_uid_s *uids;
80        gpg_desig_rev_t rev;        /* if != NULL list of desig revokers. */
81  };  };
82    
83  struct gpg_keycache_s {      struct gpg_keycache_s {    
# Line 45  struct gpg_keycache_s { Line 85  struct gpg_keycache_s {
85      struct keycache_s *tmp;      struct keycache_s *tmp;
86      int secret;      int secret;
87      int pos;      int pos;
88      void (*cb) (void *, const char *, int, int, int);      void (*cb) (void*, const char*, int, int, int);
89      void *cb_value;      void *cb_value;
90      int cb_value2;      int cb_value2;
91  };  };
# Line 55  gpgme_error_t gpg_keycache_new (gpg_keyc Line 95  gpgme_error_t gpg_keycache_new (gpg_keyc
95  void gpg_keycache_release (gpg_keycache_t ctx);  void gpg_keycache_release (gpg_keycache_t ctx);
96  void gpg_keycache_set_cb (gpg_keycache_t ctx,  void gpg_keycache_set_cb (gpg_keycache_t ctx,
97                              void (*cb)(void *, const char *, int, int, int),                              void (*cb)(void *, const char *, int, int, int),
98                              void * cb_value1, int cb_value2);                              void* cb_value1, int cb_value2);
99  void gpg_keycache_rewind (gpg_keycache_t ctx);  void gpg_keycache_rewind (gpg_keycache_t ctx);
100  int gpg_keycache_get_size (gpg_keycache_t ctx);  int gpg_keycache_get_size (gpg_keycache_t ctx);
101  gpgme_error_t gpg_keycache_add_key (gpg_keycache_t ctx, gpgme_key_t key,  gpgme_error_t gpg_keycache_add_key (gpg_keycache_t ctx, gpgme_key_t key,
102                                        void **opaque);                                        void **opaque);
103  gpgme_error_t gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec,  gpgme_error_t gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec,
104                                           void *opaque, const char *keyid);                                           void *opaque, const char *keyid);
105  gpgme_error_t gpg_keycache_find_key (gpg_keycache_t ctx, const char * pattern,  gpgme_error_t gpg_keycache_find_key (gpg_keycache_t ctx, const char *pattern,
106                                         int flags, gpgme_key_t * r_key);                                         int flags, gpgme_key_t * r_key);
107  gpgme_error_t gpg_keycache_find_key2 (gpg_keycache_t ctx, const char *pattern, int flags,  gpgme_error_t gpg_keycache_find_key2 (gpg_keycache_t ctx,
108                                          gpgme_key_t *r_key, struct keycache_s **r_item);                                        const char *pattern, int flags,
109                                            gpgme_key_t *r_key,
110                                            struct keycache_s **r_item);
111  gpgme_error_t gpg_keycache_delete_key (gpg_keycache_t ctx,  gpgme_error_t gpg_keycache_delete_key (gpg_keycache_t ctx,
112                                           const char * pattern);                                           const char * pattern);
113  gpgme_error_t gpg_keycache_init (gpg_keycache_t ctx, const char * pattern,  gpgme_error_t gpg_keycache_init (gpg_keycache_t ctx, const char * pattern,
114                                     int secret);                                     int secret);
115  gpgme_error_t gpg_keycache_next_key (gpg_keycache_t ctx, int flags,  gpgme_error_t gpg_keycache_next_key (gpg_keycache_t ctx, int flags,
116                                         gpgme_key_t * r_key);                                         gpgme_key_t * r_key);
117    gpgme_error_t gpg_keycache_next_key2 (gpg_keycache_t ctx, int flags,
118                                         struct keycache_s **c, gpgme_key_t *r_key);
119  gpgme_error_t gpg_keycache_prepare (gpg_keycache_t ctx,  gpgme_error_t gpg_keycache_prepare (gpg_keycache_t ctx,
120                                        const char *pubring, const char * secring);                                        const char *pubring,
121                                          const char *secring);
122  gpgme_error_t gpg_keycache_prepare_single (gpg_keycache_t ctx,  gpgme_error_t gpg_keycache_prepare_single (gpg_keycache_t ctx,
123                                               const char *keyid,                                               const char *keyid,
124                                               const char *pubr,                                               const char *pubr,
125                                               const char *secr);                                               const char *secr);
126  gpgme_error_t gpg_keycache_sync (gpg_keycache_t pub, gpg_keycache_t sec);  gpgme_error_t gpg_keycache_sync (gpg_keycache_t pub, gpg_keycache_t sec);
127  gpgme_error_t gpg_keycache_next_updated_key (gpg_keycache_t ctx,  gpgme_error_t gpg_keycache_next_updated_key (gpg_keycache_t ctx,
128                                               struct keycache_s **r_obj);                                               struct keycache_s **r_obj,
129                                                 int *r_status);
130    gpgme_error_t gpg_keycache_set_default_key (gpg_keycache_t ctx,
131                                                const char *pattern);
132    gpgme_error_t gpg_keycache_get_default_key (gpg_keycache_t ctx,
133                                                gpgme_key_t *r_key);
134    gpgme_error_t gpg_keycache_update_attr (struct keycache_s *item,
135                                            int attr, int force);
136    
137  #endif /*WPT_KEYCACHE_H*/  #endif /*WPT_KEYCACHE_H*/

Legend:
Removed from v.146  
changed lines
  Added in v.214

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26