aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_identity_provider_service.h
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2017-12-02 22:32:28 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2017-12-02 22:32:28 +0100
commita9a7ac802811e76e33b54040bf31f00ea9438cea (patch)
tree7f9a22daca2b95e7308d8877c668fc878a39ae4c /src/include/gnunet_identity_provider_service.h
parent14c62ed969ace8843154d10b55d4c3571383dc37 (diff)
downloadgnunet-a9a7ac802811e76e33b54040bf31f00ea9438cea.tar.gz
gnunet-a9a7ac802811e76e33b54040bf31f00ea9438cea.zip
-refactored
Diffstat (limited to 'src/include/gnunet_identity_provider_service.h')
-rw-r--r--src/include/gnunet_identity_provider_service.h109
1 files changed, 4 insertions, 105 deletions
diff --git a/src/include/gnunet_identity_provider_service.h b/src/include/gnunet_identity_provider_service.h
index d17a1cc9c..6bc05d0f4 100644
--- a/src/include/gnunet_identity_provider_service.h
+++ b/src/include/gnunet_identity_provider_service.h
@@ -39,7 +39,7 @@ extern "C"
39#endif 39#endif
40 40
41#include "gnunet_util_lib.h" 41#include "gnunet_util_lib.h"
42 42#include "gnunet_identity_attribute_lib.h"
43 43
44/** 44/**
45 * Version number of GNUnet Identity Provider API. 45 * Version number of GNUnet Identity Provider API.
@@ -82,92 +82,6 @@ struct GNUNET_IDENTITY_PROVIDER_Ticket
82 */ 82 */
83struct GNUNET_IDENTITY_PROVIDER_Operation; 83struct GNUNET_IDENTITY_PROVIDER_Operation;
84 84
85/**
86 * Flags that can be set for an attribute.
87 */
88enum GNUNET_IDENTITY_PROVIDER_AttributeType
89{
90
91 /**
92 * No value attribute.
93 */
94 GNUNET_IDENTITY_PROVIDER_AT_NULL = 0,
95
96 /**
97 * String attribute.
98 */
99 GNUNET_IDENTITY_PROVIDER_AT_STRING = 1,
100
101};
102
103
104
105/**
106 * An attribute.
107 */
108struct GNUNET_IDENTITY_PROVIDER_Attribute
109{
110
111 /**
112 * Type of Attribute.
113 */
114 uint32_t attribute_type;
115
116 /**
117 * Attribute version
118 */
119 uint32_t attribute_version;
120
121 /**
122 * Number of bytes in @e data.
123 */
124 size_t data_size;
125
126 /**
127 * The name of the attribute. Note "name" must never be individually
128 * free'd
129 */
130 const char* name;
131
132 /**
133 * Binary value stored as attribute value. Note: "data" must never
134 * be individually 'malloc'ed, but instead always points into some
135 * existing data area.
136 */
137 const void *data;
138
139};
140
141struct GNUNET_IDENTITY_PROVIDER_AttributeList
142{
143 /**
144 * List head
145 */
146 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *list_head;
147
148 /**
149 * List tail
150 */
151 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *list_tail;
152};
153
154struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry
155{
156 /**
157 * DLL
158 */
159 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *prev;
160
161 /**
162 * DLL
163 */
164 struct GNUNET_IDENTITY_PROVIDER_AttributeListEntry *next;
165
166 /**
167 * The attribute
168 */
169 struct GNUNET_IDENTITY_PROVIDER_Attribute *attribute;
170};
171 85
172/** 86/**
173 * Connect to the identity provider service. 87 * Connect to the identity provider service.
@@ -208,27 +122,12 @@ typedef void
208struct GNUNET_IDENTITY_PROVIDER_Operation * 122struct GNUNET_IDENTITY_PROVIDER_Operation *
209GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle *h, 123GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
210 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 124 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
211 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr, 125 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr,
212 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cont, 126 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cont,
213 void *cont_cls); 127 void *cont_cls);
214 128
215 129
216/** 130/**
217 * Create a new attribute.
218 *
219 * @param name the attribute name
220 * @param type the attribute type
221 * @param data the attribute value
222 * @param data_size the attribute value size
223 * @return the new attribute
224 */
225struct GNUNET_IDENTITY_PROVIDER_Attribute *
226GNUNET_IDENTITY_PROVIDER_attribute_new (const char* attr_name,
227 uint32_t attr_type,
228 const void* data,
229 size_t data_size);
230
231/**
232 * Process an attribute that was stored in the idp. 131 * Process an attribute that was stored in the idp.
233 * 132 *
234 * @param cls closure 133 * @param cls closure
@@ -237,7 +136,7 @@ GNUNET_IDENTITY_PROVIDER_attribute_new (const char* attr_name,
237typedef void 136typedef void
238(*GNUNET_IDENTITY_PROVIDER_AttributeResult) (void *cls, 137(*GNUNET_IDENTITY_PROVIDER_AttributeResult) (void *cls,
239 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 138 const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
240 const struct GNUNET_IDENTITY_PROVIDER_Attribute *attr); 139 const struct GNUNET_IDENTITY_ATTRIBUTE_Claim *attr);
241 140
242 141
243 142
@@ -327,7 +226,7 @@ struct GNUNET_IDENTITY_PROVIDER_Operation *
327GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *id, 226GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *id,
328 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 227 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
329 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 228 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
330 const struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs, 229 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
331 GNUNET_IDENTITY_PROVIDER_TicketCallback cb, 230 GNUNET_IDENTITY_PROVIDER_TicketCallback cb,
332 void *cb_cls); 231 void *cb_cls);
333 232