Export ISDS server locators
[libisds.git] / src / isds.h
blobc5d71e4b4980d2e32dd3338d33fc8f50eaa441e2
1 #ifndef __ISDS_ISDS_H__
2 #define __ISDS_ISDS_H__
4 /* Public interface for libisds.
5 * Private declarations in isds_priv.h. */
7 #include <stdlib.h> /* For size_t */
8 #include <sys/time.h> /* For struct timeval */
10 #ifdef __cplusplus /* For C++ linker sake */
11 extern "C" {
12 #endif
14 /* _deprecated macro marks library symbols as deprecated. Application should
15 * avoid using such function as soon as possible. */
16 #if defined(__GNUC__)
17 #define _deprecated __attribute__((deprecated))
18 #else
19 #define _deprecated
20 #endif
22 /* Service locators */
23 extern const char isds_locator[]; /* Base URL of production ISDS instance */
24 extern const char isds_testing_locator[]; /* B. URL of testing ISDS instance */
27 struct isds_ctx; /* Context for specific ISDS box */
29 typedef enum {
30 IE_SUCCESS = 0, /* No error, just for C conveniece (0 means Ok) */
31 IE_ERROR, /* Unspecified error */
32 IE_NOTSUP,
33 IE_INVAL,
34 IE_INVALID_CONTEXT,
35 IE_NOT_LOGGED_IN,
36 IE_CONNECTION_CLOSED,
37 IE_TIMED_OUT,
38 IE_NOEXIST,
39 IE_NOMEM,
40 IE_NETWORK,
41 IE_HTTP,
42 IE_SOAP,
43 IE_XML,
44 IE_ISDS,
45 IE_ENUM,
46 IE_DATE,
47 IE_2BIG,
48 IE_2SMALL,
49 IE_NOTUNIQ,
50 IE_NOTEQUAL,
51 IE_PARTIAL_SUCCESS
52 } isds_error;
54 typedef enum {
55 ILL_NONE = 0,
56 ILL_CRIT = 10,
57 ILL_ERR = 20,
58 ILL_WARNING = 30,
59 ILL_INFO = 40,
60 ILL_DEBUG = 50,
61 ILL_ALL = 100
62 } isds_log_level;
64 typedef enum {
65 ILF_NONE = 0x0,
66 ILF_HTTP = 0x1,
67 ILF_SOAP = 0x2,
68 ILF_ISDS = 0x4,
69 ILF_FILE = 0x8,
70 ILF_SEC = 0x10,
71 ILF_XML = 0x20,
72 ILF_ALL = 0xFF
73 } isds_log_facility;
75 /* Return text description of ISDS error */
76 const char *isds_strerror(const isds_error error);
78 /* TLS libisds options */
79 typedef enum {
80 ITLS_VERIFY_SERVER, /* _Bool: Verify server idetity? */
81 ITLS_CA_FILE, /* char *: File name with CA certificates */
82 ITLS_CA_DIRECTORY /* char *: Directory name with CA certificates */
83 } isds_tls_option;
85 /* Box type */
86 typedef enum {
87 DBTYPE_SYSTEM = 0, /* This is special sender value for messages
88 sent by ISDS. */
89 DBTYPE_OVM = 10,
90 DBTYPE_OVM_NOTAR = 11,
91 DBTYPE_OVM_EXEKUT = 12,
92 DBTYPE_OVM_REQ = 13,
93 DBTYPE_PO = 20,
94 DBTYPE_PO_ZAK = 21,
95 DBTYPE_PO_REQ = 22,
96 DBTYPE_PFO = 30,
97 DBTYPE_PFO_ADVOK = 31,
98 DBTYPE_PFO_DANPOR = 32,
99 DBTYPE_PFO_INSSPR = 33,
100 DBTYPE_FO = 40
101 } isds_DbType;
103 /* Box status from point of view of accesibilty */
104 typedef enum {
105 DBSTATE_ACCESSIBLE = 1,
106 DBSTATE_TEMP_UNACCESSIBLE = 2,
107 DBSTATE_NOT_YET_ACCESSIBLE = 3,
108 DBSTATE_PERM_UNACCESSIBLE = 4,
109 DBSTATE_REMOVED = 5
110 } isds_DbState;
112 /* User permissions from point of view of ISDS.
113 * Instances can be bitmaps of any discrete values. */
114 typedef enum {
115 PRIVIL_READ_NON_PERSONAL = 0x1, /* Can download and read messages with
116 dmPersonalDelivery == false */
117 PRIVIL_READ_ALL = 0x2, /* Can download and read messages with
118 dmPersonalDelivery == true */
119 PRIVIL_CREATE_DM = 0x4, /* Can create and sent messages,
120 can dowload outgoing (sent) messages */
121 PRIVIL_VIEW_INFO = 0x8, /* Can list messages and data about
122 post and delivery */
123 PRIVIL_SEARCH_DB = 0x10, /* Can search for boxes */
124 PRIVIL_OWNER_ADM = 0x20, /* Can administer his box (add/remove
125 permitted users and theirs
126 permissions) */
127 PRIVIL_READ_VAULT = 0x40, /* Cen read message stored in data safe */
128 PRIVIL_ERASE_VAULT = 0x80 /* Can delete messages from data safe */
129 } isds_priviledges;
131 /* Message status */
132 typedef enum {
133 MESSAGESTATE_SENT = 0x2, /* Message has been put into ISDS */
134 MESSAGESTATE_STAMPED = 0x4, /* Message stamped by TSA */
135 MESSAGESTATE_INFECTED = 0x8, /* Message included virues,
136 infected document has been removed */
137 MESSAGESTATE_DELIVERED = 0x10, /* Message delivered
138 (dmDeliveryTime stored) */
139 MESSAGESTATE_SUBSTITUTED = 0x20, /* Message delivered through fiction,
140 dmAcceptanceTime stored */
141 MESSAGESTATE_RECEIVED = 0x40, /* Message accepted (by user login or
142 user explicit request),
143 dmAcceptanceTime stored */
144 MESSAGESTATE_READ = 0x80, /* Message has been read by user */
145 MESSAGESTATE_UNDELIVERABLE = 0x100, /* Message could not been delivered
146 (e.g. recipent box has been made
147 unaccessible meantime) */
148 MESSAGESTATE_REMOVED = 0x200, /* Message content deleted */
149 MESSAGESTATE_IN_SAFE = 0x400 /* Message stored in data safe */
151 } isds_message_status;
152 #define MESSAGESTATE_ANY 0x7FE /* Union of all isds_message_status
153 values */
155 /* Hash algoritm types */
156 typedef enum {
157 HASH_ALGORITHM_MD5,
158 HASH_ALGORITHM_SHA_1,
159 HASH_ALGORITHM_SHA_224,
160 HASH_ALGORITHM_SHA_256,
161 HASH_ALGORITHM_SHA_384,
162 HASH_ALGORITHM_SHA_512,
163 } isds_hash_algorithm;
165 /* Buffer storage strategy.
166 * How function should embed application provided buffer into raw element of
167 * output structure. */
168 typedef enum {
169 BUFFER_DONT_STORE, /* Don't fill raw memeber */
170 BUFFER_COPY, /* Copy buffer content into newly allocated raw */
171 BUFFER_MOVE /* Just copy pointer.
172 But leave deallocation to isds_*_free(). */
173 } isds_buffer_strategy;
175 /* Hash value storage */
176 struct isds_hash {
177 isds_hash_algorithm algorithm; /* Hash algoritgm */
178 size_t length; /* Hash value lenght in bytes */
179 void *value; /* Hash value */
182 /* Name of person */
183 struct isds_PersonName {
184 char *pnFirstName;
185 char *pnMiddleName;
186 char *pnLastName;
187 char *pnLastNameAtBirth;
190 /* Date and place of birth */
191 struct isds_BirthInfo {
192 struct tm *biDate; /* Date of Birth in local time at birth place,
193 only tm_year, tm_mon and tm_mday carry sane
194 value */
195 char *biCity;
196 char *biCounty; /* German: Bezirk, Czech: okres */
197 char *biState;
200 /* Post address */
201 struct isds_Address {
202 char *adCity;
203 char *adStreet;
204 char *adNumberInStreet;
205 char *adNumberInMunicipality;
206 char *adZipCode;
207 char *adState;
210 /* Data about box and his owner.
211 * NULL pointer means undefined value */
212 struct isds_DbOwnerInfo {
213 char *dbID; /* Box ID [Max. 7 chars] */
214 isds_DbType *dbType; /* Box Type */
215 char *ic; /* ID */
216 struct isds_PersonName *personName; /* Name of person */
217 char *firmName; /* Name of firm */
218 struct isds_BirthInfo *birthInfo; /* Birth of person */
219 struct isds_Address *address; /* Post address */
220 char *nationality;
221 char *email;
222 char *telNumber;
223 char *identifier; /* External box identifier for data
224 provider (OVM, PO, maybe PFO)
225 [Max. 20 chars] */
226 char *registryCode; /* PFO External registry code
227 [Max. 5 chars] */
228 long int *dbState; /* Box state; 1 <=> active box;
229 long int beacause xsd:integer
230 TODO: enum? */
231 _Bool *dbEffectiveOVM; /* Box has OVM role (§ 5a) */
232 _Bool *dbOpenAddressing; /* Non-OVM Box is free to recieve
233 messages from anybody */
236 /* User type */
237 typedef enum {
238 USERTYPE_PRIMARY, /* Owner of the box */
239 USERTYPE_ENTRUSTED, /* User with limited access to the box */
240 USERTYPE_ADMINISTRATOR, /* User to manage ENTRUSTED_USERs */
241 USERTYPE_OFFICIAL /* ??? */
242 } isds_UserType;
244 /* Data about user.
245 * NULL pointer means undefined value */
246 struct isds_DbUserInfo {
247 char *userID; /* User ID [Min. 6, max. 12 characters] */
248 isds_UserType *userType; /* User type */
249 long int *userPrivils; /* Set of user permissions */
250 struct isds_PersonName *personName; /* Name of the person */
251 struct isds_Address *address; /* Post address */
252 struct tm *biDate; /* Date of birth in local time,
253 only tm_year, tm_mon and tm_mday carry sane
254 value */
255 char *ic; /* ID of a supervising firm [Max. 8 chars] */
256 char *firmName; /* Name of a supervising firm
257 [Max. 100 chars] */
258 char *caStreet; /* Street and number of contact address */
259 char *caCity; /* Czech City of contact address */
260 char *caZipCode; /* Post office code of contact address */
263 /* Message event type */
264 typedef enum {
265 EVENT_UKNOWN, /* Event unknown to this library */
266 EVENT_ACCEPTED_BY_RECIPIENT, /* Message has been delivered and accepted
267 by recipeint action */
268 EVENT_ACCEPTED_BY_FICTION, /* Message has been delivered, acceptance
269 timed out, considered as accepted */
270 EVENT_UNDELIVERABLE, /* Recipient box made unaccessible,
271 thus message is undelivarable */
272 EVENT_COMMERCIAL_ACCEPTED /* Recipient confirmed acceptace of
273 commercial message */
274 } isds_event_type;
276 /* Message event
277 * Alle members are optional as specification states so. */
278 struct isds_event {
279 struct timeval *time; /* When the event occurred */
280 isds_event_type *type; /* Type of the event */
281 char *description; /* Human readable event description
282 generated by ISDS (Czech) */
285 /* Message envelope
286 * Be ware that the string length contraints are forced only on output
287 * memebers transmitted to ISDS. The other direction (downloded from ISDS)
288 * can break these rules. It should not happen, but nobody knows how much
289 * incompatible new version of ISDS protocol will be. This is the gold
290 * Internet rule: be strict on what you put, be tollerant on what you get. */
291 struct isds_envelope {
292 /* Following memebers apply to incoming messages only: */
293 char *dmID; /* Message ID.
294 Maximal length is 20 characters. */
295 char *dbIDSender; /* Box ID of sender.
296 Special value "aaaaaaa" means sent by
297 ISDS.
298 Maximal length is 7 characters. */
299 char *dmSender; /* Sender name;
300 Maximal length is 100 characters. */
301 char *dmSenderAddress; /* Postal address of sender;
302 Maximal length is 100 characters. */
303 long int *dmSenderType; /* Gross Box type of sender
304 TODO: isds_DbType ? */
305 char *dmRecipient; /* Recipient name;
306 Maximal length is 100 characters. */
307 char *dmRecipientAddress; /* Postal address of recipient;
308 Maximal length is 100 characters. */
309 _Bool *dmAmbiguousRecipient; /* Recipient has OVM role */
310 char *dmType; /* Message type:
311 "V" is public message
312 "K" is commercial message */
314 /* Following memebers are assigned by ISDS in different phases of message
315 * life cycle. */
316 unsigned long int *dmOrdinal; /* Ordinal number in list of
317 incoming/outgoing messages */
318 isds_message_status *dmMessageStatus; /* Message state */
319 long int *dmAttachmentSize; /* Size of message documents in
320 kilobytes (rounded). */
321 struct timeval *dmDeliveryTime; /* Time of delivery into a box
322 NULL, if message has not been
323 delivered yet */
324 struct timeval *dmAcceptanceTime; /* Time of accpetance of the message
325 by an user. NULL if message has not
326 been accepted yet. */
327 struct isds_hash *hash; /* Message hash.
328 This is hash of isds:dmDM subtree. */
329 void *timestamp; /* Qualified time stamp */
330 size_t timestamp_length; /* Lenght of timestamp in bytes */
331 struct isds_list *events; /* Events message passed trough;
332 List of isds_event's. */
335 /* Following members apply to both outgoing and incoming messages: */
336 char *dmSenderOrgUnit; /* Organisation unit of sender as string;
337 Optional. */
338 long int *dmSenderOrgUnitNum; /* Organisation unit of sender as number;
339 Optional. */
340 char *dbIDRecipient; /* Box ID of recipient; Mandatory.
341 Maximal length is 7 characters. */
342 char *dmRecipientOrgUnit; /* Organisation unit of recipient as
343 string; Optional. */
344 long int *dmRecipientOrgUnitNum; /* Organisation unit of recipient as
345 number; Optional. */
346 char *dmToHands; /* Person in recipient organisation;
347 Optional. */
348 char *dmAnnotation; /* Subject (title) of the message.
349 Maximal length is 255 characters. */
350 char *dmRecipientRefNumber; /* Czech: číslo jednací příjemce; Optional.
351 Maximal length is 50 characters. */
352 char *dmSenderRefNumber; /* Czech: číslo jednací odesílatele;
353 Optional. Maximal lenght is 50 chars. */
354 char *dmRecipientIdent; /* Czech: spisová značka příjemce; Optional.
355 Maximal length is 50 characters. */
356 char *dmSenderIdent; /* Czech: spisová značka odesílatele;
357 Optional. Maximal lenght is 50 chars. */
359 /* Act addressing in Czech Republic:
360 * Point (Parahraph) § Section Law/Year Coll. */
361 long int *dmLegalTitleLaw; /* Number of act mandating authority */
362 long int *dmLegalTitleYear; /* Year of act issue mandating authority */
363 char *dmLegalTitleSect; /* Section of act mandating authority.
364 Czech: paragraf */
365 char *dmLegalTitlePar; /* Parahraph of act mandating authority.
366 Czech: odstavec */
367 char *dmLegalTitlePoint; /* Point of act mandating authority.
368 Czech: písmeno */
370 _Bool *dmPersonalDelivery; /* If true, only person with higher
371 priviledges can read this message */
372 _Bool *dmAllowSubstDelivery; /* Allow delivery through fiction.
373 I.e. Even if recipient did not read this
374 message, message is considered as
375 delivered after (currently) 10 days.
376 This is delivery through fiction.
377 Applies only to OVM dbType sender. */
378 _Bool *dmOVM; /* OVM sending mode.
379 Non-OVM dbType boxes that has
380 dbEffectiveOVM == true MUST select
381 between true (OVM mode) and
382 false (non-OVM mode).
383 Optionable; Implicit value is true. */
387 /* Document type from point of hiearchy */
388 typedef enum {
389 FILEMETATYPE_MAIN, /* Main document */
390 FILEMETATYPE_ENCLOSURE, /* Appendix */
391 FILEMETATYPE_SIGNATURE, /* Digital signature of other document */
392 FILEMETATYPE_META /* XML document for ESS (electronic
393 document information system) purposes */
394 } isds_FileMetaType;
396 /* Document */
397 struct isds_document {
398 void *data; /* Document content.
399 The encoding and interpretation depends
400 on dmMimeType.
401 TODO: inline XML */
402 size_t data_length; /* Length of the data in bytes */
403 char *dmMimeType; /* MIME type of data; Mandatory. */
404 isds_FileMetaType dmFileMetaType; /* Document type to create hierarchy */
405 char *dmFileGuid; /* Message-local document identifier;
406 Optional. */
407 char *dmUpFileGuid; /* Reference to upper document identifier
408 (dmFileGuid); Optional. */
409 char *dmFileDescr; /* Document name (title). E.g. file name;
410 Mandatory. */
411 char *dmFormat; /* Reference to XML form definition;
412 Defines howto interpret XML document;
413 Optional. */
416 /* Raw message representation content type.
417 * This is necessary to distinguish between different representations without
418 * expensive repated detection.
419 * Infix explanation:
420 * PLAIN_SIGNED data are XML with namespace mangled to signed alternative
421 * CMS_SIGNED data are XML with signed namespace encapsulated in CMS */
422 typedef enum {
423 RAWTYPE_INCOMING_MESSAGE,
424 RAWTYPE_PLAIN_SIGNED_INCOMING_MESSAGE,
425 RAWTYPE_CMS_SIGNED_INCOMING_MESSAGE,
426 RAWTYPE_PLAIN_SIGNED_OUTGOING_MESSAGE,
427 RAWTYPE_CMS_SIGNED_OUTGOING_MESSAGE,
428 RAWTYPE_DELIVERYINFO,
429 RAWTYPE_PLAIN_SIGNED_DELIVERYINFO,
430 RAWTYPE_CMS_SIGNED_DELIVERYINFO
431 } isds_raw_type;
433 /* Message */
434 struct isds_message {
435 void *raw; /* Raw message in XML format as send to or
436 from the ISDS. You can use it to store
437 local copy. This is binary buffer. */
438 size_t raw_length; /* Lenght of raw message in bytes */
439 isds_raw_type raw_type; /* Content type of raw representation
440 Meaningfull only with non-NULL raw
441 member */
442 struct isds_envelope *envelope; /* Message envelope */
443 struct isds_list *documents; /* List of isds_document's.
444 Valid message must contain exactly one
445 document of type FILEMETATYPE_MAIN and
446 can contain any number of other type
447 documents. Totol size of documents
448 must not exceed 10 MB. */
451 /* Message copy recipient and assigned message ID */
452 struct isds_message_copy {
453 /* Input members defined by application */
454 char *dbIDRecipient; /* Box ID of recipient; Mandatory.
455 Maximal length is 7 characters. */
456 char *dmRecipientOrgUnit; /* Organisation unit of recipient as
457 string; Optional. */
458 long int *dmRecipientOrgUnitNum; /* Organisation unit of recipient as
459 number; Optional. */
460 char *dmToHands; /* Person in recipient organisation;
461 Optional. */
463 /* Output members returned from ISDS */
464 isds_error error; /* libisds compatible error of delivery to o ne recipient */
465 char *dmStatus; /* Error description returned by ISDS;
466 Optional. */
467 char *dmID; /* Assigned message ID; Meaningfull only
468 for error == IE_SUCCESS */
471 /* General linked list */
472 struct isds_list {
473 struct isds_list *next; /* Next list item,
474 or NULL if current is last */
475 void *data; /* Payload */
476 void (*destructor) (void **); /* Payload deallocator */
479 /* External box approval */
480 struct isds_approval {
481 _Bool approved; /* True if request for box has been
482 approvedout of ISDS */
483 char *refference; /* Identifier of the approval */
487 /* Initialize ISDS library.
488 * Global function, must be called before other functions.
489 * If it failes you can not use ISDS library and must call isds_cleanup() to
490 * free partially inititialized global variables. */
491 isds_error isds_init(void);
493 /* Deinicialize ISDS library.
494 * Global function, must be called as last library function. */
495 isds_error isds_cleanup(void);
497 /* Create ISDS context.
498 * Each context can be used for different sessions to (possibly) different
499 * ISDS server with different credentials.
500 * Returns new context, or NULL */
501 struct isds_ctx *isds_ctx_create(void);
503 /* Destroy ISDS context and free memmory.
504 * @context will be NULLed on success. */
505 isds_error isds_ctx_free(struct isds_ctx **context);
507 /* Return long message text produced by library fucntion, e.g. detailed error
508 * mesage. Returned pointer is only valid until new library function is
509 * called for the same context. Could be NULL, especially if NULL context is
510 * supplied. Return string is locale encoded. */
511 char *isds_long_message(const struct isds_ctx *context);
513 /* Set logging up.
514 * @facilities is bitmask of isds_log_facility values,
515 * @level is verbosity level. */
516 void isds_set_logging(const unsigned int facilities,
517 const isds_log_level level);
519 /* Function provided by application libisds will call to pass log message.
520 * The message is ussually locale encoded, but raw strings (UTF-8 usually) can
521 * occur when logging raw communitication with ISDS servers. Infixed zero byte
522 * is not excluded, but should not present. Use @length argument to get real
523 * length of the message.
524 * TODO: We will try to fix the encoding issue
525 * @facility is log message class
526 * @level is log message severity
527 * @message is string with zero byte terminator. This can be any arbitrary
528 * chunk of a sentence with or without new line, a sentence can be splitted
529 * into more messages. However it should not happen. If you discover message
530 * without new line, report it as a bug.
531 * @length is size of @message string in bytes excluding trailing zero
532 * @data is pointer that will be passed unchanged to this function at run-time
533 * */
534 typedef void (*isds_log_callback)(
535 isds_log_facility facility, isds_log_level level,
536 const char *message, int length, void *data);
538 /* Register callback function libisds calls when new global log message is
539 * produced by library. Library logs to stderr by default.
540 * @callback is function provided by application libsds will call. See type
541 * defition for @callback argument explanation. Pass NULL to revert logging to
542 * default behaviour.
543 * @data is application specific data @callback gets as last argument */
544 void isds_set_log_callback(isds_log_callback callback, void *data);
546 /* Set timeout in miliseconds for each network job like connecting to server
547 * or sending message. Use 0 to disable timeout limits. */
548 isds_error isds_set_timeout(struct isds_ctx *context,
549 const unsigned int timeout);
551 /* Function provided by application libsds will call with
552 * following five arguments. Value zero of any argument means the value is
553 * unknown.
554 * @upload_total is expected total upload,
555 * @upload_current is cumulative current upload progress
556 * @dowload_total is expected total download
557 * @download_current is cumulative current download progress
558 * @data is pointer that will be passed unchanged to this function at run-time
559 * @return 0 to continue HTTP transfaer, or non-zero to abort transfer */
560 typedef int (*isds_progress_callback)(
561 double upload_total, double upload_current,
562 double download_total, double download_current,
563 void *data);
565 /* Register callback function libisds calls periodocally during HTTP data
566 * transfer.
567 * @context is session context
568 * @callback is function provided by application libsds will call. See type
569 * defition for @callback argument explanation.
570 * @data is application specific data @callback gets as last argument */
571 isds_error isds_set_progress_callback(struct isds_ctx *context,
572 isds_progress_callback callback, void *data);
574 /* Change SSL/TLS settings.
575 * @context is context which setting vill be applied to
576 * @option is name of option. It determines the type of last argument. See
577 * isds_tls_option definition for more info.
578 * @... is value of new setting. Type is determined by @option
579 * */
580 isds_error isds_set_tls(struct isds_ctx *context, const isds_tls_option option,
581 ...);
583 /* Connect and log in into ISDS server.
584 * @url is base address of ISDS web service. Pass NULL or extern isds_locator
585 * variable to use production ISDS instance. You can pass extern
586 * isds_testing_locator variable to select testing instance.
587 * @username is user name of ISDS user
588 * @password is user's secret password
589 * @certificate is NULL terminated string with PEM formated client's
590 * certificate. Use NULL if only password autentication should be performed.
591 * @key is private key for client's certificate as (base64 encoded?) NULL
592 * terminated string. Use NULL if only password autentication is desired.
593 * */
594 isds_error isds_login(struct isds_ctx *context, const char *url,
595 const char *username, const char *password,
596 const char *certificate, const char* key);
598 /* Log out from ISDS server and close connection. */
599 isds_error isds_logout(struct isds_ctx *context);
601 /* Verify connection to ISDS is alive and server is responding.
602 * Sent dumy request to ISDS and expect dummy response. */
603 isds_error isds_ping(struct isds_ctx *context);
605 /* Get data about logged in user and his box. */
606 isds_error isds_GetOwnerInfoFromLogin(struct isds_ctx *context,
607 struct isds_DbOwnerInfo **db_owner_info);
609 /* Get data about logged in user. */
610 isds_error isds_GetUserInfoFromLogin(struct isds_ctx *context,
611 struct isds_DbUserInfo **db_user_info);
613 /* Get expiration time of current password
614 * @context is session context
615 * @expiration is automatically reallocated time when password expires, In
616 * case of error will be nulled. */
617 isds_error isds_get_password_expiration(struct isds_ctx *context,
618 struct timeval **expiration);
620 /* Change user password in ISDS.
621 * User must supply old password, new password will takes effect after some
622 * time, current session can continue. Password must fulfill some constraints.
623 * @context is session context
624 * @old_password is current password.
625 * @new_password is requested new password */
626 isds_error isds_change_password(struct isds_ctx *context,
627 const char *old_password, const char *new_password);
629 /* Create new box.
630 * @context is session context
631 * @box is box description to create including single primary user (in case of
632 * FO box type). It outputs box ID assigned by ISDS in dbID element.
633 * @users is list of struct isds_DbUserInfo (primary users in case of non-FO
634 * box, or contact address of PFO box owner)
635 * @former_names is optional undocumented string. Pass NULL if you don't care.
636 * @upper_box_id is optional ID of supper box if currently created box is
637 * subordinated.
638 * @ceo_label is optional title of OVM box owner (e.g. mayor)
639 * @approval is optional external approval of box manipulation
640 * @refnumber is reallocated serial number of request assigned by ISDS. Use
641 * NULL, if you don't care.*/
642 isds_error isds_add_box(struct isds_ctx *context,
643 struct isds_DbOwnerInfo *box, const struct isds_list *users,
644 const char *former_names, const char *upper_box_id,
645 const char *ceo_label, const struct isds_approval *approval,
646 char **refnumber);
648 /* Notify ISDS about new PFO entity.
649 * This function has no real effect.
650 * @context is session context
651 * @box is PFO description including single primary user.
652 * @users is list of struct isds_DbUserInfo (contact address of PFO box owner)
653 * @former_names is optional undocumented string. Pass NULL if you don't care.
654 * @upper_box_id is optional ID of supper box if currently created box is
655 * subordinated.
656 * @ceo_label is optional title of OVM box owner (e.g. mayor)
657 * @approval is optional external approval of box manipulation
658 * @refnumber is reallocated serial number of request assigned by ISDS. Use
659 * NULL, if you don't care.*/
660 isds_error isds_add_pfoinfo(struct isds_ctx *context,
661 const struct isds_DbOwnerInfo *box, const struct isds_list *users,
662 const char *former_names, const char *upper_box_id,
663 const char *ceo_label, const struct isds_approval *approval,
664 char **refnumber);
666 /* Remove given given box permanetly.
667 * @context is session context
668 * @box is box description to delete
669 * @since is date of box owner cancalation. Only tm_year, tm_mon and tm_mday
670 * carry sane value.
671 * @approval is optional external approval of box manipulation
672 * @refnumber is reallocated serial number of request assigned by ISDS. Use
673 * NULL, if you don't care.*/
674 isds_error isds_delete_box(struct isds_ctx *context,
675 const struct isds_DbOwnerInfo *box, const struct tm *since,
676 const struct isds_approval *approval, char **refnumber);
678 /* Update data about given box.
679 * @context is session context
680 * @old_box current box description
681 * @new_box are updated data about @old_box
682 * @approval is optional external approval of box manipulation
683 * @refnumber is reallocated serial number of request assigned by ISDS. Use
684 * NULL, if you don't care.*/
685 isds_error isds_UpdateDataBoxDescr(struct isds_ctx *context,
686 const struct isds_DbOwnerInfo *old_box,
687 const struct isds_DbOwnerInfo *new_box,
688 const struct isds_approval *approval, char **refnumber);
690 /* Get data about all users assigned to given box.
691 * @context is session context
692 * @box_id is box ID
693 * @users is automatically reallocated list of struct isds_DbUserInfo */
694 isds_error isds_GetDataBoxUsers(struct isds_ctx *context, const char *box_id,
695 struct isds_list **users);
697 /* Update data about user assigned to given box.
698 * @context is session context
699 * @box is box identification
700 * @old_user identifies user to update
701 * @new_user are updated data about @old_user
702 * @refnumber is reallocated serial number of request assigned by ISDS. Use
703 * NULL, if you don't care.*/
704 isds_error isds_UpdateDataBoxUser(struct isds_ctx *context,
705 const struct isds_DbOwnerInfo *box,
706 const struct isds_DbUserInfo *old_user,
707 const struct isds_DbUserInfo *new_user,
708 char **refnumber);
710 /* Reset credentials of user assigned to given box.
711 * @context is session context
712 * @box is box identification
713 * @user identifies user to reset password
714 * @fee_paid is true if fee has been paid, false otherwise
715 * @approval is optional external approval of box manipulation
716 * @token is NULL if new password should be delivered off-line to the user.
717 * It is valid pointer if user should obtain new password on-line on dedicated
718 * web server. Then it output automatically reallocated token user needs to
719 * use to athtorize on the web server to view his new password.
720 * @refnumber is reallocated serial number of request assigned by ISDS. Use
721 * NULL, if you don't care.*/
722 isds_error isds_reset_password(struct isds_ctx *context,
723 const struct isds_DbOwnerInfo *box,
724 const struct isds_DbUserInfo *user,
725 const _Bool fee_paid, const struct isds_approval *approval,
726 char **token, char **refnumber);
728 /* Assign new user to given box.
729 * @context is session context
730 * @box is box identification
731 * @user defines new user to add
732 * @approval is optional external approval of box manipulation
733 * @refnumber is reallocated serial number of request assigned by ISDS. Use
734 * NULL, if you don't care.*/
735 isds_error isds_add_user(struct isds_ctx *context,
736 const struct isds_DbOwnerInfo *box, const struct isds_DbUserInfo *user,
737 const struct isds_approval *approval, char **refnumber);
739 /* Remove user assigned to given box.
740 * @context is session context
741 * @box is box identification
742 * @user identifies user to removve
743 * @approval is optional external approval of box manipulation
744 * @refnumber is reallocated serial number of request assigned by ISDS. Use
745 * NULL, if you don't care.*/
746 isds_error isds_delete_user(struct isds_ctx *context,
747 const struct isds_DbOwnerInfo *box, const struct isds_DbUserInfo *user,
748 const struct isds_approval *approval, char **refnumber);
750 /* Find boxes suiting given criteria.
751 * @context is ISDS session context.
752 * @criteria is filter. You should fill in at least some members.
753 * @boxes is automatically reallocated list of isds_DbOwnerInfo structures,
754 * possibly empty. Input NULL or valid old structure.
755 * @return:
756 * IE_SUCCESS if search sucseeded, @boxes contains usefull data
757 * IE_NOEXIST if no such box exists, @boxes will be NULL
758 * IE_2BIG if too much boxes exist and server truncated the resuluts, @boxes
759 * contains still valid data
760 * other code if something bad happens. @boxes will be NULL. */
761 isds_error isds_FindDataBox(struct isds_ctx *context,
762 const struct isds_DbOwnerInfo *criteria,
763 struct isds_list **boxes);
765 /* Get status of a box.
766 * @context is ISDS session context.
767 * @box_id is UTF-8 encoded box identifier as zero terminated string
768 * @box_status is return value of box status.
769 * @return:
770 * IE_SUCCESS if box has been found and its status retrieved
771 * IE_NOEXIST if box is not known to ISDS server
772 * or other appropriate error.
773 * You can use isds_DbState to enumerate box status. However out of enum
774 * range value can be returned too. This is feature because ISDS
775 * specification leaves the set of values open.
776 * Be ware that status DBSTATE_REMOVED is signaled as IE_SUCCESS. That means
777 * the box has been deleted, but ISDS still lists its former existence. */
778 isds_error isds_CheckDataBox(struct isds_ctx *context, const char *box_id,
779 long int *box_status);
781 /* Switch box into state where box can receive commercial messages (off by
782 * default)
783 * @context is ISDS session context.
784 * @box_id is UTF-8 encoded box identifier as zero terminated string
785 * @allow is true for enable, false for disable commercial messages income
786 * @approval is optional external approval of box manipulation
787 * @refnumber is reallocated serial number of request assigned by ISDS. Use
788 * NULL, if you don't care. */
789 isds_error isds_switch_commercial_receiving(struct isds_ctx *context,
790 const char *box_id, const _Bool allow,
791 const struct isds_approval *approval, char **refnumber);
793 /* Switch box into / out of state where non-OVM box can act as OVM (e.g. force
794 * message acceptance). This is just a box permission. Sender must apply
795 * such role by sending each message.
796 * @context is ISDS session context.
797 * @box_id is UTF-8 encoded box identifier as zero terminated string
798 * @allow is true for enable, false for disable OVM role permission
799 * @approval is optional external approval of box manipulation
800 * @refnumber is reallocated serial number of request assigned by ISDS. Use
801 * NULL, if you don't care. */
802 isds_error isds_switch_effective_ovm(struct isds_ctx *context,
803 const char *box_id, const _Bool allow,
804 const struct isds_approval *approval, char **refnumber);
806 /* Switch box accessibility state on request of box owner.
807 * Despite the name, owner must do the request off-line. This function is
808 * designed for such off-line meeting points (e.g. Czech POINT).
809 * @context is ISDS session context.
810 * @box identifies box to swith accesibilty state.
811 * @allow is true for making accesibale, false to disallow access.
812 * @approval is optional external approval of box manipulation
813 * @refnumber is reallocated serial number of request assigned by ISDS. Use
814 * NULL, if you don't care. */
815 isds_error isds_switch_box_accessibility_on_owner_request(
816 struct isds_ctx *context, const struct isds_DbOwnerInfo *box,
817 const _Bool allow, const struct isds_approval *approval,
818 char **refnumber);
820 /* Disable box accessibility on law enforcement (e.g. by prison) since exact
821 * date.
822 * @context is ISDS session context.
823 * @box identifies box to swith accesibilty state.
824 * @since is date since accesseibility has been denied. This can be past too.
825 * Only tm_year, tm_mon and tm_mday carry sane value.
826 * @approval is optional external approval of box manipulation
827 * @refnumber is reallocated serial number of request assigned by ISDS. Use
828 * NULL, if you don't care. */
829 isds_error isds_disable_box_accessibility_externaly(
830 struct isds_ctx *context, const struct isds_DbOwnerInfo *box,
831 const struct tm *since, const struct isds_approval *approval,
832 char **refnumber);
834 /* Send a message via ISDS to a recipent
835 * @context is session context
836 * @outgoing_message is message to send; Some memebers are mandatory (like
837 * dbIDRecipient), some are optional and some are irrelevant (especialy data
838 * about sender). Included pointer to isds_list documents must contain at
839 * least one document of FILEMETATYPE_MAIN. This is read-write structure, some
840 * members will be filled with valid data from ISDS. Exact list of write
841 * members is subject to change. Currently dmId is changed.
842 * @return ISDS_SUCCESS, or other error code if something goes wrong. */
843 isds_error isds_send_message(struct isds_ctx *context,
844 struct isds_message *outgoing_message);
846 /* Send a message via ISDS to a multiple recipents
847 * @context is session context
848 * @outgoing_message is message to send; Some memebers are mandatory,
849 * some are optional and some are irrelevant (especialy data
850 * about sender). Data about recipient will be substituted by ISDS from
851 * @copies. Included pointer to isds_list documents must
852 * contain at least one document of FILEMETATYPE_MAIN.
853 * @copies is list of isds_message_copy structures addressing all desired
854 * recipients. This is read-write structure, some members will be filled with
855 * valid data from ISDS (message IDs, error codes, error descriptions).
856 * @return
857 * ISDS_SUCCESS if all messages have been sent
858 * ISDS_PARTIAL_SUCCESS if sending of some messages has failed (failed and
859 * succesed messages can be identified by copies->data->error),
860 * or other error code if something other goes wrong. */
861 isds_error isds_send_message_to_multiple_recipients(struct isds_ctx *context,
862 const struct isds_message *outgoing_message,
863 struct isds_list *copies);
865 /* Get list of outgoing (already sent) messages.
866 * Any criterion argument can be NULL, if you don't care about it.
867 * @context is session context. Must not be NULL.
868 * @from_time is minimal time and date of message sending inclusive.
869 * @to_time is maximal time and date of message sending inclusive
870 * @dmSenderOrgUnitNum is the same as isds_envelope.dmSenderOrgUnitNum
871 * @status_filter is bit field of isds_message_status values. Use special
872 * value MESSAGESTATE_ANY to signal you don't care. (It's defined as union of
873 * all values, you can use bitwise arithmetic if you want.)
874 * @offset is index of first message we are interested in. First message is 1.
875 * Set to 0 (or 1) if you don't care.
876 * @number is maximal length of list you want to get as input value, outputs
877 * number of messages matching these criteria. Can be NULL if you don't care
878 * (applies to output value either).
879 * @messages is automatically reallocated list of isds_message's. Be ware that
880 * it returns only brief overview (envelope and some other fields) about each
881 * message, not the complete message. FIXME: Specify exact fields.
882 * The list is sorted by delivery time in ascending order.
883 * Use NULL if you don't care about the metadata (useful if you want to know
884 * only the @number). If you provide &NULL, list will be allocated on heap,
885 * if you provide pointer to non-NULL, list will be freed automacally at first.
886 * Also in case of error the list will be NULLed.
887 * @return IE_SUCCESS or appropriate error code. */
888 isds_error isds_get_list_of_sent_messages(struct isds_ctx *context,
889 const struct timeval *from_time, const struct timeval *to_time,
890 const long int *dmSenderOrgUnitNum, const unsigned int status_filter,
891 const unsigned long int offset, unsigned long int *number,
892 struct isds_list **messages);
894 /* Get list of incoming (addressed to you) messages.
895 * Any criterion argument can be NULL, if you don't care about it.
896 * @context is session context. Must not be NULL.
897 * @from_time is minimal time and date of message sending inclusive.
898 * @to_time is maximal time and date of message sending inclusive
899 * @dmSenderOrgUnitNum is the same as isds_envelope.dmSenderOrgUnitNum
900 * @status_filter is bit field of isds_message_status values. Use special
901 * value MESSAGESTATE_ANY to signal you don't care. (It's defined as union of
902 * all values, you can use bitwise arithmetic if you want.)
903 * @offset is index of first message we are interested in. First message is 1.
904 * Set to 0 (or 1) if you don't care.
905 * @number is maximal length of list you want to get as input value, outputs
906 * number of messages matching these criteria. Can be NULL if you don't care
907 * (applies to output value either).
908 * @messages is automatically reallocated list of isds_message's. Be ware that
909 * it returns only brief overview (envelope and some other fields) about each
910 * message, not the complete message. FIXME: Specify exact fields.
911 * Use NULL if you don't care about the metadata (useful if you want to know
912 * only the @number). If you provide &NULL, list will be allocated on heap,
913 * if you provide pointer to non-NULL, list will be freed automacally at first.
914 * Also in case of error the list will be NULLed.
915 * @return IE_SUCCESS or appropriate error code. */
916 isds_error isds_get_list_of_received_messages(struct isds_ctx *context,
917 const struct timeval *from_time, const struct timeval *to_time,
918 const long int *dmSenderOrgUnitNum, const unsigned int status_filter,
919 const unsigned long int offset, unsigned long int *number,
920 struct isds_list **messages);
922 /* Download incoming message envelope identified by ID.
923 * @context is session context
924 * @message_id is message identifier (you can get them from
925 * isds_get_list_of_received_messages())
926 * @message is automatically reallocated message retrieved from ISDS.
927 * It will miss documents per se. Use isds_get_received_message(), if you are
928 * interrested in documents (content) too.
929 * Returned hash and timestamp require documents to be verifiable. */
930 isds_error isds_get_received_envelope(struct isds_ctx *context,
931 const char *message_id, struct isds_message **message);
933 /* Download signed delivery infosheet of given message identified by ID.
934 * @context is session context
935 * @message_id is message identifier (you can get them from
936 * isds_get_list_of_{sent,received}_messages())
937 * @message is automatically reallocated message retrieved from ISDS.
938 * It will miss documents per se. Use isds_get_signed_received_message(),
939 * if you are interrested in documents (content). OTOH, only this function
940 * can get list events message has gone through. */
941 isds_error isds_get_signed_delivery_info(struct isds_ctx *context,
942 const char *message_id, struct isds_message **message);
944 /* Load delivery info of any format from buffer.
945 * @context is session context
946 * @raw_type advertises format of @buffer content. Only delivery info types
947 * are accepted.
948 * @buffer is DER encoded PKCS#7 structure with signed delivery info. You can
949 * retrieve such data from message->raw after calling
950 * isds_get_signed_delivery_info().
951 * @length is length of buffer in bytes.
952 * @message is automatically reallocated message parsed from @buffer.
953 * @strategy selects how buffer will be attached into raw isds_message member.
954 * */
955 isds_error isds_load_delivery_info(struct isds_ctx *context,
956 const isds_raw_type raw_type,
957 const void *buffer, const size_t length,
958 struct isds_message **message, const isds_buffer_strategy strategy);
960 /* Download delivery infosheet of given message identified by ID.
961 * @context is session context
962 * @message_id is message identifier (you can get them from
963 * isds_get_list_of_{sent,received}_messages())
964 * @message is automatically reallocated message retrieved from ISDS.
965 * It will miss documents per se. Use isds_get_received_message(), if you are
966 * interrested in documents (content). OTOH, only this function can get list
967 * events message has gone through. */
968 isds_error isds_get_delivery_info(struct isds_ctx *context,
969 const char *message_id, struct isds_message **message);
971 /* Deprecated: Use isds_load_message() instead. */
972 /* Load incoming message from buffer.
973 * @context is session context
974 * @buffer XML stream with unsigned message. You can retrieve such data from
975 * message->raw after calling isds_get_received_message().
976 * @length is length of buffer in bytes.
977 * @message is automatically reallocated message parsed from @buffer.
978 * @strategy selects how buffer will be attached into raw isds_message member.
979 * */
980 isds_error isds_load_received_message(struct isds_ctx *context,
981 const void *buffer, const size_t length,
982 struct isds_message **message, const isds_buffer_strategy strategy)
983 _deprecated;
985 /* Download incoming message identified by ID.
986 * @context is session context
987 * @message_id is message identifier (you can get them from
988 * isds_get_list_of_received_messages())
989 * @message is automatically reallocated message retrieved from ISDS */
990 isds_error isds_get_received_message(struct isds_ctx *context,
991 const char *message_id, struct isds_message **message);
993 /* Deprecated: Use isds_load_message() instead. */
994 /* Load signed message from buffer.
995 * @context is session context
996 * @outgoing is true if message is outgoing, false if message is incoming
997 * @buffer is DER encoded PKCS#7 structure with signed message. You can
998 * retrieve such data from message->raw after calling
999 * isds_get_signed{received,sent}_message().
1000 * @length is length of buffer in bytes.
1001 * @message is automatically reallocated message parsed from @buffer.
1002 * @strategy selects how buffer will be attached into raw isds_message member.
1003 * */
1004 isds_error isds_load_signed_message(struct isds_ctx *context,
1005 const _Bool outgoing, const void *buffer, const size_t length,
1006 struct isds_message **message, const isds_buffer_strategy strategy)
1007 _deprecated;
1009 /* Load message of any type from buffer.
1010 * @context is session context
1011 * @raw_type defines content type of @buffer. Only message types are allowed.
1012 * @buffer is message raw representation. Format (CMS, plain signed,
1013 * message direction) is defined in @raw_type. You can retrieve such data
1014 * from message->raw after calling isds_get_[signed]{received,sent}_message().
1015 * @length is length of buffer in bytes.
1016 * @message is automatically reallocated message parsed from @buffer.
1017 * @strategy selects how buffer will be attached into raw isds_message member.
1018 * */
1019 isds_error isds_load_message(struct isds_ctx *context,
1020 const isds_raw_type raw_type, const void *buffer, const size_t length,
1021 struct isds_message **message, const isds_buffer_strategy strategy);
1023 /* Download signed incoming message identified by ID.
1024 * @context is session context
1025 * @message_id is message identifier (you can get them from
1026 * isds_get_list_of_received_messages())
1027 * @message is automatically reallocated message retrieved from ISDS. The raw
1028 * memeber will be filled with PKCS#7 structure in DER format. */
1029 isds_error isds_get_signed_received_message(struct isds_ctx *context,
1030 const char *message_id, struct isds_message **message);
1032 /* Download signed outgoing message identified by ID.
1033 * @context is session context
1034 * @message_id is message identifier (you can get them from
1035 * isds_get_list_of_sent_messages())
1036 * @message is automatically reallocated message retrieved from ISDS. The raw
1037 * memeber will be filled with PKCS#7 structure in DER format. */
1038 isds_error isds_get_signed_sent_message(struct isds_ctx *context,
1039 const char *message_id, struct isds_message **message);
1041 /* Retrieve hash of message identified by ID stored in ISDS.
1042 * @context is session context
1043 * @message_id is message identifier
1044 * @hash is automatically reallocated message hash downloaded from ISDS.
1045 * Message must exist in system and must not be deleted. */
1046 isds_error isds_download_message_hash(struct isds_ctx *context,
1047 const char *message_id, struct isds_hash **hash);
1049 /* Compute hash of message from raw representation and store it into envelope.
1050 * Original hash structure will be destroyed in envelope.
1051 * @context is session context
1052 * @message is message carrying raw XML message blob
1053 * @algorithm is desired hash algorithm to use */
1054 isds_error isds_compute_message_hash(struct isds_ctx *context,
1055 struct isds_message *message, const isds_hash_algorithm algorithm);
1057 /* Compare two hashes.
1058 * @h1 is first hash
1059 * @h2 is another hash
1060 * @return
1061 * IE_SUCCESS if hashes equal
1062 * IE_NOTUNIQ if hashes are comparable, but they don't equal
1063 * IE_ENUM if not comparable, but both structures defined
1064 * IE_INVAL if some of the structures are undefined (NULL)
1065 * IE_ERROR if internal error occurs */
1066 isds_error isds_hash_cmp(const struct isds_hash *h1,
1067 const struct isds_hash *h2);
1069 /* Check message has gone through ISDS by comparing message hash stored in
1070 * ISDS and locally computed hash. You must provide message with valid raw
1071 * member (do not use isds_load_message(..., BUFFER_DONT_STORE)).
1072 * This is convenient wrapper for isds_download_message_hash(),
1073 * isds_compute_message_hash(), and isds_hash_cmp() sequence.
1074 * @context is session context
1075 * @message is message with valid raw and envelope member; envelope->hash
1076 * member will be changed during funcion run. Use envelope on heap only.
1077 * @return
1078 * IE_SUCCESS if message originates in ISDS
1079 * IE_NOTEQUAL if message is unknown to ISDS
1080 * other code for other errors */
1081 isds_error isds_verify_message_hash(struct isds_ctx *context,
1082 struct isds_message *message);
1084 /* Mark message as read. This is a transactional commit function to acknoledge
1085 * to ISDS the message has been downloaded and processed by client properly.
1086 * @context is session context
1087 * @message_id is message identifier. */
1088 isds_error isds_mark_message_read(struct isds_ctx *context,
1089 const char *message_id);
1091 /* Mark message as received by recipient. This is applicable only to
1092 * commercial message. There is no specified way how to distinguishe
1093 * commercial message from government message yet. Government message is
1094 * received automatically (by law), commenrcial message on recipient request.
1095 * @context is session context
1096 * @message_id is message identifier. */
1097 isds_error isds_mark_message_received(struct isds_ctx *context,
1098 const char *message_id);
1100 /* Send bogus request to ISDS.
1101 * Just for test purposes */
1102 isds_error isds_bogus_request(struct isds_ctx *context);
1104 /* Send document for authorize conversion into Czech POINT system.
1105 * This is public anonymous service, no login necessary. Special context is
1106 * used to reuse keep-a-live HTTPS connection.
1107 * @context is Czech POINT session context. DO NOT use context connected to
1108 * ISDS server. Use new context or context used by this function previously.
1109 * @document is document to convert. Only data, data_length and dmFileDescr
1110 * memebers are signifact. Be ware that not all document formats can be
1111 * converted (signed PDF 1.3 and higher only (2010-02 state)).
1112 * @id is reallocated identifier assigned by Czech POINT system to
1113 * your document on submit. Use is to tell it to Czech POINT officer.
1114 * @date is reallocated document submit date (submitted documents
1115 * expires after some period). Only tm_year, tm_mon and tm_mday carry sane
1116 * value. */
1117 isds_error czp_convert_document(struct isds_ctx *context,
1118 const struct isds_document *document,
1119 char **id, struct tm **date);
1121 /* Close possibly opened connection to Czech POINT document deposit.
1122 * @context is Czech POINT session context. */
1123 isds_error czp_close_connection(struct isds_ctx *context);
1125 /* Search for document by document ID in list of documents. IDs are compared
1126 * as UTF-8 string.
1127 * @documents is list of isds_documents
1128 * @id is document identifier
1129 * @return first matching document or NULL. */
1130 const struct isds_document *isds_find_document_by_id(
1131 const struct isds_list *documents, const char *id);
1133 /* Free isds_list with all member data.
1134 * @list list to free, on return will be NULL */
1135 void isds_list_free(struct isds_list **list);
1137 /* Deallocate structure isds_hash and NULL it.
1138 * @hash hash to to free */
1139 void isds_hash_free(struct isds_hash **hash);
1141 /* Deallocate structure isds_DbOwnerInfo recursively and NULL it */
1142 void isds_DbOwnerInfo_free(struct isds_DbOwnerInfo **db_owner_info);
1144 /* Deallocate structure isds_DbUserInfo recursively and NULL it */
1145 void isds_DbUserInfo_free(struct isds_DbUserInfo **db_user_info);
1147 /* Deallocate struct isds_event recursively and NULL it */
1148 void isds_event_free(struct isds_event **event);
1150 /* Deallocate struct isds_envelope recursively and NULL it */
1151 void isds_envelope_free(struct isds_envelope **envelope);
1153 /* Deallocate struct isds_document recursively and NULL it */
1154 void isds_document_free(struct isds_document **document);
1156 /* Deallocate struct isds_message recursively and NULL it */
1157 void isds_message_free(struct isds_message **message);
1159 /* Deallocate struct isds_message_copy recursively and NULL it */
1160 void isds_message_copy_free(struct isds_message_copy **copy);
1162 /* Deallocate struct isds_approval recursively and NULL it */
1163 void isds_approval_free(struct isds_approval **approval);
1165 /* Copy structure isds_PersonName recursively */
1166 struct isds_PersonName *isds_PersonName_duplicate(
1167 const struct isds_PersonName *template);
1169 /* Copy structure isds_Address recursively */
1170 struct isds_Address *isds_Address_duplicate(
1171 const struct isds_Address *template);
1173 /* Copy structure isds_DbOwnerInfo recursively */
1174 struct isds_DbOwnerInfo *isds_DbOwnerInfo_duplicate(
1175 const struct isds_DbOwnerInfo *template);
1177 /* Copy structure isds_DbUserInfo recursively */
1178 struct isds_DbUserInfo *isds_DbUserInfo_duplicate(
1179 const struct isds_DbUserInfo *template);
1181 #ifdef __cplusplus /* For C++ linker sake */
1183 #endif
1185 #endif