diff options
Diffstat (limited to 'src/include/gnunet_credential_service.h')
-rw-r--r-- | src/include/gnunet_credential_service.h | 84 |
1 files changed, 38 insertions, 46 deletions
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h index c925b0da8..9e1672ba3 100644 --- a/src/include/gnunet_credential_service.h +++ b/src/include/gnunet_credential_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -56,10 +56,9 @@ struct GNUNET_CREDENTIAL_Handle; | |||
56 | struct GNUNET_CREDENTIAL_Request; | 56 | struct GNUNET_CREDENTIAL_Request; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject | 59 | * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject |
60 | */ | 60 | */ |
61 | enum GNUNET_CREDENTIAL_CredentialFlags { | 61 | enum GNUNET_CREDENTIAL_CredentialFlags { |
62 | |||
63 | //Subject had credentials before, but have been revoked now | 62 | //Subject had credentials before, but have been revoked now |
64 | GNUNET_CREDENTIAL_FLAG_REVOKED=0, | 63 | GNUNET_CREDENTIAL_FLAG_REVOKED=0, |
65 | 64 | ||
@@ -68,7 +67,6 @@ enum GNUNET_CREDENTIAL_CredentialFlags { | |||
68 | 67 | ||
69 | //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance | 68 | //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance |
70 | GNUNET_CREDENTIAL_FLAG_ISSUER=2 | 69 | GNUNET_CREDENTIAL_FLAG_ISSUER=2 |
71 | |||
72 | }; | 70 | }; |
73 | 71 | ||
74 | GNUNET_NETWORK_STRUCT_BEGIN | 72 | GNUNET_NETWORK_STRUCT_BEGIN |
@@ -76,7 +74,6 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
76 | * The attribute delegation record | 74 | * The attribute delegation record |
77 | */ | 75 | */ |
78 | struct GNUNET_CREDENTIAL_DelegationRecord { | 76 | struct GNUNET_CREDENTIAL_DelegationRecord { |
79 | |||
80 | /** | 77 | /** |
81 | * Number of delegation sets in this record | 78 | * Number of delegation sets in this record |
82 | */ | 79 | */ |
@@ -96,7 +93,6 @@ struct GNUNET_CREDENTIAL_DelegationRecord { | |||
96 | * The attribute delegation record | 93 | * The attribute delegation record |
97 | */ | 94 | */ |
98 | struct GNUNET_CREDENTIAL_DelegationRecordSet { | 95 | struct GNUNET_CREDENTIAL_DelegationRecordSet { |
99 | |||
100 | /** | 96 | /** |
101 | * Public key of the subject this attribute was delegated to | 97 | * Public key of the subject this attribute was delegated to |
102 | */ | 98 | */ |
@@ -115,7 +111,6 @@ GNUNET_NETWORK_STRUCT_END | |||
115 | * The attribute delegation record | 111 | * The attribute delegation record |
116 | */ | 112 | */ |
117 | struct GNUNET_CREDENTIAL_DelegationSet { | 113 | struct GNUNET_CREDENTIAL_DelegationSet { |
118 | |||
119 | /** | 114 | /** |
120 | * Public key of the subject this attribute was delegated to | 115 | * Public key of the subject this attribute was delegated to |
121 | */ | 116 | */ |
@@ -134,7 +129,6 @@ struct GNUNET_CREDENTIAL_DelegationSet { | |||
134 | * A delegation | 129 | * A delegation |
135 | */ | 130 | */ |
136 | struct GNUNET_CREDENTIAL_Delegation { | 131 | struct GNUNET_CREDENTIAL_Delegation { |
137 | |||
138 | /** | 132 | /** |
139 | * The issuer of the delegation | 133 | * The issuer of the delegation |
140 | */ | 134 | */ |
@@ -171,7 +165,6 @@ struct GNUNET_CREDENTIAL_Delegation { | |||
171 | * A credential | 165 | * A credential |
172 | */ | 166 | */ |
173 | struct GNUNET_CREDENTIAL_Credential { | 167 | struct GNUNET_CREDENTIAL_Credential { |
174 | |||
175 | /** | 168 | /** |
176 | * The issuer of the credential | 169 | * The issuer of the credential |
177 | */ | 170 | */ |
@@ -201,7 +194,6 @@ struct GNUNET_CREDENTIAL_Credential { | |||
201 | * The attribute | 194 | * The attribute |
202 | */ | 195 | */ |
203 | const char *issuer_attribute; | 196 | const char *issuer_attribute; |
204 | |||
205 | }; | 197 | }; |
206 | 198 | ||
207 | 199 | ||
@@ -213,7 +205,7 @@ struct GNUNET_CREDENTIAL_Credential { | |||
213 | * @return handle to the Credential service, or NULL on error | 205 | * @return handle to the Credential service, or NULL on error |
214 | */ | 206 | */ |
215 | struct GNUNET_CREDENTIAL_Handle * | 207 | struct GNUNET_CREDENTIAL_Handle * |
216 | GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 208 | GNUNET_CREDENTIAL_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); |
217 | 209 | ||
218 | 210 | ||
219 | /** | 211 | /** |
@@ -222,7 +214,7 @@ GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
222 | * @param handle connection to shut down | 214 | * @param handle connection to shut down |
223 | */ | 215 | */ |
224 | void | 216 | void |
225 | GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle); | 217 | GNUNET_CREDENTIAL_disconnect(struct GNUNET_CREDENTIAL_Handle *handle); |
226 | 218 | ||
227 | 219 | ||
228 | /** | 220 | /** |
@@ -235,10 +227,10 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle); | |||
235 | * @param credential the credentials | 227 | * @param credential the credentials |
236 | */ | 228 | */ |
237 | typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, | 229 | typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, |
238 | unsigned int d_count, | 230 | unsigned int d_count, |
239 | struct GNUNET_CREDENTIAL_Delegation *delegation_chain, | 231 | struct GNUNET_CREDENTIAL_Delegation *delegation_chain, |
240 | unsigned int c_count, | 232 | unsigned int c_count, |
241 | struct GNUNET_CREDENTIAL_Credential *credential); | 233 | struct GNUNET_CREDENTIAL_Credential *credential); |
242 | 234 | ||
243 | /** | 235 | /** |
244 | * Iterator called on obtained result for an attribute delegation. | 236 | * Iterator called on obtained result for an attribute delegation. |
@@ -280,23 +272,23 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, | |||
280 | * @return handle to the queued request | 272 | * @return handle to the queued request |
281 | */ | 273 | */ |
282 | struct GNUNET_CREDENTIAL_Request* | 274 | struct GNUNET_CREDENTIAL_Request* |
283 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | 275 | GNUNET_CREDENTIAL_verify(struct GNUNET_CREDENTIAL_Handle *handle, |
276 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
277 | const char *issuer_attribute, | ||
278 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | ||
279 | uint32_t credential_count, | ||
280 | const struct GNUNET_CREDENTIAL_Credential *credentials, | ||
281 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | ||
282 | void *proc_cls); | ||
283 | |||
284 | struct GNUNET_CREDENTIAL_Request* | ||
285 | GNUNET_CREDENTIAL_collect(struct GNUNET_CREDENTIAL_Handle *handle, | ||
284 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | 286 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, |
285 | const char *issuer_attribute, | 287 | const char *issuer_attribute, |
286 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | 288 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, |
287 | uint32_t credential_count, | ||
288 | const struct GNUNET_CREDENTIAL_Credential *credentials, | ||
289 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | 289 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, |
290 | void *proc_cls); | 290 | void *proc_cls); |
291 | 291 | ||
292 | struct GNUNET_CREDENTIAL_Request* | ||
293 | GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | ||
294 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
295 | const char *issuer_attribute, | ||
296 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, | ||
297 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | ||
298 | void *proc_cls); | ||
299 | |||
300 | /** | 292 | /** |
301 | * Delegate an attribute | 293 | * Delegate an attribute |
302 | * | 294 | * |
@@ -310,13 +302,13 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | |||
310 | * @return handle to the queued request | 302 | * @return handle to the queued request |
311 | */ | 303 | */ |
312 | struct GNUNET_CREDENTIAL_Request * | 304 | struct GNUNET_CREDENTIAL_Request * |
313 | GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | 305 | GNUNET_CREDENTIAL_add_delegation(struct GNUNET_CREDENTIAL_Handle *handle, |
314 | struct GNUNET_IDENTITY_Ego *issuer, | 306 | struct GNUNET_IDENTITY_Ego *issuer, |
315 | const char *attribute, | 307 | const char *attribute, |
316 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | 308 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, |
317 | const char *delegated_attribute, | 309 | const char *delegated_attribute, |
318 | GNUNET_CREDENTIAL_DelegateResultProcessor proc, | 310 | GNUNET_CREDENTIAL_DelegateResultProcessor proc, |
319 | void *proc_cls); | 311 | void *proc_cls); |
320 | 312 | ||
321 | /** | 313 | /** |
322 | * Remove a delegation | 314 | * Remove a delegation |
@@ -329,11 +321,11 @@ GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
329 | * @return handle to the queued request | 321 | * @return handle to the queued request |
330 | */ | 322 | */ |
331 | struct GNUNET_CREDENTIAL_Request * | 323 | struct GNUNET_CREDENTIAL_Request * |
332 | GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | 324 | GNUNET_CREDENTIAL_remove_delegation(struct GNUNET_CREDENTIAL_Handle *handle, |
333 | struct GNUNET_IDENTITY_Ego *issuer, | 325 | struct GNUNET_IDENTITY_Ego *issuer, |
334 | const char *attribute, | 326 | const char *attribute, |
335 | GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, | 327 | GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, |
336 | void *proc_cls); | 328 | void *proc_cls); |
337 | 329 | ||
338 | 330 | ||
339 | 331 | ||
@@ -347,10 +339,10 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
347 | * @return handle to the queued request | 339 | * @return handle to the queued request |
348 | */ | 340 | */ |
349 | struct GNUNET_CREDENTIAL_Credential* | 341 | struct GNUNET_CREDENTIAL_Credential* |
350 | GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | 342 | GNUNET_CREDENTIAL_credential_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, |
351 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | 343 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, |
352 | const char *attribute, | 344 | const char *attribute, |
353 | struct GNUNET_TIME_Absolute *expiration); | 345 | struct GNUNET_TIME_Absolute *expiration); |
354 | 346 | ||
355 | 347 | ||
356 | 348 | ||
@@ -360,7 +352,7 @@ GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey * | |||
360 | * @param lr the lookup request to cancel | 352 | * @param lr the lookup request to cancel |
361 | */ | 353 | */ |
362 | void | 354 | void |
363 | GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr); | 355 | GNUNET_CREDENTIAL_request_cancel(struct GNUNET_CREDENTIAL_Request *lr); |
364 | 356 | ||
365 | 357 | ||
366 | #if 0 /* keep Emacsens' auto-indent happy */ | 358 | #if 0 /* keep Emacsens' auto-indent happy */ |