refactored openac and its attribute certificate factory
[strongswan.git] / src / libstrongswan / plugins / x509 / ietf_attr_list.h
1 /**
2 * @file ietf_attr_list.h
3 *
4 * @brief Handling of ietfAttr_t linked lists
5 *
6 */
7
8 /*
9 * Copyright (C) 2007 Andreas Steffen
10 *
11 * Hochschule fuer Technik Rapperswil
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 */
23
24 #ifndef IETF_ATTR_LIST_H_
25 #define IETF_ATTR_LIST_H_
26
27 #include <library.h>
28 #include <utils/linked_list.h>
29
30
31 /**
32 * @brief Compare two linked lists of ietfAttr_t objects for equality
33 *
34 * @param list_a first alphabetically-sorted list
35 * @param list_b second alphabetically-sorted list
36 * @return TRUE if equal
37 *
38 * @ingroup crypto
39 */
40 bool ietfAttr_list_equals(linked_list_t *list_a, linked_list_t *list_b);
41
42 /**
43 * @brief Lists a linked list of ietfAttr_t objects
44 *
45 * @param list alphabetically-sorted linked list of attributes
46 @param out output file
47 *
48 * @ingroup crypto
49 */
50 void ietfAttr_list_list(linked_list_t *list, FILE *out);
51
52 /**
53 * @brief Create a linked list of ietfAttr_t objects from a string
54 *
55 * @param msg string with comma-separated group names
56 * @param list alphabetically-sorted linked list of attributes
57 *
58 * @ingroup crypto
59 */
60 void ietfAttr_list_create_from_string(char *msg, linked_list_t *list);
61
62 /**
63 * @brief Create a linked list of ietfAttr_t objects from an ASN.1-coded chunk
64 *
65 * @param chunk chunk containing ASN.1-coded attributes
66 * @param list alphabetically-sorted linked list of attributes
67 * @param level0 parsing level
68 */
69 void ietfAttr_list_create_from_chunk(chunk_t chunk, linked_list_t *list, int level0);
70
71 /**
72 * @brief Encode a linked list of ietfAttr_t objects into an ASN.1-coded chunk
73 *
74 * @param list alphabetically-sorted linked list of attributes
75 * @return chunk containing ASN.1-coded attributes
76 */
77 chunk_t ietfAttr_list_encode(linked_list_t *list);
78
79 /**
80 * @brief Destroys a linked list of ietfAttr_t objects
81 *
82 * @param list list to be destroyed
83 *
84 * @ingroup crypto
85 */
86 void ietfAttr_list_destroy(linked_list_t *list);
87
88 #endif /* IETF_ATTR_LIST_H_ */
89