summaryrefslogtreecommitdiff
path: root/src/include/gnunet_credential_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_credential_service.h')
-rw-r--r--src/include/gnunet_credential_service.h67
1 files changed, 14 insertions, 53 deletions
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h
index b64bb350c..be682c3b5 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -168,43 +168,6 @@ struct GNUNET_CREDENTIAL_Delegation {
168 168
169 169
170/** 170/**
171 * A credential
172 */
173struct GNUNET_CREDENTIAL_Credential {
174
175 /**
176 * The issuer of the credential
177 */
178 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
179
180 /**
181 * Public key of the subject this credential was issued to
182 */
183 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
184
185 /**
186 * Signature of this credential
187 */
188 struct GNUNET_CRYPTO_EcdsaSignature signature;
189
190 /**
191 * Expiration of this credential
192 */
193 struct GNUNET_TIME_Absolute expiration;
194
195 /**
196 * Length of the attribute
197 */
198 uint32_t issuer_attribute_len;
199
200 /**
201 * The attribute
202 */
203 const char *issuer_attribute;
204
205};
206
207/**
208 * A delegate 171 * A delegate
209 */ 172 */
210struct GNUNET_CREDENTIAL_Delegate { 173struct GNUNET_CREDENTIAL_Delegate {
@@ -251,7 +214,18 @@ struct GNUNET_CREDENTIAL_Delegate {
251 214
252}; 215};
253 216
217/*
218* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
219*/
220enum GNUNET_CREDENTIAL_AlgoDirectionFlags {
254 221
222 //Subject had credentials before, but have been revoked now
223 GNUNET_CREDENTIAL_FLAG_FORWARD=1 << 0,
224
225 //Subject flag indicates that the subject is a holder of this credential and may present it as such
226 GNUNET_CREDENTIAL_FLAG_BACKWARD=1 << 1
227
228};
255 229
256/** 230/**
257 * Initialize the connection with the Credential service. 231 * Initialize the connection with the Credential service.
@@ -332,7 +306,8 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
332 const char *issuer_attribute, 306 const char *issuer_attribute,
333 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, 307 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
334 uint32_t credential_count, 308 uint32_t credential_count,
335 const struct GNUNET_CREDENTIAL_Delegate *credentials, 309 const struct GNUNET_CREDENTIAL_Delegate *delegates,
310 enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction,
336 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 311 GNUNET_CREDENTIAL_CredentialResultProcessor proc,
337 void *proc_cls); 312 void *proc_cls);
338 313
@@ -341,6 +316,7 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
341 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 316 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
342 const char *issuer_attribute, 317 const char *issuer_attribute,
343 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, 318 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
319 enum GNUNET_CREDENTIAL_AlgoDirectionFlags direction,
344 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 320 GNUNET_CREDENTIAL_CredentialResultProcessor proc,
345 void *proc_cls); 321 void *proc_cls);
346 322
@@ -393,21 +369,6 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
393 * @param expiration the TTL of the credential 369 * @param expiration the TTL of the credential
394 * @return handle to the queued request 370 * @return handle to the queued request
395 */ 371 */
396struct GNUNET_CREDENTIAL_Credential*
397GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
398 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
399 const char *attribute,
400 struct GNUNET_TIME_Absolute *expiration);
401
402/**
403 * Issue an attribute to a subject
404 *
405 * @param issuer the ego that should be used to issue the attribute
406 * @param subject the subject of the attribute
407 * @param attribute the name of the attribute
408 * @param expiration the TTL of the credential
409 * @return handle to the queued request
410 */
411struct GNUNET_CREDENTIAL_Delegate* 372struct GNUNET_CREDENTIAL_Delegate*
412GNUNET_CREDENTIAL_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, 373GNUNET_CREDENTIAL_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
413 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 374 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,