diff options
author | Andreas Ebner <pansy007@googlemail.com> | 2019-07-07 15:04:40 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:15:06 +0200 |
commit | fc58d9d4241ed2dcd4b492b4f922ba959449a697 (patch) | |
tree | 812713718d2d93d70a3ee1a22b20d55e65969873 /src/include | |
parent | d2634b1f96dfd55ae4daef294bb6c05d687354c8 (diff) | |
download | gnunet-fc58d9d4241ed2dcd4b492b4f922ba959449a697.tar.gz gnunet-fc58d9d4241ed2dcd4b492b4f922ba959449a697.zip |
Implemented delegate sign and store function for GNS entries:
- functions to store and sign delegates (all types) including serialization/string_to_value/..
- solved (almost) all TODOs
- some renaming and cleanup in gnunet-credential.c
- valgrind checked
- test file adapted accordingly
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_credential_service.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h index 05cdb7c9f..7b179e99f 100644 --- a/src/include/gnunet_credential_service.h +++ b/src/include/gnunet_credential_service.h | |||
@@ -202,6 +202,53 @@ struct GNUNET_CREDENTIAL_Credential | |||
202 | const char *issuer_attribute; | 202 | const char *issuer_attribute; |
203 | }; | 203 | }; |
204 | 204 | ||
205 | /** | ||
206 | * A delegate | ||
207 | */ | ||
208 | struct GNUNET_CREDENTIAL_Delegate { | ||
209 | |||
210 | /** | ||
211 | * The issuer of the credential | ||
212 | */ | ||
213 | struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key; | ||
214 | |||
215 | /** | ||
216 | * Public key of the subject this credential was issued to | ||
217 | */ | ||
218 | struct GNUNET_CRYPTO_EcdsaPublicKey subject_key; | ||
219 | |||
220 | /** | ||
221 | * Signature of this credential | ||
222 | */ | ||
223 | struct GNUNET_CRYPTO_EcdsaSignature signature; | ||
224 | |||
225 | /** | ||
226 | * Expiration of this credential | ||
227 | */ | ||
228 | struct GNUNET_TIME_Absolute expiration; | ||
229 | |||
230 | /** | ||
231 | * Length of the issuer attribute | ||
232 | */ | ||
233 | uint32_t issuer_attribute_len; | ||
234 | |||
235 | /** | ||
236 | * The issuer attribute | ||
237 | */ | ||
238 | const char *issuer_attribute; | ||
239 | |||
240 | /** | ||
241 | * Length of the subject attribute | ||
242 | */ | ||
243 | uint32_t subject_attribute_len; | ||
244 | |||
245 | /** | ||
246 | * The subject attribute | ||
247 | */ | ||
248 | const char *subject_attribute; | ||
249 | |||
250 | }; | ||
251 | |||
205 | 252 | ||
206 | 253 | ||
207 | /** | 254 | /** |
@@ -363,6 +410,21 @@ GNUNET_CREDENTIAL_credential_issue (const struct | |||
363 | const char *attribute, | 410 | const char *attribute, |
364 | struct GNUNET_TIME_Absolute *expiration); | 411 | struct GNUNET_TIME_Absolute *expiration); |
365 | 412 | ||
413 | /** | ||
414 | * Issue an attribute to a subject | ||
415 | * | ||
416 | * @param issuer the ego that should be used to issue the attribute | ||
417 | * @param subject the subject of the attribute | ||
418 | * @param attribute the name of the attribute | ||
419 | * @param expiration the TTL of the credential | ||
420 | * @return handle to the queued request | ||
421 | */ | ||
422 | struct GNUNET_CREDENTIAL_Delegate* | ||
423 | GNUNET_CREDENTIAL_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | ||
424 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | ||
425 | const char *iss_attr, | ||
426 | const char *sub_attr, | ||
427 | struct GNUNET_TIME_Absolute *expiration); | ||
366 | 428 | ||
367 | 429 | ||
368 | /** | 430 | /** |