dav/pwd.h

changeset 747
efbd59642577
parent 731
e0358fa1a3b1
equal deleted inserted replaced
746:a569148841ff 747:efbd59642577
30 #define PWD_H 30 #define PWD_H
31 31
32 #include <stdlib.h> 32 #include <stdlib.h>
33 #include <inttypes.h> 33 #include <inttypes.h>
34 34
35 #include <ucx/map.h> 35 #include <cx/map.h>
36 #include <ucx/buffer.h> 36 #include <cx/buffer.h>
37 #include <cx/linked_list.h>
37 #include <libidav/crypto.h> 38 #include <libidav/crypto.h>
38 39
39 #ifdef __cplusplus 40 #ifdef __cplusplus
40 extern "C" { 41 extern "C" {
41 #endif 42 #endif
82 /* 83 /*
83 * map of all credentials 84 * map of all credentials
84 * key is the username 85 * key is the username
85 * value is PwdEntry* 86 * value is PwdEntry*
86 */ 87 */
87 UcxMap *ids; 88 CxMap *ids;
88 89
89 /* 90 /*
90 * list of all credentials with location 91 * list of all credentials with location
91 * value is PwdIndexEntry* 92 * value is PwdIndexEntry*
92 */ 93 */
93 UcxList *locations; 94 CxList *locations;
94 95
95 /* 96 /*
96 * list of all credentials without location 97 * list of all credentials without location
97 * value is PwdIndexEntry* 98 * value is PwdIndexEntry*
98 */ 99 */
99 UcxList *noloc; 100 CxList *noloc;
100 101
101 /* 102 /*
102 * index map that contains all elements from the lists 103 * index map that contains all elements from the lists
103 * 'locations' and 'noloc' 104 * 'locations' and 'noloc'
104 */ 105 */
105 UcxMap *index; 106 CxMap *index;
106 107
107 /* 108 /*
108 * a buffer containing the complete file content 109 * a buffer containing the complete file content
109 */ 110 */
110 UcxBuffer *content; 111 CxBuffer *content;
111 112
112 /* 113 /*
113 * key used for encryption/decryption 114 * key used for encryption/decryption
114 */ 115 */
115 DavKey *key; 116 DavKey *key;
148 char *password; 149 char *password;
149 }; 150 };
150 151
151 struct PwdIndexEntry { 152 struct PwdIndexEntry {
152 char *id; 153 char *id;
153 UcxList *locations; 154 CxList *locations;
154 }; 155 };
155 156
156 /* 157 /*
157 * opens the password store 158 * opens the password store
158 * the content is still encrypted and must be decrypted using pwdstore_decrypt 159 * the content is still encrypted and must be decrypted using pwdstore_decrypt
177 int pwdstore_has_location(PwdStore *s, const char *location); 178 int pwdstore_has_location(PwdStore *s, const char *location);
178 179
179 PwdEntry* pwdstore_get(PwdStore *p, const char *id); 180 PwdEntry* pwdstore_get(PwdStore *p, const char *id);
180 181
181 void pwdstore_put(PwdStore *p, const char *id, const char *username, const char *password); 182 void pwdstore_put(PwdStore *p, const char *id, const char *username, const char *password);
182 void pwdstore_put_index(PwdStore *p, char *id, UcxList *locations); 183 void pwdstore_put_index(PwdStore *p, char *id, CxList *locations);
183 184
184 void pwdstore_remove_entry(PwdStore *s, const char *id); 185 void pwdstore_remove_entry(PwdStore *s, const char *id);
185 186
186 int pwdstore_store(PwdStore *p, const char *file); 187 int pwdstore_store(PwdStore *p, const char *file);
187 188

mercurial