vb@1517
|
1 |
// This file is under GNU General Public License 3.0
|
vb@1517
|
2 |
// see LICENSE.txt
|
vb@1517
|
3 |
|
vb@23
|
4 |
#pragma once
|
vb@23
|
5 |
|
vb@0
|
6 |
#ifdef __cplusplus
|
vb@0
|
7 |
extern "C" {
|
vb@0
|
8 |
#endif
|
vb@0
|
9 |
|
vb@25
|
10 |
#include <stddef.h>
|
vb@0
|
11 |
#include <stdint.h>
|
vb@0
|
12 |
#include <stdbool.h>
|
vb@0
|
13 |
|
vb@98
|
14 |
#include "dynamic_api.h"
|
vb@98
|
15 |
#include "stringlist.h"
|
krista@1005
|
16 |
#include "stringpair.h"
|
vb@201
|
17 |
#include "timestamp.h"
|
vb@0
|
18 |
|
krista@2152
|
19 |
#define PEP_VERSION "2.0" // protocol version
|
vb@94
|
20 |
|
Edouard@658
|
21 |
#define PEP_OWN_USERID "pEp_own_userId"
|
Edouard@658
|
22 |
|
vb@0
|
23 |
// pEp Engine API
|
vb@0
|
24 |
|
vb@0
|
25 |
// caveat:
|
vb@0
|
26 |
// Unicode data has to be normalized to NFC before calling
|
vb@0
|
27 |
// UTF-8 strings are UTF-8 encoded C strings (zero terminated)
|
vb@0
|
28 |
|
vb@0
|
29 |
|
vb@46
|
30 |
struct _pEpSession;
|
vb@46
|
31 |
typedef struct _pEpSession * PEP_SESSION;
|
vb@0
|
32 |
|
vb@0
|
33 |
typedef enum {
|
roker@529
|
34 |
PEP_STATUS_OK = 0,
|
vb@0
|
35 |
|
roker@529
|
36 |
PEP_INIT_CANNOT_LOAD_GPGME = 0x0110,
|
roker@529
|
37 |
PEP_INIT_GPGME_INIT_FAILED = 0x0111,
|
roker@529
|
38 |
PEP_INIT_NO_GPG_HOME = 0x0112,
|
roker@529
|
39 |
PEP_INIT_NETPGP_INIT_FAILED = 0x0113,
|
krista@2461
|
40 |
PEP_INIT_CANNOT_DETERMINE_GPG_VERSION = 0x0114,
|
krista@2461
|
41 |
PEP_INIT_UNSUPPORTED_GPG_VERSION = 0x0115,
|
krista@2461
|
42 |
PEP_INIT_CANNOT_CONFIG_GPG_AGENT = 0x0116,
|
vb@0
|
43 |
|
roker@529
|
44 |
PEP_INIT_SQLITE3_WITHOUT_MUTEX = 0x0120,
|
roker@529
|
45 |
PEP_INIT_CANNOT_OPEN_DB = 0x0121,
|
roker@529
|
46 |
PEP_INIT_CANNOT_OPEN_SYSTEM_DB = 0x0122,
|
roker@529
|
47 |
|
roker@529
|
48 |
PEP_KEY_NOT_FOUND = 0x0201,
|
roker@529
|
49 |
PEP_KEY_HAS_AMBIG_NAME = 0x0202,
|
roker@529
|
50 |
PEP_GET_KEY_FAILED = 0x0203,
|
vb@1103
|
51 |
PEP_CANNOT_EXPORT_KEY = 0x0204,
|
edouard@1802
|
52 |
PEP_CANNOT_EDIT_KEY = 0x0205,
|
krista@2461
|
53 |
PEP_KEY_UNSUITABLE = 0x0206,
|
roker@529
|
54 |
|
roker@529
|
55 |
PEP_CANNOT_FIND_IDENTITY = 0x0301,
|
roker@529
|
56 |
PEP_CANNOT_SET_PERSON = 0x0381,
|
roker@529
|
57 |
PEP_CANNOT_SET_PGP_KEYPAIR = 0x0382,
|
roker@529
|
58 |
PEP_CANNOT_SET_IDENTITY = 0x0383,
|
vb@370
|
59 |
PEP_CANNOT_SET_TRUST = 0x0384,
|
vb@515
|
60 |
PEP_KEY_BLACKLISTED = 0x0385,
|
krista@2461
|
61 |
PEP_CANNOT_FIND_PERSON = 0x0386,
|
krista@2461
|
62 |
|
krista@2461
|
63 |
PEP_CANNOT_FIND_ALIAS = 0x0391,
|
krista@2461
|
64 |
PEP_CANNOT_SET_ALIAS = 0x0392,
|
roker@529
|
65 |
|
roker@529
|
66 |
PEP_UNENCRYPTED = 0x0400,
|
roker@529
|
67 |
PEP_VERIFIED = 0x0401,
|
roker@529
|
68 |
PEP_DECRYPTED = 0x0402,
|
roker@529
|
69 |
PEP_DECRYPTED_AND_VERIFIED = 0x0403,
|
roker@529
|
70 |
PEP_DECRYPT_WRONG_FORMAT = 0x0404,
|
roker@529
|
71 |
PEP_DECRYPT_NO_KEY = 0x0405,
|
roker@529
|
72 |
PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
|
vb@0
|
73 |
PEP_VERIFY_NO_KEY = 0x0407,
|
vb@0
|
74 |
PEP_VERIFIED_AND_TRUSTED = 0x0408,
|
roker@529
|
75 |
PEP_CANNOT_DECRYPT_UNKNOWN = 0x04ff,
|
vb@0
|
76 |
|
roker@529
|
77 |
PEP_TRUSTWORD_NOT_FOUND = 0x0501,
|
krista@1312
|
78 |
PEP_TRUSTWORDS_FPR_WRONG_LENGTH = 0x0502,
|
krista@1864
|
79 |
PEP_TRUSTWORDS_DUPLICATE_FPR = 0x0503,
|
vb@0
|
80 |
|
vb@0
|
81 |
PEP_CANNOT_CREATE_KEY = 0x0601,
|
vb@0
|
82 |
PEP_CANNOT_SEND_KEY = 0x0602,
|
vb@0
|
83 |
|
vb@458
|
84 |
PEP_PHRASE_NOT_FOUND = 0x0701,
|
vb@458
|
85 |
|
vb@690
|
86 |
PEP_SEND_FUNCTION_NOT_REGISTERED = 0x0801,
|
vb@691
|
87 |
PEP_CONTRAINTS_VIOLATED = 0x0802,
|
vb@691
|
88 |
PEP_CANNOT_ENCODE = 0x0803,
|
vb@690
|
89 |
|
edouard@1467
|
90 |
PEP_SYNC_NO_NOTIFY_CALLBACK = 0x0901,
|
vb@951
|
91 |
PEP_SYNC_ILLEGAL_MESSAGE = 0x0902,
|
vb@1105
|
92 |
PEP_SYNC_NO_INJECT_CALLBACK = 0x0903,
|
vb@884
|
93 |
|
vb@1085
|
94 |
PEP_SEQUENCE_VIOLATED = 0x0970,
|
vb@1085
|
95 |
PEP_CANNOT_INCREASE_SEQUENCE = 0x0971,
|
vb@1087
|
96 |
PEP_CANNOT_SET_SEQUENCE_VALUE = 0x0972,
|
vb@1087
|
97 |
PEP_OWN_SEQUENCE = 0x097f,
|
vb@1085
|
98 |
|
vb@964
|
99 |
PEP_SYNC_STATEMACHINE_ERROR = 0x0980,
|
vb@1101
|
100 |
PEP_SYNC_NO_TRUST = 0x0981,
|
vb@964
|
101 |
PEP_STATEMACHINE_INVALID_STATE = 0x0982,
|
vb@964
|
102 |
PEP_STATEMACHINE_INVALID_EVENT = 0x0983,
|
vb@964
|
103 |
PEP_STATEMACHINE_INVALID_CONDITION = 0x0984,
|
vb@964
|
104 |
PEP_STATEMACHINE_INVALID_ACTION = 0x0985,
|
edouard@1316
|
105 |
PEP_STATEMACHINE_INHIBITED_EVENT = 0x0986,
|
vb@884
|
106 |
|
roker@529
|
107 |
PEP_COMMIT_FAILED = 0xff01,
|
vb@1391
|
108 |
PEP_MESSAGE_CONSUME = 0xff02,
|
vb@1391
|
109 |
PEP_MESSAGE_IGNORE = 0xff03,
|
vb@0
|
110 |
|
vb@1091
|
111 |
PEP_RECORD_NOT_FOUND = -6,
|
vb@44
|
112 |
PEP_CANNOT_CREATE_TEMP_FILE = -5,
|
vb@0
|
113 |
PEP_ILLEGAL_VALUE = -4,
|
vb@0
|
114 |
PEP_BUFFER_TOO_SMALL = -3,
|
roker@529
|
115 |
PEP_OUT_OF_MEMORY = -2,
|
krista@1914
|
116 |
PEP_UNKNOWN_ERROR = -1,
|
krista@1914
|
117 |
|
krista@1914
|
118 |
PEP_VERSION_MISMATCH = -7,
|
vb@0
|
119 |
} PEP_STATUS;
|
vb@0
|
120 |
|
vb@0
|
121 |
|
vb@0
|
122 |
// INIT_STATUS init() - initialize pEpEngine for a thread
|
vb@0
|
123 |
//
|
vb@0
|
124 |
// parameters:
|
roker@529
|
125 |
// session (out) init() allocates session memory and returns a pointer
|
roker@529
|
126 |
// as a handle
|
vb@0
|
127 |
//
|
vb@0
|
128 |
// return value:
|
roker@529
|
129 |
// PEP_STATUS_OK = 0 if init() succeeds
|
roker@529
|
130 |
// PEP_INIT_SQLITE3_WITHOUT_MUTEX if SQLite3 was compiled with
|
roker@529
|
131 |
// SQLITE_THREADSAFE 0
|
roker@529
|
132 |
// PEP_INIT_CANNOT_LOAD_GPGME if libgpgme.dll cannot be found
|
roker@529
|
133 |
// PEP_INIT_GPGME_INIT_FAILED if GPGME init fails
|
roker@529
|
134 |
// PEP_INIT_CANNOT_OPEN_DB if user's management db cannot be
|
roker@529
|
135 |
// opened
|
roker@529
|
136 |
// PEP_INIT_CANNOT_OPEN_SYSTEM_DB if system's management db cannot be
|
roker@529
|
137 |
// opened
|
vb@0
|
138 |
//
|
vb@0
|
139 |
// caveat:
|
krista@2126
|
140 |
// THE CALLER MUST GUARD THIS CALL EXTERNALLY WITH A MUTEX. release() should
|
krista@2126
|
141 |
// be similarly guarded.
|
krista@2126
|
142 |
//
|
vb@0
|
143 |
// the pointer is valid only if the return value is PEP_STATUS_OK
|
vb@0
|
144 |
// in other case a NULL pointer will be returned; a valid handle must
|
vb@0
|
145 |
// be released using release() when it's no longer needed
|
vb@62
|
146 |
//
|
vb@62
|
147 |
// the caller has to guarantee that the first call to this function
|
vb@62
|
148 |
// will succeed before further calls can be done
|
vb@0
|
149 |
|
vb@0
|
150 |
DYNAMIC_API PEP_STATUS init(PEP_SESSION *session);
|
vb@0
|
151 |
|
vb@0
|
152 |
|
vb@0
|
153 |
// void release() - release thread session handle
|
vb@0
|
154 |
//
|
vb@0
|
155 |
// parameters:
|
roker@529
|
156 |
// session (in) session handle to release
|
vb@62
|
157 |
//
|
roker@529
|
158 |
// caveat:
|
krista@2126
|
159 |
// THE CALLER MUST GUARD THIS CALL EXTERNALLY WITH A MUTEX. init() should
|
krista@2126
|
160 |
// be similarly guarded.
|
krista@2126
|
161 |
//
|
roker@529
|
162 |
// the last release() can be called only when all other release() calls
|
roker@529
|
163 |
// are done
|
vb@0
|
164 |
|
vb@0
|
165 |
DYNAMIC_API void release(PEP_SESSION session);
|
vb@0
|
166 |
|
vb@0
|
167 |
|
roker@1722
|
168 |
// const stringlist_t* get_errorstack(PEP_SESSION) - get the error stack for that session, if any
|
roker@1722
|
169 |
//
|
roker@1722
|
170 |
// parameters:
|
roker@1722
|
171 |
// session (in) session handle
|
roker@1722
|
172 |
//
|
roker@1722
|
173 |
// caveat:
|
roker@1722
|
174 |
// To get a useful error stack you have to compile with -DDEBUG_ERRORSTACK
|
roker@1722
|
175 |
// The error stack belongs to the session. Do no not change it!
|
roker@1722
|
176 |
DYNAMIC_API const stringlist_t* get_errorstack(PEP_SESSION session);
|
roker@1722
|
177 |
|
roker@1778
|
178 |
|
roker@1777
|
179 |
// void clear_errorstack(PEP_SESSION) - clear the error stack for that session, if any
|
roker@1777
|
180 |
//
|
roker@1777
|
181 |
// parameters:
|
roker@1777
|
182 |
// session (in) session handle
|
roker@1777
|
183 |
//
|
roker@1777
|
184 |
DYNAMIC_API void clear_errorstack(PEP_SESSION session);
|
roker@1777
|
185 |
|
roker@1722
|
186 |
|
vb@464
|
187 |
// config_passive_mode() - enable passive mode
|
vb@464
|
188 |
//
|
vb@464
|
189 |
// parameters:
|
vb@464
|
190 |
// session (in) session handle
|
vb@467
|
191 |
// enable (in) flag if enabled or disabled
|
vb@467
|
192 |
|
vb@467
|
193 |
DYNAMIC_API void config_passive_mode(PEP_SESSION session, bool enable);
|
vb@467
|
194 |
|
vb@464
|
195 |
|
vb@553
|
196 |
// config_unencrypted_subject() - disable subject encryption
|
vb@467
|
197 |
//
|
vb@467
|
198 |
// parameters:
|
vb@467
|
199 |
// session (in) session handle
|
vb@467
|
200 |
// enable (in) flag if enabled or disabled
|
vb@467
|
201 |
|
vb@467
|
202 |
DYNAMIC_API void config_unencrypted_subject(PEP_SESSION session, bool enable);
|
vb@464
|
203 |
|
vb@464
|
204 |
|
Edouard@721
|
205 |
// config_use_only_own_private_keys() - enable passive mode
|
Edouard@721
|
206 |
//
|
Edouard@721
|
207 |
// parameters:
|
Edouard@721
|
208 |
// session (in) session handle
|
Edouard@721
|
209 |
// enable (in) flag if enabled or disabled
|
Edouard@721
|
210 |
|
Edouard@721
|
211 |
DYNAMIC_API void config_use_only_own_private_keys(PEP_SESSION session, bool enable);
|
Edouard@721
|
212 |
|
Edouard@721
|
213 |
|
vb@1110
|
214 |
// config_keep_sync_msg() - do not remove sync messages (for debugging purposes)
|
vb@1109
|
215 |
//
|
vb@1109
|
216 |
// session (in) session handle
|
vb@1109
|
217 |
// enable (in) flag if enabled or disabled
|
vb@1109
|
218 |
|
vb@1110
|
219 |
DYNAMIC_API void config_keep_sync_msg(PEP_SESSION session, bool enable);
|
vb@1109
|
220 |
|
vb@1109
|
221 |
|
vb@1819
|
222 |
// config_service_log() - log more for service purposes
|
vb@1819
|
223 |
//
|
vb@1819
|
224 |
// session (in) session handle
|
vb@1819
|
225 |
// enable (in) flag if enabled or disabled
|
vb@1819
|
226 |
|
vb@1819
|
227 |
DYNAMIC_API void config_service_log(PEP_SESSION session, bool enable);
|
vb@1819
|
228 |
|
vb@1819
|
229 |
|
vb@0
|
230 |
// decrypt_and_verify() - decrypt and/or verify a message
|
vb@0
|
231 |
//
|
roker@529
|
232 |
// parameters:
|
roker@529
|
233 |
// session (in) session handle
|
roker@529
|
234 |
// ctext (in) cipher text to decrypt and/or verify
|
roker@529
|
235 |
// csize (in) size of cipher text
|
krista@1397
|
236 |
// dsigtext (in) if extant, *detached* signature text for this
|
krista@1397
|
237 |
// message (or NULL if not)
|
krista@1397
|
238 |
// dsize (in) size of *detached* signature text for this
|
krista@1397
|
239 |
// message (0, if no detached sig exists)
|
roker@529
|
240 |
// ptext (out) pointer to internal buffer with plain text
|
roker@529
|
241 |
// psize (out) size of plain text
|
roker@529
|
242 |
// keylist (out) list of key ids which where used to encrypt
|
vb@0
|
243 |
//
|
roker@529
|
244 |
// return value:
|
roker@529
|
245 |
// PEP_UNENCRYPTED message was unencrypted and not signed
|
roker@529
|
246 |
// PEP_VERIFIED message was unencrypted, signature matches
|
roker@529
|
247 |
// PEP_DECRYPTED message is decrypted now, no signature
|
roker@529
|
248 |
// PEP_DECRYPTED_AND_VERIFIED message is decrypted now and verified
|
roker@529
|
249 |
// PEP_DECRYPT_WRONG_FORMAT message has wrong format to handle
|
roker@529
|
250 |
// PEP_DECRYPT_NO_KEY key not available to decrypt and/or verify
|
roker@529
|
251 |
// PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH wrong signature
|
vb@0
|
252 |
//
|
roker@529
|
253 |
// caveat:
|
roker@529
|
254 |
// the ownerships of ptext as well as keylist are going to the caller
|
roker@529
|
255 |
// the caller must use free() (or an Windoze pEp_free()) and
|
roker@529
|
256 |
// free_stringlist() to free them
|
vb@15
|
257 |
//
|
vb@15
|
258 |
// if this function failes an error message may be the first element of
|
vb@15
|
259 |
// keylist and the other elements may be the keys used for encryption
|
vb@0
|
260 |
|
vb@0
|
261 |
DYNAMIC_API PEP_STATUS decrypt_and_verify(
|
vb@0
|
262 |
PEP_SESSION session, const char *ctext, size_t csize,
|
krista@1397
|
263 |
const char *dsigtext, size_t dsigsize,
|
vb@0
|
264 |
char **ptext, size_t *psize, stringlist_t **keylist
|
vb@0
|
265 |
);
|
vb@0
|
266 |
|
vb@0
|
267 |
|
vb@0
|
268 |
// verify_text() - verfy plain text with a digital signature
|
vb@0
|
269 |
//
|
vb@0
|
270 |
// parameters:
|
vb@0
|
271 |
// session (in) session handle
|
vb@0
|
272 |
// text (in) text to verify
|
vb@0
|
273 |
// size (in) size of text
|
vb@0
|
274 |
// signature (in) signature text
|
vb@0
|
275 |
// sig_size (in) size of signature
|
roker@529
|
276 |
// keylist (out) list of key ids which where used to encrypt or NULL on
|
roker@529
|
277 |
// error
|
vb@0
|
278 |
//
|
vb@0
|
279 |
// return value:
|
roker@529
|
280 |
// PEP_VERIFIED message was unencrypted, signature matches
|
roker@529
|
281 |
// PEP_DECRYPT_NO_KEY key not available to decrypt and/or verify
|
roker@529
|
282 |
// PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH wrong signature
|
vb@0
|
283 |
|
vb@0
|
284 |
DYNAMIC_API PEP_STATUS verify_text(
|
vb@0
|
285 |
PEP_SESSION session, const char *text, size_t size,
|
vb@0
|
286 |
const char *signature, size_t sig_size, stringlist_t **keylist
|
vb@0
|
287 |
);
|
vb@0
|
288 |
|
vb@0
|
289 |
|
vb@0
|
290 |
// encrypt_and_sign() - encrypt and sign a message
|
vb@0
|
291 |
//
|
roker@529
|
292 |
// parameters:
|
roker@529
|
293 |
// session (in) session handle
|
roker@529
|
294 |
// keylist (in) list of key ids to encrypt with as C strings
|
roker@529
|
295 |
// ptext (in) plain text to decrypt and/or verify
|
roker@529
|
296 |
// psize (in) size of plain text
|
roker@529
|
297 |
// ctext (out) pointer to internal buffer with cipher text
|
roker@529
|
298 |
// csize (out) size of cipher text
|
vb@0
|
299 |
//
|
roker@529
|
300 |
// return value:
|
roker@529
|
301 |
// PEP_STATUS_OK = 0 encryption and signing succeeded
|
roker@529
|
302 |
// PEP_KEY_NOT_FOUND at least one of the receipient keys
|
roker@529
|
303 |
// could not be found
|
roker@529
|
304 |
// PEP_KEY_HAS_AMBIG_NAME at least one of the receipient keys has
|
roker@529
|
305 |
// an ambiguous name
|
roker@529
|
306 |
// PEP_GET_KEY_FAILED cannot retrieve key
|
vb@0
|
307 |
//
|
roker@529
|
308 |
// caveat:
|
roker@529
|
309 |
// the ownership of ctext is going to the caller
|
vb@0
|
310 |
// the caller is responsible to free() it (on Windoze use pEp_free())
|
vb@20
|
311 |
// the first key in keylist is being used to sign the message
|
vb@20
|
312 |
// this implies there has to be a private key for that keypair
|
vb@0
|
313 |
|
vb@0
|
314 |
DYNAMIC_API PEP_STATUS encrypt_and_sign(
|
vb@0
|
315 |
PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
|
vb@0
|
316 |
size_t psize, char **ctext, size_t *csize
|
vb@0
|
317 |
);
|
vb@0
|
318 |
|
vb@0
|
319 |
|
vb@0
|
320 |
// log_event() - log a user defined event defined by UTF-8 encoded strings into
|
vb@0
|
321 |
// management log
|
vb@0
|
322 |
//
|
roker@529
|
323 |
// parameters:
|
roker@529
|
324 |
// session (in) session handle
|
roker@529
|
325 |
// title (in) C string with event name
|
roker@529
|
326 |
// entity (in) C string with name of entity which is logging
|
roker@529
|
327 |
// description (in) C string with long description for event or NULL if
|
roker@529
|
328 |
// omitted
|
roker@529
|
329 |
// comment (in) C string with user defined comment or NULL if
|
roker@529
|
330 |
// omitted
|
vb@0
|
331 |
//
|
roker@529
|
332 |
// return value:
|
roker@529
|
333 |
// PEP_STATUS_OK log entry created
|
vb@0
|
334 |
|
vb@0
|
335 |
DYNAMIC_API PEP_STATUS log_event(
|
vb@450
|
336 |
PEP_SESSION session,
|
vb@451
|
337 |
const char *title,
|
vb@451
|
338 |
const char *entity,
|
vb@451
|
339 |
const char *description,
|
vb@451
|
340 |
const char *comment
|
vb@0
|
341 |
);
|
vb@0
|
342 |
|
vb@0
|
343 |
|
vb@1819
|
344 |
DYNAMIC_API PEP_STATUS log_service(PEP_SESSION session, const char *title,
|
vb@1819
|
345 |
const char *entity, const char *description, const char *comment);
|
vb@1819
|
346 |
|
vb@1819
|
347 |
#define _STR_(x) #x
|
vb@1819
|
348 |
#define _D_STR_(x) _STR_(x)
|
vb@1819
|
349 |
#define S_LINE _D_STR_(__LINE__)
|
vb@1819
|
350 |
|
vb@1819
|
351 |
#define SERVICE_LOG(session, title, entity, desc) \
|
vb@1819
|
352 |
log_service((session), (title), (entity), (desc), "service " __FILE__ ":" S_LINE)
|
vb@1819
|
353 |
|
vb@1819
|
354 |
|
vb@233
|
355 |
// trustword() - get the corresponding trustword for a 16 bit value
|
vb@0
|
356 |
//
|
roker@529
|
357 |
// parameters:
|
roker@529
|
358 |
// session (in) session handle
|
roker@529
|
359 |
// value (in) value to find a trustword for
|
roker@529
|
360 |
// lang (in) C string with ISO 639-1 language code
|
roker@529
|
361 |
// word (out) pointer to C string with trustword UTF-8 encoded
|
roker@529
|
362 |
// NULL if language is not supported or trustword
|
roker@529
|
363 |
// wordlist is damaged or unavailable
|
roker@529
|
364 |
// wsize (out) length of trustword
|
vb@0
|
365 |
//
|
roker@529
|
366 |
// return value:
|
roker@529
|
367 |
// PEP_STATUS_OK trustword retrieved
|
roker@529
|
368 |
// PEP_TRUSTWORD_NOT_FOUND trustword not found
|
vb@0
|
369 |
//
|
roker@529
|
370 |
// caveat:
|
roker@529
|
371 |
// the word pointer goes to the ownership of the caller
|
vb@0
|
372 |
// the caller is responsible to free() it (on Windoze use pEp_free())
|
vb@0
|
373 |
|
vb@233
|
374 |
DYNAMIC_API PEP_STATUS trustword(
|
vb@0
|
375 |
PEP_SESSION session, uint16_t value, const char *lang,
|
vb@0
|
376 |
char **word, size_t *wsize
|
vb@0
|
377 |
);
|
vb@0
|
378 |
|
vb@0
|
379 |
|
vb@233
|
380 |
// trustwords() - get trustwords for a string of hex values of a fingerprint
|
vb@0
|
381 |
//
|
roker@529
|
382 |
// parameters:
|
roker@529
|
383 |
// session (in) session handle
|
roker@529
|
384 |
// fingerprint (in) C string with hex values to find trustwords for
|
roker@529
|
385 |
// lang (in) C string with ISO 639-1 language code
|
roker@529
|
386 |
// words (out) pointer to C string with trustwords UTF-8 encoded,
|
roker@529
|
387 |
// separated by a blank each
|
roker@529
|
388 |
// NULL if language is not supported or trustword
|
roker@529
|
389 |
// wordlist is damaged or unavailable
|
roker@529
|
390 |
// wsize (out) length of trustwords string
|
roker@529
|
391 |
// max_words (in) only generate a string with max_words;
|
roker@529
|
392 |
// if max_words == 0 there is no such limit
|
vb@0
|
393 |
//
|
roker@529
|
394 |
// return value:
|
roker@529
|
395 |
// PEP_STATUS_OK trustwords retrieved
|
roker@529
|
396 |
// PEP_OUT_OF_MEMORY out of memory
|
roker@529
|
397 |
// PEP_TRUSTWORD_NOT_FOUND at least one trustword not found
|
vb@0
|
398 |
//
|
roker@529
|
399 |
// caveat:
|
roker@529
|
400 |
// the word pointer goes to the ownership of the caller
|
vb@0
|
401 |
// the caller is responsible to free() it (on Windoze use pEp_free())
|
vb@0
|
402 |
//
|
vb@0
|
403 |
// DON'T USE THIS FUNCTION FROM HIGH LEVEL LANGUAGES!
|
vb@0
|
404 |
//
|
vb@233
|
405 |
// Better implement a simple one in the adapter yourself using trustword(), and
|
vb@233
|
406 |
// return a list of trustwords.
|
vb@0
|
407 |
// This function is provided for being used by C and C++ programs only.
|
vb@0
|
408 |
|
vb@233
|
409 |
DYNAMIC_API PEP_STATUS trustwords(
|
vb@0
|
410 |
PEP_SESSION session, const char *fingerprint, const char *lang,
|
vb@0
|
411 |
char **words, size_t *wsize, int max_words
|
vb@0
|
412 |
);
|
vb@0
|
413 |
|
vb@0
|
414 |
|
vb@951
|
415 |
// TODO: increase versions in pEp.asn1 if rating changes
|
vb@951
|
416 |
|
vb@0
|
417 |
typedef enum _PEP_comm_type {
|
vb@9
|
418 |
PEP_ct_unknown = 0,
|
vb@0
|
419 |
|
vb@9
|
420 |
// range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
|
vb@0
|
421 |
|
vb@9
|
422 |
PEP_ct_no_encryption = 0x01, // generic
|
vb@9
|
423 |
PEP_ct_no_encrypted_channel = 0x02,
|
vb@9
|
424 |
PEP_ct_key_not_found = 0x03,
|
vb@9
|
425 |
PEP_ct_key_expired = 0x04,
|
vb@9
|
426 |
PEP_ct_key_revoked = 0x05,
|
vb@9
|
427 |
PEP_ct_key_b0rken = 0x06,
|
vb@9
|
428 |
PEP_ct_my_key_not_included = 0x09,
|
vb@9
|
429 |
|
vb@9
|
430 |
PEP_ct_security_by_obscurity = 0x0a,
|
vb@9
|
431 |
PEP_ct_b0rken_crypto = 0x0b,
|
Edouard@442
|
432 |
PEP_ct_key_too_short = 0x0c,
|
vb@9
|
433 |
|
Edouard@442
|
434 |
PEP_ct_compromized = 0x0e, // known compromized connection
|
Edouard@442
|
435 |
PEP_ct_mistrusted = 0x0f, // known mistrusted key
|
vb@0
|
436 |
|
vb@9
|
437 |
// range 0x10 to 0x3f: unconfirmed encryption
|
vb@0
|
438 |
|
vb@0
|
439 |
PEP_ct_unconfirmed_encryption = 0x10, // generic
|
roker@529
|
440 |
PEP_ct_OpenPGP_weak_unconfirmed = 0x11, // RSA 1024 is weak
|
vb@190
|
441 |
|
vb@190
|
442 |
PEP_ct_to_be_checked = 0x20, // generic
|
vb@190
|
443 |
PEP_ct_SMIME_unconfirmed = 0x21,
|
vb@190
|
444 |
PEP_ct_CMS_unconfirmed = 0x22,
|
vb@190
|
445 |
|
vb@190
|
446 |
PEP_ct_strong_but_unconfirmed = 0x30, // generic
|
vb@122
|
447 |
PEP_ct_OpenPGP_unconfirmed = 0x38, // key at least 2048 bit RSA or EC
|
vb@122
|
448 |
PEP_ct_OTR_unconfirmed = 0x3a,
|
vb@0
|
449 |
|
vb@9
|
450 |
// range 0x40 to 0x7f: unconfirmed encryption and anonymization
|
vb@0
|
451 |
|
vb@0
|
452 |
PEP_ct_unconfirmed_enc_anon = 0x40, // generic
|
lix@710
|
453 |
PEP_ct_pEp_unconfirmed = 0x7f,
|
vb@0
|
454 |
|
vb@9
|
455 |
PEP_ct_confirmed = 0x80, // this bit decides if trust is confirmed
|
vb@9
|
456 |
|
vb@9
|
457 |
// range 0x81 to 0x8f: reserved
|
vb@9
|
458 |
// range 0x90 to 0xbf: confirmed encryption
|
vb@0
|
459 |
|
vb@0
|
460 |
PEP_ct_confirmed_encryption = 0x90, // generic
|
edouard@1635
|
461 |
PEP_ct_OpenPGP_weak = 0x91, // RSA 1024 is weak (unused)
|
vb@190
|
462 |
|
vb@190
|
463 |
PEP_ct_to_be_checked_confirmed = 0xa0, //generic
|
vb@190
|
464 |
PEP_ct_SMIME = 0xa1,
|
vb@190
|
465 |
PEP_ct_CMS = 0xa2,
|
vb@190
|
466 |
|
vb@190
|
467 |
PEP_ct_strong_encryption = 0xb0, // generic
|
roker@529
|
468 |
PEP_ct_OpenPGP = 0xb8, // key at least 2048 bit RSA or EC
|
roker@529
|
469 |
PEP_ct_OTR = 0xba,
|
vb@0
|
470 |
|
vb@0
|
471 |
// range 0xc0 to 0xff: confirmed encryption and anonymization
|
vb@0
|
472 |
|
vb@0
|
473 |
PEP_ct_confirmed_enc_anon = 0xc0, // generic
|
roker@529
|
474 |
PEP_ct_pEp = 0xff
|
vb@0
|
475 |
} PEP_comm_type;
|
vb@0
|
476 |
|
vb@928
|
477 |
typedef enum _identity_flags {
|
vb@951
|
478 |
// the first octet flags are app defined settings
|
edouard@1394
|
479 |
PEP_idf_not_for_sync = 0x0001, // don't use this identity for sync
|
edouard@1394
|
480 |
PEP_idf_list = 0x0002, // identity of list of persons
|
vb@951
|
481 |
// the second octet flags are calculated
|
edouard@1394
|
482 |
PEP_idf_devicegroup = 0x0100 // identity of a device group member
|
vb@928
|
483 |
} identity_flags;
|
vb@928
|
484 |
|
vb@944
|
485 |
typedef unsigned int identity_flags_t;
|
vb@944
|
486 |
|
edouard@1394
|
487 |
// typedef enum _keypair_flags {
|
edouard@1394
|
488 |
// } keypair_flags;
|
edouard@1364
|
489 |
|
edouard@1364
|
490 |
typedef unsigned int keypair_flags_t;
|
edouard@1364
|
491 |
|
vb@0
|
492 |
typedef struct _pEp_identity {
|
roker@529
|
493 |
char *address; // C string with address UTF-8 encoded
|
roker@529
|
494 |
char *fpr; // C string with fingerprint UTF-8 encoded
|
roker@529
|
495 |
char *user_id; // C string with user ID UTF-8 encoded
|
krista@2461
|
496 |
// user_id MIGHT be set to "pEp_own_userId"
|
edouard@1946
|
497 |
// (use PEP_OWN_USERID preprocessor define)
|
edouard@1946
|
498 |
// if this is own user's identity.
|
krista@2461
|
499 |
// But it is not REQUIRED to be.
|
roker@529
|
500 |
char *username; // C string with user name UTF-8 encoded
|
roker@529
|
501 |
PEP_comm_type comm_type; // type of communication with this ID
|
roker@529
|
502 |
char lang[3]; // language of conversation
|
vb@0
|
503 |
// ISO 639-1 ALPHA-2, last byte is 0
|
krista@2461
|
504 |
bool me; // if this is the local user herself/himself
|
vb@944
|
505 |
identity_flags_t flags; // identity_flag1 | identity_flag2 | ...
|
vb@0
|
506 |
} pEp_identity;
|
vb@0
|
507 |
|
Edouard@730
|
508 |
typedef struct _identity_list {
|
Edouard@730
|
509 |
pEp_identity *ident;
|
Edouard@730
|
510 |
struct _identity_list *next;
|
Edouard@730
|
511 |
} identity_list;
|
Edouard@730
|
512 |
|
vb@0
|
513 |
|
vb@0
|
514 |
// new_identity() - allocate memory and set the string and size fields
|
vb@0
|
515 |
//
|
vb@0
|
516 |
// parameters:
|
vb@0
|
517 |
// address (in) UTF-8 string or NULL
|
vb@0
|
518 |
// fpr (in) UTF-8 string or NULL
|
vb@0
|
519 |
// user_id (in) UTF-8 string or NULL
|
vb@0
|
520 |
// username (in) UTF-8 string or NULL
|
vb@0
|
521 |
//
|
vb@0
|
522 |
// return value:
|
vb@932
|
523 |
// pEp_identity struct or NULL if out of memory
|
vb@0
|
524 |
//
|
vb@0
|
525 |
// caveat:
|
vb@0
|
526 |
// the strings are copied; the original strings are still being owned by
|
vb@0
|
527 |
// the caller
|
vb@0
|
528 |
|
vb@0
|
529 |
DYNAMIC_API pEp_identity *new_identity(
|
vb@0
|
530 |
const char *address, const char *fpr, const char *user_id,
|
vb@0
|
531 |
const char *username
|
vb@0
|
532 |
);
|
vb@0
|
533 |
|
vb@0
|
534 |
|
vb@932
|
535 |
// identity_dup() - allocate memory and duplicate
|
vb@37
|
536 |
//
|
vb@37
|
537 |
// parameters:
|
vb@37
|
538 |
// src (in) identity to duplicate
|
vb@37
|
539 |
//
|
vb@37
|
540 |
// return value:
|
vb@932
|
541 |
// pEp_identity struct or NULL if out of memory
|
vb@37
|
542 |
//
|
vb@37
|
543 |
// caveat:
|
vb@37
|
544 |
// the strings are copied; the original strings are still being owned by
|
vb@37
|
545 |
// the caller
|
vb@37
|
546 |
|
vb@37
|
547 |
DYNAMIC_API pEp_identity *identity_dup(const pEp_identity *src);
|
vb@37
|
548 |
|
vb@37
|
549 |
|
vb@0
|
550 |
// free_identity() - free all memory being occupied by a pEp_identity struct
|
vb@0
|
551 |
//
|
vb@0
|
552 |
// parameters:
|
vb@0
|
553 |
// identity (in) struct to release
|
vb@0
|
554 |
//
|
vb@0
|
555 |
// caveat:
|
vb@0
|
556 |
// not only the struct but also all string memory referenced by the
|
vb@0
|
557 |
// struct is being freed; all pointers inside are invalid afterwards
|
vb@0
|
558 |
|
vb@0
|
559 |
DYNAMIC_API void free_identity(pEp_identity *identity);
|
vb@0
|
560 |
|
vb@0
|
561 |
|
vb@0
|
562 |
// get_identity() - get identity information
|
vb@0
|
563 |
//
|
roker@529
|
564 |
// parameters:
|
roker@529
|
565 |
// session (in) session handle
|
roker@529
|
566 |
// address (in) C string with communication address, UTF-8 encoded
|
Edouard@562
|
567 |
// user_id (in) unique C string to identify person that identity
|
Edouard@562
|
568 |
// is refering to
|
roker@529
|
569 |
// identity (out) pointer to pEp_identity structure with results or
|
roker@529
|
570 |
// NULL if failure
|
vb@0
|
571 |
//
|
roker@529
|
572 |
// caveat:
|
vb@951
|
573 |
// address and user_id are being copied; the original strings remains in
|
vb@951
|
574 |
// the ownership of the caller
|
roker@529
|
575 |
// the resulting pEp_identity structure goes to the ownership of the
|
roker@529
|
576 |
// caller and has to be freed with free_identity() when not in use any
|
roker@529
|
577 |
// more
|
vb@0
|
578 |
|
vb@0
|
579 |
DYNAMIC_API PEP_STATUS get_identity(
|
Edouard@559
|
580 |
PEP_SESSION session,
|
Edouard@559
|
581 |
const char *address,
|
Edouard@559
|
582 |
const char *user_id,
|
vb@0
|
583 |
pEp_identity **identity
|
vb@0
|
584 |
);
|
vb@0
|
585 |
|
krista@1799
|
586 |
PEP_STATUS replace_identities_fpr(PEP_SESSION session,
|
krista@1799
|
587 |
const char* old_fpr,
|
krista@1799
|
588 |
const char* new_fpr);
|
krista@1797
|
589 |
|
krista@1797
|
590 |
|
vb@0
|
591 |
// set_identity() - set identity information
|
vb@0
|
592 |
//
|
roker@529
|
593 |
// parameters:
|
roker@529
|
594 |
// session (in) session handle
|
roker@529
|
595 |
// identity (in) pointer to pEp_identity structure
|
vb@0
|
596 |
//
|
roker@529
|
597 |
// return value:
|
roker@529
|
598 |
// PEP_STATUS_OK = 0 encryption and signing succeeded
|
roker@529
|
599 |
// PEP_CANNOT_SET_PERSON writing to table person failed
|
roker@529
|
600 |
// PEP_CANNOT_SET_PGP_KEYPAIR writing to table pgp_keypair failed
|
roker@529
|
601 |
// PEP_CANNOT_SET_IDENTITY writing to table identity failed
|
roker@529
|
602 |
// PEP_COMMIT_FAILED SQL commit failed
|
vb@932
|
603 |
// PEP_KEY_BLACKLISTED Key blacklisted, cannot set identity
|
vb@0
|
604 |
//
|
roker@529
|
605 |
// caveat:
|
vb@932
|
606 |
// address, fpr, user_id and username must be given
|
vb@0
|
607 |
|
vb@0
|
608 |
DYNAMIC_API PEP_STATUS set_identity(
|
vb@0
|
609 |
PEP_SESSION session, const pEp_identity *identity
|
vb@0
|
610 |
);
|
vb@0
|
611 |
|
krista@2461
|
612 |
// get_default own_userid() - get the user_id of the own user
|
krista@2461
|
613 |
//
|
krista@2461
|
614 |
// parameters:
|
krista@2461
|
615 |
// session (in) session handle
|
krista@2461
|
616 |
// userid (out) own user id (if it exists)
|
krista@2461
|
617 |
//
|
krista@2461
|
618 |
// return value:
|
krista@2461
|
619 |
// PEP_STATUS_OK = 0 userid was found
|
krista@2461
|
620 |
// PEP_CANNOT_FIND_IDENTITY no own_user found in the DB
|
krista@2461
|
621 |
// PEP_UNKNOWN_ERROR results were returned, but no ID
|
krista@2461
|
622 |
// found (no reason this should ever occur)
|
krista@2461
|
623 |
// caveat:
|
krista@2461
|
624 |
// userid will be NULL if not found; otherwise, returned string
|
krista@2461
|
625 |
// belongs to the caller.
|
krista@2461
|
626 |
|
krista@2461
|
627 |
DYNAMIC_API PEP_STATUS get_default_own_userid(
|
krista@2461
|
628 |
PEP_SESSION session,
|
krista@2461
|
629 |
char** userid
|
krista@2461
|
630 |
);
|
krista@2461
|
631 |
|
krista@2461
|
632 |
// get_userid_alias_default() - get the default user_id which corresponds
|
krista@2461
|
633 |
// to an alias
|
krista@2461
|
634 |
// parameters:
|
krista@2461
|
635 |
// session (in) session handle
|
krista@2461
|
636 |
// alias_id (in) the user_id which may be an alias for a default id
|
krista@2461
|
637 |
// default_id (out) the default id for this alias, if the alias
|
krista@2461
|
638 |
// is in the DB as an alias, else NULL
|
krista@2461
|
639 |
// return value:
|
krista@2461
|
640 |
// PEP_STATUS_OK = 0 userid was found
|
krista@2461
|
641 |
// PEP_CANNOT_FIND_ALIAS this userid is not listed as an
|
krista@2461
|
642 |
// alias in the DB
|
krista@2461
|
643 |
// PEP_UNKNOWN_ERROR results were returned, but no ID
|
krista@2461
|
644 |
// found (no reason this should ever occur)
|
krista@2461
|
645 |
// caveat:
|
krista@2461
|
646 |
// default_id will be NULL if not found; otherwise, returned string
|
krista@2461
|
647 |
// belongs to the caller.
|
krista@2461
|
648 |
// also, current implementation does NOT check to see if this userid
|
krista@2461
|
649 |
// IS a default.
|
krista@2461
|
650 |
|
krista@2461
|
651 |
DYNAMIC_API PEP_STATUS get_userid_alias_default(
|
krista@2461
|
652 |
PEP_SESSION session,
|
krista@2461
|
653 |
const char* alias_id,
|
krista@2461
|
654 |
char** default_id);
|
krista@2461
|
655 |
|
krista@2461
|
656 |
// set_userid_alias() - set an alias to correspond to a default id
|
krista@2461
|
657 |
// parameters:
|
krista@2461
|
658 |
// session (in) session handle
|
krista@2461
|
659 |
// default_id (in) the default id for this alias. This must
|
krista@2461
|
660 |
// correspond to the default user_id for an
|
krista@2461
|
661 |
// entry in the person (user) table.
|
krista@2461
|
662 |
// alias_id (in) the alias to be set for this default id
|
krista@2461
|
663 |
// return value:
|
krista@2461
|
664 |
// PEP_STATUS_OK = 0 userid was found
|
krista@2461
|
665 |
// PEP_CANNOT_SET_ALIAS there was an error setting this
|
krista@2461
|
666 |
|
krista@2461
|
667 |
DYNAMIC_API PEP_STATUS set_userid_alias (
|
krista@2461
|
668 |
PEP_SESSION session,
|
krista@2461
|
669 |
const char* default_id,
|
krista@2461
|
670 |
const char* alias_id);
|
krista@2461
|
671 |
|
krista@2461
|
672 |
|
edouard@1234
|
673 |
// set_device_group() - update own person's device group
|
edouard@1234
|
674 |
//
|
edouard@1234
|
675 |
// parameters:
|
edouard@1234
|
676 |
// session (in) session handle
|
edouard@1234
|
677 |
// group_name (in) new group name
|
edouard@1234
|
678 |
//
|
edouard@1234
|
679 |
// return value:
|
edouard@1235
|
680 |
// PEP_STATUS_OK = 0 device group was updated
|
edouard@1234
|
681 |
// PEP_CANNOT_SET_PERSON update failed
|
edouard@1234
|
682 |
|
edouard@1234
|
683 |
DYNAMIC_API PEP_STATUS set_device_group(
|
edouard@1234
|
684 |
PEP_SESSION session,
|
edouard@1234
|
685 |
const char *group_name
|
edouard@1234
|
686 |
);
|
vb@0
|
687 |
|
edouard@1235
|
688 |
// get_device_group() - get own person's device group
|
edouard@1235
|
689 |
//
|
edouard@1235
|
690 |
// parameters:
|
edouard@1235
|
691 |
// session (in) session handle
|
edouard@1235
|
692 |
// group_name (in) new group name
|
edouard@1235
|
693 |
//
|
edouard@1235
|
694 |
// return value:
|
edouard@1235
|
695 |
// PEP_STATUS_OK = 0 couldn't get device group
|
edouard@1235
|
696 |
// PEP_RECORD_NOT_FOUND update failed
|
edouard@1235
|
697 |
//
|
edouard@1235
|
698 |
// caveat:
|
edouard@1235
|
699 |
// the ownerships of group_name is going to the caller
|
edouard@1235
|
700 |
|
edouard@1235
|
701 |
DYNAMIC_API PEP_STATUS get_device_group(
|
edouard@1235
|
702 |
PEP_SESSION session,
|
edouard@1235
|
703 |
char **group_name
|
edouard@1235
|
704 |
);
|
edouard@1235
|
705 |
|
vb@932
|
706 |
// set_identity_flags() - update identity flags on existing identity
|
vb@932
|
707 |
//
|
vb@932
|
708 |
// parameters:
|
vb@932
|
709 |
// session (in) session handle
|
vb@934
|
710 |
// identity (in,out) pointer to pEp_identity structure
|
vb@934
|
711 |
// flags (in) new value for flags
|
vb@932
|
712 |
//
|
vb@932
|
713 |
// return value:
|
vb@932
|
714 |
// PEP_STATUS_OK = 0 encryption and signing succeeded
|
vb@932
|
715 |
// PEP_CANNOT_SET_IDENTITY update of identity failed
|
vb@932
|
716 |
//
|
vb@932
|
717 |
// caveat:
|
vb@934
|
718 |
// address and user_id must be given in identity
|
vb@932
|
719 |
|
vb@932
|
720 |
DYNAMIC_API PEP_STATUS set_identity_flags(
|
vb@934
|
721 |
PEP_SESSION session,
|
vb@934
|
722 |
pEp_identity *identity,
|
vb@1425
|
723 |
identity_flags_t flags
|
vb@932
|
724 |
);
|
vb@932
|
725 |
|
edouard@1406
|
726 |
// unset_identity_flags() - update identity flags on existing identity
|
edouard@1406
|
727 |
//
|
edouard@1406
|
728 |
// parameters:
|
edouard@1406
|
729 |
// session (in) session handle
|
edouard@1406
|
730 |
// identity (in,out) pointer to pEp_identity structure
|
edouard@1406
|
731 |
// flags (in) new value for flags
|
edouard@1406
|
732 |
//
|
edouard@1406
|
733 |
// return value:
|
edouard@1406
|
734 |
// PEP_STATUS_OK = 0 encryption and signing succeeded
|
edouard@1406
|
735 |
// PEP_CANNOT_SET_IDENTITY update of identity failed
|
edouard@1406
|
736 |
//
|
edouard@1406
|
737 |
// caveat:
|
edouard@1406
|
738 |
// address and user_id must be given in identity
|
edouard@1406
|
739 |
|
edouard@1406
|
740 |
DYNAMIC_API PEP_STATUS unset_identity_flags(
|
edouard@1406
|
741 |
PEP_SESSION session,
|
edouard@1406
|
742 |
pEp_identity *identity,
|
vb@1425
|
743 |
identity_flags_t flags
|
edouard@1406
|
744 |
);
|
vb@932
|
745 |
|
vb@357
|
746 |
// mark_as_compromized() - mark key in trust db as compromized
|
vb@357
|
747 |
//
|
roker@529
|
748 |
// parameters:
|
roker@529
|
749 |
// session (in) session handle
|
roker@529
|
750 |
// fpr (in) fingerprint of key to mark
|
vb@357
|
751 |
|
vb@357
|
752 |
DYNAMIC_API PEP_STATUS mark_as_compromized(
|
vb@357
|
753 |
PEP_SESSION session,
|
vb@357
|
754 |
const char *fpr
|
vb@357
|
755 |
);
|
vb@357
|
756 |
|
vb@357
|
757 |
|
vb@0
|
758 |
// generate_keypair() - generate a new key pair and add it to the key ring
|
vb@0
|
759 |
//
|
vb@0
|
760 |
// parameters:
|
vb@0
|
761 |
// session (in) session handle
|
roker@529
|
762 |
// identity (inout) pointer to pEp_identity structure
|
vb@0
|
763 |
//
|
roker@529
|
764 |
// return value:
|
roker@529
|
765 |
// PEP_STATUS_OK = 0 encryption and signing succeeded
|
roker@529
|
766 |
// PEP_ILLEGAL_VALUE illegal values for identity fields given
|
roker@529
|
767 |
// PEP_CANNOT_CREATE_KEY key engine is on strike
|
vb@0
|
768 |
//
|
vb@0
|
769 |
// caveat:
|
vb@0
|
770 |
// address and username fields must be set to UTF-8 strings
|
vb@0
|
771 |
// the fpr field must be set to NULL
|
vb@0
|
772 |
//
|
vb@0
|
773 |
// this function allocates a string and sets set fpr field of identity
|
vb@0
|
774 |
// the caller is responsible to call free() for that string or use
|
vb@0
|
775 |
// free_identity() on the struct
|
vb@0
|
776 |
|
vb@0
|
777 |
DYNAMIC_API PEP_STATUS generate_keypair(
|
vb@0
|
778 |
PEP_SESSION session, pEp_identity *identity
|
vb@0
|
779 |
);
|
vb@0
|
780 |
|
vb@0
|
781 |
|
vb@0
|
782 |
// delete_keypair() - delete a public key or a key pair from the key ring
|
vb@0
|
783 |
//
|
vb@0
|
784 |
// parameters:
|
vb@0
|
785 |
// session (in) session handle
|
vb@0
|
786 |
// fpr (in) C string with key id or fingerprint of the
|
vb@0
|
787 |
// public key
|
vb@0
|
788 |
//
|
vb@0
|
789 |
// return value:
|
vb@0
|
790 |
// PEP_STATUS_OK = 0 key was successfully deleted
|
vb@0
|
791 |
// PEP_KEY_NOT_FOUND key not found
|
vb@0
|
792 |
// PEP_ILLEGAL_VALUE not a valid key id or fingerprint
|
vb@0
|
793 |
// PEP_KEY_HAS_AMBIG_NAME fpr does not uniquely identify a key
|
vb@0
|
794 |
// PEP_OUT_OF_MEMORY out of memory
|
vb@0
|
795 |
|
vb@0
|
796 |
DYNAMIC_API PEP_STATUS delete_keypair(PEP_SESSION session, const char *fpr);
|
vb@0
|
797 |
|
vb@0
|
798 |
|
vb@0
|
799 |
// import_key() - import key from data
|
vb@0
|
800 |
//
|
vb@0
|
801 |
// parameters:
|
vb@0
|
802 |
// session (in) session handle
|
vb@0
|
803 |
// key_data (in) key data, i.e. ASCII armored OpenPGP key
|
vb@0
|
804 |
// size (in) amount of data to handle
|
Edouard@772
|
805 |
// private_keys (out) list of private keys that have been imported
|
vb@0
|
806 |
//
|
vb@0
|
807 |
// return value:
|
vb@0
|
808 |
// PEP_STATUS_OK = 0 key was successfully imported
|
vb@0
|
809 |
// PEP_OUT_OF_MEMORY out of memory
|
vb@0
|
810 |
// PEP_ILLEGAL_VALUE there is no key data to import
|
Edouard@772
|
811 |
//
|
Edouard@772
|
812 |
// caveat:
|
Edouard@772
|
813 |
// private_keys goes to the ownership of the caller
|
Edouard@772
|
814 |
// private_keys can be left NULL, it is then ignored
|
vb@0
|
815 |
|
Edouard@728
|
816 |
DYNAMIC_API PEP_STATUS import_key(
|
Edouard@728
|
817 |
PEP_SESSION session,
|
Edouard@728
|
818 |
const char *key_data,
|
Edouard@728
|
819 |
size_t size,
|
Edouard@728
|
820 |
identity_list **private_keys
|
Edouard@728
|
821 |
);
|
vb@0
|
822 |
|
vb@0
|
823 |
|
vb@0
|
824 |
// export_key() - export ascii armored key
|
vb@0
|
825 |
//
|
vb@0
|
826 |
// parameters:
|
vb@0
|
827 |
// session (in) session handle
|
vb@0
|
828 |
// fpr (in) key id or fingerprint of key
|
vb@0
|
829 |
// key_data (out) ASCII armored OpenPGP key
|
roker@529
|
830 |
// size (out) amount of data to handle
|
vb@0
|
831 |
//
|
vb@0
|
832 |
// return value:
|
vb@0
|
833 |
// PEP_STATUS_OK = 0 key was successfully exported
|
vb@0
|
834 |
// PEP_OUT_OF_MEMORY out of memory
|
vb@0
|
835 |
// PEP_KEY_NOT_FOUND key not found
|
vb@0
|
836 |
//
|
vb@0
|
837 |
// caveat:
|
vb@0
|
838 |
// the key_data goes to the ownership of the caller
|
vb@0
|
839 |
// the caller is responsible to free() it (on Windoze use pEp_free())
|
vb@0
|
840 |
|
vb@0
|
841 |
DYNAMIC_API PEP_STATUS export_key(
|
vb@0
|
842 |
PEP_SESSION session, const char *fpr, char **key_data, size_t *size
|
vb@0
|
843 |
);
|
vb@0
|
844 |
|
vb@0
|
845 |
|
vb@1103
|
846 |
// export_secret_key() - export secret key ascii armored
|
vb@1103
|
847 |
//
|
vb@1103
|
848 |
// parameters:
|
vb@1103
|
849 |
// session (in) session handle
|
vb@1103
|
850 |
// fpr (in) fingerprint of key, at least 16 hex digits
|
vb@1103
|
851 |
// key_data (out) ASCII armored OpenPGP secret key
|
vb@1103
|
852 |
// size (out) amount of data to handle
|
vb@1103
|
853 |
//
|
vb@1103
|
854 |
// return value:
|
vb@1103
|
855 |
// PEP_STATUS_OK = 0 key was successfully exported
|
vb@1103
|
856 |
// PEP_OUT_OF_MEMORY out of memory
|
vb@1103
|
857 |
// PEP_KEY_NOT_FOUND key not found
|
vb@1103
|
858 |
// PEP_CANNOT_EXPORT_KEY cannot export secret key (i.e. it's on an HKS)
|
vb@1103
|
859 |
//
|
vb@1103
|
860 |
// caveat:
|
vb@1103
|
861 |
// the key_data goes to the ownership of the caller
|
vb@1103
|
862 |
// the caller is responsible to free() it (on Windoze use pEp_free())
|
vb@1103
|
863 |
// beware of leaking secret key data - overwrite it in memory after use
|
vb@1103
|
864 |
|
vb@1103
|
865 |
DYNAMIC_API PEP_STATUS export_secrect_key(
|
vb@1103
|
866 |
PEP_SESSION session, const char *fpr, char **key_data, size_t *size
|
vb@1103
|
867 |
);
|
vb@1103
|
868 |
|
vb@1103
|
869 |
|
vb@0
|
870 |
// recv_key() - update key(s) from keyserver
|
vb@0
|
871 |
//
|
vb@0
|
872 |
// parameters:
|
vb@0
|
873 |
// session (in) session handle
|
vb@0
|
874 |
// pattern (in) key id, user id or address to search for as
|
vb@0
|
875 |
// UTF-8 string
|
vb@0
|
876 |
|
vb@0
|
877 |
DYNAMIC_API PEP_STATUS recv_key(PEP_SESSION session, const char *pattern);
|
vb@0
|
878 |
|
vb@0
|
879 |
|
vb@0
|
880 |
// find_keys() - find keys in keyring
|
vb@0
|
881 |
//
|
vb@0
|
882 |
// parameters:
|
vb@0
|
883 |
// session (in) session handle
|
vb@0
|
884 |
// pattern (in) key id, user id or address to search for as
|
vb@0
|
885 |
// UTF-8 string
|
vb@0
|
886 |
// keylist (out) list of fingerprints found or NULL on error
|
vb@0
|
887 |
//
|
vb@0
|
888 |
// caveat:
|
roker@529
|
889 |
// the ownerships of keylist isgoing to the caller
|
roker@529
|
890 |
// the caller must use free_stringlist() to free it
|
vb@0
|
891 |
|
vb@0
|
892 |
|
vb@0
|
893 |
DYNAMIC_API PEP_STATUS find_keys(
|
vb@0
|
894 |
PEP_SESSION session, const char *pattern, stringlist_t **keylist
|
vb@0
|
895 |
);
|
vb@0
|
896 |
|
vb@0
|
897 |
// send_key() - send key(s) to keyserver
|
vb@0
|
898 |
//
|
vb@0
|
899 |
// parameters:
|
vb@0
|
900 |
// session (in) session handle
|
vb@0
|
901 |
// pattern (in) key id, user id or address to search for as
|
vb@0
|
902 |
// UTF-8 string
|
vb@0
|
903 |
|
vb@0
|
904 |
DYNAMIC_API PEP_STATUS send_key(PEP_SESSION session, const char *pattern);
|
vb@0
|
905 |
|
vb@0
|
906 |
|
vb@0
|
907 |
// pEp_free() - free memory allocated by pEp engine
|
vb@0
|
908 |
//
|
vb@0
|
909 |
// parameters:
|
vb@0
|
910 |
// p (in) pointer to free
|
vb@0
|
911 |
//
|
vb@0
|
912 |
// The reason for this function is that heap management can be a pretty
|
vb@0
|
913 |
// complex task with Windoze. This free() version calls the free()
|
vb@0
|
914 |
// implementation of the C runtime library which was used to build pEp engine,
|
vb@0
|
915 |
// so you're using the correct heap. For more information, see:
|
vb@0
|
916 |
// <http://msdn.microsoft.com/en-us/library/windows/desktop/aa366711(v=vs.85).aspx>
|
vb@0
|
917 |
|
vb@0
|
918 |
DYNAMIC_API void pEp_free(void *p);
|
vb@0
|
919 |
|
vb@8
|
920 |
|
vb@8
|
921 |
// get_trust() - get the trust level a key has for a person
|
vb@8
|
922 |
//
|
vb@8
|
923 |
// parameters:
|
vb@8
|
924 |
// session (in) session handle
|
vb@8
|
925 |
// identity (inout) user_id and fpr to check as UTF-8 strings (in)
|
krista@2461
|
926 |
// comm_type as result (out)
|
vb@8
|
927 |
//
|
vb@14
|
928 |
// this function modifies the given identity struct; the struct remains in
|
vb@251
|
929 |
// the ownership of the caller
|
vb@14
|
930 |
// if the trust level cannot be determined identity->comm_type is set
|
vb@14
|
931 |
// to PEP_ct_unknown
|
vb@8
|
932 |
|
vb@8
|
933 |
DYNAMIC_API PEP_STATUS get_trust(PEP_SESSION session, pEp_identity *identity);
|
vb@8
|
934 |
|
krista@2129
|
935 |
|
krista@1797
|
936 |
PEP_STATUS set_trust(PEP_SESSION session,
|
krista@1797
|
937 |
const char* user_id,
|
krista@1797
|
938 |
const char* fpr,
|
krista@1797
|
939 |
PEP_comm_type comm_type);
|
krista@1805
|
940 |
|
krista@1805
|
941 |
PEP_STATUS update_trust_for_fpr(PEP_SESSION session,
|
krista@1805
|
942 |
const char* fpr,
|
krista@1805
|
943 |
PEP_comm_type comm_type);
|
vb@8
|
944 |
|
vb@251
|
945 |
// least_trust() - get the least known trust level for a key in the database
|
vb@251
|
946 |
//
|
vb@251
|
947 |
// parameters:
|
vb@251
|
948 |
// session (in) session handle
|
vb@251
|
949 |
// fpr (in) fingerprint of key to check
|
vb@251
|
950 |
// comm_type (out) least comm_type as result (out)
|
vb@251
|
951 |
//
|
vb@251
|
952 |
// if the trust level cannot be determined comm_type is set to PEP_ct_unknown
|
vb@251
|
953 |
|
vb@251
|
954 |
DYNAMIC_API PEP_STATUS least_trust(
|
vb@251
|
955 |
PEP_SESSION session,
|
vb@251
|
956 |
const char *fpr,
|
vb@251
|
957 |
PEP_comm_type *comm_type
|
vb@251
|
958 |
);
|
vb@251
|
959 |
|
vb@251
|
960 |
|
vb@9
|
961 |
// get_key_rating() - get the rating a bare key has
|
vb@9
|
962 |
//
|
vb@9
|
963 |
// parameters:
|
vb@9
|
964 |
// session (in) session handle
|
vb@9
|
965 |
// fpr (in) unique identifyer for key as UTF-8 string
|
vb@9
|
966 |
// comm_type (out) key rating
|
vb@10
|
967 |
//
|
vb@14
|
968 |
// if an error occurs, *comm_type is set to PEP_ct_unknown and an error
|
vb@10
|
969 |
// is returned
|
vb@9
|
970 |
|
vb@9
|
971 |
DYNAMIC_API PEP_STATUS get_key_rating(
|
vb@14
|
972 |
PEP_SESSION session,
|
vb@14
|
973 |
const char *fpr,
|
vb@14
|
974 |
PEP_comm_type *comm_type
|
vb@9
|
975 |
);
|
vb@9
|
976 |
|
vb@9
|
977 |
|
vb@198
|
978 |
// renew_key() - renew an expired key
|
vb@196
|
979 |
//
|
vb@196
|
980 |
// parameters:
|
vb@196
|
981 |
// session (in) session handle
|
vb@214
|
982 |
// fpr (in) ID of key to renew as UTF-8 string
|
vb@201
|
983 |
// ts (in) timestamp when key should expire or NULL for
|
vb@201
|
984 |
// default
|
vb@196
|
985 |
|
vb@201
|
986 |
DYNAMIC_API PEP_STATUS renew_key(
|
vb@201
|
987 |
PEP_SESSION session,
|
vb@201
|
988 |
const char *fpr,
|
vb@201
|
989 |
const timestamp *ts
|
vb@201
|
990 |
);
|
vb@196
|
991 |
|
vb@196
|
992 |
|
vb@224
|
993 |
// revoke_key() - revoke a key
|
vb@197
|
994 |
//
|
vb@197
|
995 |
// parameters:
|
vb@197
|
996 |
// session (in) session handle
|
vb@214
|
997 |
// fpr (in) ID of key to revoke as UTF-8 string
|
vb@211
|
998 |
// reason (in) text with reason for revoke as UTF-8 string
|
vb@211
|
999 |
// or NULL if reason unknown
|
vb@211
|
1000 |
//
|
vb@211
|
1001 |
// caveat:
|
vb@211
|
1002 |
// reason text must not include empty lines
|
vb@224
|
1003 |
// this function is meant for internal use only; better use
|
krista@1213
|
1004 |
// key_mistrusted() of keymanagement API
|
vb@197
|
1005 |
|
vb@211
|
1006 |
DYNAMIC_API PEP_STATUS revoke_key(
|
vb@211
|
1007 |
PEP_SESSION session,
|
vb@211
|
1008 |
const char *fpr,
|
vb@211
|
1009 |
const char *reason
|
vb@211
|
1010 |
);
|
vb@197
|
1011 |
|
vb@197
|
1012 |
|
vb@214
|
1013 |
// key_expired() - flags if a key is already expired
|
vb@214
|
1014 |
//
|
vb@214
|
1015 |
// parameters:
|
vb@214
|
1016 |
// session (in) session handle
|
vb@214
|
1017 |
// fpr (in) ID of key to check as UTF-8 string
|
Edouard@701
|
1018 |
// when (in) UTC time of when should expiry be considered
|
vb@214
|
1019 |
// expired (out) flag if key expired
|
vb@214
|
1020 |
|
vb@214
|
1021 |
DYNAMIC_API PEP_STATUS key_expired(
|
vb@214
|
1022 |
PEP_SESSION session,
|
vb@214
|
1023 |
const char *fpr,
|
Edouard@701
|
1024 |
const time_t when,
|
vb@214
|
1025 |
bool *expired
|
vb@214
|
1026 |
);
|
vb@214
|
1027 |
|
Edouard@694
|
1028 |
|
Edouard@694
|
1029 |
// key_revoked() - flags if a key is already revoked
|
Edouard@694
|
1030 |
//
|
Edouard@694
|
1031 |
// parameters:
|
Edouard@694
|
1032 |
// session (in) session handle
|
Edouard@694
|
1033 |
// fpr (in) ID of key to check as UTF-8 string
|
Edouard@694
|
1034 |
// revoked (out) flag if key revoked
|
Edouard@694
|
1035 |
|
Edouard@694
|
1036 |
DYNAMIC_API PEP_STATUS key_revoked(
|
Edouard@694
|
1037 |
PEP_SESSION session,
|
Edouard@694
|
1038 |
const char *fpr,
|
Edouard@694
|
1039 |
bool *revoked
|
Edouard@694
|
1040 |
);
|
Edouard@694
|
1041 |
|
krista@1797
|
1042 |
PEP_STATUS get_key_userids(
|
krista@1797
|
1043 |
PEP_SESSION session,
|
krista@1797
|
1044 |
const char* fpr,
|
krista@1797
|
1045 |
stringlist_t** keylist
|
krista@1797
|
1046 |
);
|
krista@1797
|
1047 |
|
vb@214
|
1048 |
|
vb@450
|
1049 |
// get_crashdump_log() - get the last log messages out
|
vb@450
|
1050 |
//
|
vb@450
|
1051 |
// parameters:
|
vb@450
|
1052 |
// session (in) session handle
|
vb@450
|
1053 |
// maxlines (in) maximum number of lines (0 for default)
|
vb@458
|
1054 |
// logdata (out) logdata as string in double quoted CSV format
|
vb@463
|
1055 |
// column1 is title
|
vb@463
|
1056 |
// column2 is entity
|
vb@463
|
1057 |
// column3 is description
|
vb@463
|
1058 |
// column4 is comment
|
vb@462
|
1059 |
//
|
vb@462
|
1060 |
// caveat:
|
vb@462
|
1061 |
// the ownership of logdata goes to the caller
|
vb@450
|
1062 |
|
vb@450
|
1063 |
DYNAMIC_API PEP_STATUS get_crashdump_log(
|
vb@450
|
1064 |
PEP_SESSION session,
|
vb@450
|
1065 |
int maxlines,
|
vb@450
|
1066 |
char **logdata
|
vb@450
|
1067 |
);
|
vb@450
|
1068 |
|
vb@450
|
1069 |
|
dirk@501
|
1070 |
// get_languagelist() - get the list of languages
|
vb@458
|
1071 |
//
|
vb@458
|
1072 |
// parameters:
|
vb@458
|
1073 |
// session (in) session handle
|
vb@458
|
1074 |
// languages (out) languages as string in double quoted CSV format
|
vb@463
|
1075 |
// column 1 is the ISO 639-1 language code
|
vb@463
|
1076 |
// column 2 is the name of the language
|
vb@462
|
1077 |
//
|
vb@462
|
1078 |
// caveat:
|
vb@462
|
1079 |
// the ownership of languages goes to the caller
|
vb@458
|
1080 |
|
vb@458
|
1081 |
DYNAMIC_API PEP_STATUS get_languagelist(
|
vb@458
|
1082 |
PEP_SESSION session,
|
vb@458
|
1083 |
char **languages
|
vb@458
|
1084 |
);
|
vb@458
|
1085 |
|
vb@458
|
1086 |
|
vb@458
|
1087 |
// get_phrase() - get phrase in a dedicated language through i18n
|
vb@458
|
1088 |
//
|
vb@458
|
1089 |
// parameters:
|
vb@458
|
1090 |
// session (in) session handle
|
roker@529
|
1091 |
// lang (in) C string with ISO 639-1 language code
|
vb@458
|
1092 |
// phrase_id (in) id of phrase in i18n
|
vb@458
|
1093 |
// phrase (out) phrase as UTF-8 string
|
vb@462
|
1094 |
//
|
vb@462
|
1095 |
// caveat:
|
vb@462
|
1096 |
// the ownership of phrase goes to the caller
|
vb@458
|
1097 |
|
vb@458
|
1098 |
DYNAMIC_API PEP_STATUS get_phrase(
|
vb@458
|
1099 |
PEP_SESSION session,
|
vb@458
|
1100 |
const char *lang,
|
vb@458
|
1101 |
int phrase_id,
|
vb@458
|
1102 |
char **phrase
|
vb@458
|
1103 |
);
|
vb@458
|
1104 |
|
vb@458
|
1105 |
|
vb@632
|
1106 |
// sequence_value() - raise the value of a named sequence and retrieve it
|
vb@632
|
1107 |
//
|
vb@632
|
1108 |
// parameters:
|
vb@632
|
1109 |
// session (in) session handle
|
vb@1085
|
1110 |
// name (inout) name of sequence or char[37] set to {0, }
|
vb@1086
|
1111 |
// for new own sequence named as UUID
|
vb@1085
|
1112 |
// value (inout) value of sequence value to test or 0 for
|
vb@1085
|
1113 |
// getting next value
|
vb@1085
|
1114 |
//
|
vb@1085
|
1115 |
// returns:
|
vb@1086
|
1116 |
// PEP_STATUS_OK no error, not own sequence
|
vb@1086
|
1117 |
// PEP_SEQUENCE_VIOLATED if sequence violated
|
vb@1086
|
1118 |
// PEP_CANNOT_INCREASE_SEQUENCE if sequence cannot be increased
|
vb@1086
|
1119 |
// PEP_OWN_SEQUENCE if own sequence
|
vb@632
|
1120 |
|
vb@632
|
1121 |
DYNAMIC_API PEP_STATUS sequence_value(
|
vb@632
|
1122 |
PEP_SESSION session,
|
vb@1085
|
1123 |
char *name,
|
vb@652
|
1124 |
int32_t *value
|
vb@632
|
1125 |
);
|
vb@632
|
1126 |
|
vb@1044
|
1127 |
|
Edouard@694
|
1128 |
// set_revoked() - records relation between a revoked key and its replacement
|
Edouard@694
|
1129 |
//
|
Edouard@694
|
1130 |
// parameters:
|
Edouard@694
|
1131 |
// session (in) session handle
|
Edouard@694
|
1132 |
// revoked_fpr (in) revoked fingerprint
|
Edouard@694
|
1133 |
// replacement_fpr (in) replacement key fingerprint
|
Edouard@694
|
1134 |
// revocation_date (in) revocation date
|
Edouard@694
|
1135 |
|
Edouard@693
|
1136 |
DYNAMIC_API PEP_STATUS set_revoked(
|
Edouard@693
|
1137 |
PEP_SESSION session,
|
Edouard@693
|
1138 |
const char *revoked_fpr,
|
Edouard@693
|
1139 |
const char *replacement_fpr,
|
Edouard@693
|
1140 |
const uint64_t revocation_date
|
Edouard@693
|
1141 |
);
|
Edouard@693
|
1142 |
|
vb@958
|
1143 |
|
Edouard@694
|
1144 |
// get_revoked() - find revoked key that may have been replaced by given key, if any
|
Edouard@694
|
1145 |
//
|
Edouard@694
|
1146 |
// parameters:
|
Edouard@694
|
1147 |
// session (in) session handle
|
Edouard@694
|
1148 |
// fpr (in) given fingerprint
|
Edouard@694
|
1149 |
// revoked_fpr (out) revoked fingerprint
|
Edouard@694
|
1150 |
// revocation_date (out) revocation date
|
Edouard@694
|
1151 |
|
Edouard@693
|
1152 |
DYNAMIC_API PEP_STATUS get_revoked(
|
Edouard@693
|
1153 |
PEP_SESSION session,
|
Edouard@693
|
1154 |
const char *fpr,
|
Edouard@693
|
1155 |
char **revoked_fpr,
|
Edouard@693
|
1156 |
uint64_t *revocation_date
|
Edouard@693
|
1157 |
);
|
Edouard@693
|
1158 |
|
vb@632
|
1159 |
|
vb@958
|
1160 |
// key_created() - get creation date of a key
|
vb@958
|
1161 |
//
|
vb@958
|
1162 |
// parameters:
|
vb@958
|
1163 |
// session (in) session handle
|
vb@958
|
1164 |
// fpr (in) fingerprint of key
|
vb@958
|
1165 |
// created (out) date of creation
|
vb@958
|
1166 |
|
vb@958
|
1167 |
PEP_STATUS key_created(
|
vb@958
|
1168 |
PEP_SESSION session,
|
vb@958
|
1169 |
const char *fpr,
|
vb@958
|
1170 |
time_t *created
|
vb@958
|
1171 |
);
|
vb@958
|
1172 |
|
vb@958
|
1173 |
|
krista@1377
|
1174 |
// find_private_keys() - find keys in keyring
|
krista@1357
|
1175 |
//
|
krista@1357
|
1176 |
// parameters:
|
krista@1357
|
1177 |
// session (in) session handle
|
krista@1357
|
1178 |
// pattern (in) key id, user id or address to search for as
|
krista@1357
|
1179 |
// UTF-8 string
|
krista@1357
|
1180 |
// keylist (out) list of fingerprints found or NULL on error
|
krista@1357
|
1181 |
//
|
krista@1357
|
1182 |
// caveat:
|
krista@1357
|
1183 |
// the ownerships of keylist isgoing to the caller
|
krista@1357
|
1184 |
// the caller must use free_stringlist() to free it
|
krista@1357
|
1185 |
PEP_STATUS find_private_keys(PEP_SESSION session, const char* pattern,
|
krista@1357
|
1186 |
stringlist_t **keylist);
|
krista@1357
|
1187 |
|
krista@1011
|
1188 |
// get_engine_version() - returns the current version of pEpEngine (this is different
|
krista@1011
|
1189 |
// from the pEp protocol version!)
|
krista@1011
|
1190 |
//
|
krista@1011
|
1191 |
// parameters: none
|
krista@1011
|
1192 |
//
|
krista@1011
|
1193 |
// return_value: const char* to the engine version string constant
|
krista@1011
|
1194 |
//
|
krista@1011
|
1195 |
DYNAMIC_API const char* get_engine_version();
|
krista@1011
|
1196 |
|
krista@1307
|
1197 |
|
vb@482
|
1198 |
DYNAMIC_API PEP_STATUS reset_peptest_hack(PEP_SESSION session);
|
vb@482
|
1199 |
|
krista@2461
|
1200 |
// This is used internally when there is a temporary identity to be retrieved
|
krista@2461
|
1201 |
// that may not yet have an FPR attached. See get_identity() for functionality,
|
krista@2461
|
1202 |
// params and caveats.
|
krista@2461
|
1203 |
PEP_STATUS get_identity_without_trust_check(
|
krista@2461
|
1204 |
PEP_SESSION session,
|
krista@2461
|
1205 |
const char *address,
|
krista@2461
|
1206 |
const char *user_id,
|
krista@2461
|
1207 |
pEp_identity **identity
|
krista@2461
|
1208 |
);
|
krista@2461
|
1209 |
|
krista@2461
|
1210 |
PEP_STATUS get_identities_by_address(
|
krista@2461
|
1211 |
PEP_SESSION session,
|
krista@2461
|
1212 |
const char *address,
|
krista@2461
|
1213 |
identity_list** id_list
|
krista@2461
|
1214 |
);
|
krista@2461
|
1215 |
|
krista@2461
|
1216 |
PEP_STATUS replace_userid(PEP_SESSION session, const char* old_uid,
|
krista@2461
|
1217 |
const char* new_uid);
|
krista@2461
|
1218 |
|
krista@2461
|
1219 |
PEP_STATUS remove_fpr_as_default(PEP_SESSION session,
|
krista@2461
|
1220 |
const char* fpr);
|
krista@2461
|
1221 |
|
krista@2461
|
1222 |
|
krista@2461
|
1223 |
PEP_STATUS get_main_user_fpr(PEP_SESSION session,
|
krista@2461
|
1224 |
const char* user_id,
|
krista@2461
|
1225 |
char** main_fpr);
|
krista@2461
|
1226 |
|
krista@2461
|
1227 |
PEP_STATUS replace_main_user_fpr(PEP_SESSION session, const char* user_id,
|
krista@2461
|
1228 |
const char* new_fpr);
|
krista@2461
|
1229 |
|
krista@2461
|
1230 |
PEP_STATUS refresh_userid_default_key(PEP_SESSION session, const char* user_id);
|
krista@2461
|
1231 |
|
vb@0
|
1232 |
#ifdef __cplusplus
|
vb@0
|
1233 |
}
|
vb@0
|
1234 |
#endif
|