diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_credential_service.h | 73 |
1 files changed, 31 insertions, 42 deletions
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h index 7b179e99f..b64bb350c 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,26 +56,27 @@ 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 | { | 62 | |
63 | // Subject had credentials before, but have been revoked now | 63 | //Subject had credentials before, but have been revoked now |
64 | GNUNET_CREDENTIAL_FLAG_REVOKED=0, | 64 | GNUNET_CREDENTIAL_FLAG_REVOKED=0, |
65 | 65 | ||
66 | // Subject flag indicates that the subject is a holder of this credential and may present it as such | 66 | //Subject flag indicates that the subject is a holder of this credential and may present it as such |
67 | GNUNET_CREDENTIAL_FLAG_SUBJECT=1, | 67 | GNUNET_CREDENTIAL_FLAG_SUBJECT=1, |
68 | 68 | ||
69 | // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance | 69 | //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance |
70 | GNUNET_CREDENTIAL_FLAG_ISSUER=2 | 70 | GNUNET_CREDENTIAL_FLAG_ISSUER=2 |
71 | |||
71 | }; | 72 | }; |
72 | 73 | ||
73 | GNUNET_NETWORK_STRUCT_BEGIN | 74 | GNUNET_NETWORK_STRUCT_BEGIN |
74 | /** | 75 | /** |
75 | * The attribute delegation record | 76 | * The attribute delegation record |
76 | */ | 77 | */ |
77 | struct GNUNET_CREDENTIAL_DelegationRecord | 78 | struct GNUNET_CREDENTIAL_DelegationRecord { |
78 | { | 79 | |
79 | /** | 80 | /** |
80 | * Number of delegation sets in this record | 81 | * Number of delegation sets in this record |
81 | */ | 82 | */ |
@@ -94,8 +95,8 @@ struct GNUNET_CREDENTIAL_DelegationRecord | |||
94 | /** | 95 | /** |
95 | * The attribute delegation record | 96 | * The attribute delegation record |
96 | */ | 97 | */ |
97 | struct GNUNET_CREDENTIAL_DelegationRecordSet | 98 | struct GNUNET_CREDENTIAL_DelegationRecordSet { |
98 | { | 99 | |
99 | /** | 100 | /** |
100 | * Public key of the subject this attribute was delegated to | 101 | * Public key of the subject this attribute was delegated to |
101 | */ | 102 | */ |
@@ -113,8 +114,8 @@ GNUNET_NETWORK_STRUCT_END | |||
113 | /** | 114 | /** |
114 | * The attribute delegation record | 115 | * The attribute delegation record |
115 | */ | 116 | */ |
116 | struct GNUNET_CREDENTIAL_DelegationSet | 117 | struct GNUNET_CREDENTIAL_DelegationSet { |
117 | { | 118 | |
118 | /** | 119 | /** |
119 | * Public key of the subject this attribute was delegated to | 120 | * Public key of the subject this attribute was delegated to |
120 | */ | 121 | */ |
@@ -132,8 +133,8 @@ struct GNUNET_CREDENTIAL_DelegationSet | |||
132 | /** | 133 | /** |
133 | * A delegation | 134 | * A delegation |
134 | */ | 135 | */ |
135 | struct GNUNET_CREDENTIAL_Delegation | 136 | struct GNUNET_CREDENTIAL_Delegation { |
136 | { | 137 | |
137 | /** | 138 | /** |
138 | * The issuer of the delegation | 139 | * The issuer of the delegation |
139 | */ | 140 | */ |
@@ -169,8 +170,8 @@ struct GNUNET_CREDENTIAL_Delegation | |||
169 | /** | 170 | /** |
170 | * A credential | 171 | * A credential |
171 | */ | 172 | */ |
172 | struct GNUNET_CREDENTIAL_Credential | 173 | struct GNUNET_CREDENTIAL_Credential { |
173 | { | 174 | |
174 | /** | 175 | /** |
175 | * The issuer of the credential | 176 | * The issuer of the credential |
176 | */ | 177 | */ |
@@ -200,6 +201,7 @@ struct GNUNET_CREDENTIAL_Credential | |||
200 | * The attribute | 201 | * The attribute |
201 | */ | 202 | */ |
202 | const char *issuer_attribute; | 203 | const char *issuer_attribute; |
204 | |||
203 | }; | 205 | }; |
204 | 206 | ||
205 | /** | 207 | /** |
@@ -280,16 +282,10 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle); | |||
280 | * @param credential the credentials | 282 | * @param credential the credentials |
281 | */ | 283 | */ |
282 | typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, | 284 | typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, |
283 | unsigned int | 285 | unsigned int d_count, |
284 | d_count, | 286 | struct GNUNET_CREDENTIAL_Delegation *delegation_chain, |
285 | struct | 287 | unsigned int c_count, |
286 | GNUNET_CREDENTIAL_Delegation | 288 | struct GNUNET_CREDENTIAL_Delegate *credential); |
287 | *delegation_chain, | ||
288 | unsigned int | ||
289 | c_count, | ||
290 | struct | ||
291 | GNUNET_CREDENTIAL_Credential | ||
292 | *credential); | ||
293 | 289 | ||
294 | /** | 290 | /** |
295 | * Iterator called on obtained result for an attribute delegation. | 291 | * Iterator called on obtained result for an attribute delegation. |
@@ -309,8 +305,7 @@ typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls, | |||
309 | * @param result the record data that can be handed to the subject | 305 | * @param result the record data that can be handed to the subject |
310 | */ | 306 | */ |
311 | typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, | 307 | typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, |
312 | uint32_t | 308 | uint32_t success); |
313 | success); | ||
314 | 309 | ||
315 | 310 | ||
316 | /** | 311 | /** |
@@ -335,21 +330,17 @@ struct GNUNET_CREDENTIAL_Request* | |||
335 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | 330 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, |
336 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | 331 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, |
337 | const char *issuer_attribute, | 332 | const char *issuer_attribute, |
338 | const struct | 333 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, |
339 | GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | ||
340 | uint32_t credential_count, | 334 | uint32_t credential_count, |
341 | const struct | 335 | const struct GNUNET_CREDENTIAL_Delegate *credentials, |
342 | GNUNET_CREDENTIAL_Credential *credentials, | ||
343 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | 336 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, |
344 | void *proc_cls); | 337 | void *proc_cls); |
345 | 338 | ||
346 | struct GNUNET_CREDENTIAL_Request* | 339 | struct GNUNET_CREDENTIAL_Request* |
347 | GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | 340 | GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, |
348 | const struct | 341 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, |
349 | GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
350 | const char *issuer_attribute, | 342 | const char *issuer_attribute, |
351 | const struct | 343 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, |
352 | GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, | ||
353 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | 344 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, |
354 | void *proc_cls); | 345 | void *proc_cls); |
355 | 346 | ||
@@ -388,8 +379,7 @@ struct GNUNET_CREDENTIAL_Request * | |||
388 | GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | 379 | GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, |
389 | struct GNUNET_IDENTITY_Ego *issuer, | 380 | struct GNUNET_IDENTITY_Ego *issuer, |
390 | const char *attribute, | 381 | const char *attribute, |
391 | GNUNET_CREDENTIAL_RemoveDelegateResultProcessor | 382 | GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, |
392 | proc, | ||
393 | void *proc_cls); | 383 | void *proc_cls); |
394 | 384 | ||
395 | 385 | ||
@@ -404,8 +394,7 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
404 | * @return handle to the queued request | 394 | * @return handle to the queued request |
405 | */ | 395 | */ |
406 | struct GNUNET_CREDENTIAL_Credential* | 396 | struct GNUNET_CREDENTIAL_Credential* |
407 | GNUNET_CREDENTIAL_credential_issue (const struct | 397 | GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, |
408 | GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | ||
409 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | 398 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, |
410 | const char *attribute, | 399 | const char *attribute, |
411 | struct GNUNET_TIME_Absolute *expiration); | 400 | struct GNUNET_TIME_Absolute *expiration); |