GNUnet  0.10.x
gnunet_credential_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2012-2014 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
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/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
32 #ifndef GNUNET_CREDENTIAL_SERVICE_H
33 #define GNUNET_CREDENTIAL_SERVICE_H
34 
35 #include "gnunet_util_lib.h"
36 #include "gnunet_gns_service.h"
38 
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #if 0 /* keep Emacsens' auto-indent happy */
43 }
44 #endif
45 #endif
46 
47 
52 
57 
58 /*
59  * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
60  */
62 {
63  // Subject had credentials before, but have been revoked now
65 
66  // Subject flag indicates that the subject is a holder of this credential and may present it as such
68 
69  // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
71 };
72 
78 {
82  uint32_t set_count;
83 
87  uint64_t data_size;
92 };
93 
98 {
103 
108 };
109 
110 
112 
117 {
122 
124 
128  const char *subject_attribute;
129 };
130 
131 
136 {
141 
146 
151 
155  const char *issuer_attribute;
156 
161 
165  const char *subject_attribute;
166 };
167 
168 
173 {
178 
183 
188 
193 
198 
202  const char *issuer_attribute;
203 };
204 
205 
206 
215 
216 
222 void
224 
225 
236  unsigned int
237  d_count,
238  struct
240  *delegation_chain,
241  unsigned int
242  c_count,
243  struct
245  *credential);
246 
254 typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls,
255  uint32_t success);
256 
265  uint32_t
266  success);
267 
268 
290  const char *issuer_attribute,
291  const struct
293  uint32_t credential_count,
294  const struct
295  GNUNET_CREDENTIAL_Credential *credentials,
297  void *proc_cls);
298 
301  const struct
303  const char *issuer_attribute,
304  const struct
307  void *proc_cls);
308 
323  struct GNUNET_IDENTITY_Ego *issuer,
324  const char *attribute,
325  struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
326  const char *delegated_attribute,
328  void *proc_cls);
329 
342  struct GNUNET_IDENTITY_Ego *issuer,
343  const char *attribute,
345  proc,
346  void *proc_cls);
347 
348 
349 
362  struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
363  const char *attribute,
365 
366 
367 
373 void
375 
376 
377 #if 0 /* keep Emacsens' auto-indent happy */
378 {
379 #endif
380 #ifdef __cplusplus
381 }
382 #endif
383 
384 #endif
385  /* end of group */
uint32_t subject_attribute_len
Length of the attribute.
const char * subject_attribute
The attribute.
const char * issuer_attribute
The attribute.
void(* GNUNET_CREDENTIAL_CredentialResultProcessor)(void *cls, unsigned int d_count, struct GNUNET_CREDENTIAL_Delegation *delegation_chain, unsigned int c_count, struct GNUNET_CREDENTIAL_Credential *credential)
Iterator called on obtained result for an attribute verification.
static char * expiration
Credential TTL.
void GNUNET_CREDENTIAL_request_cancel(struct GNUNET_CREDENTIAL_Request *lr)
Cancel pending lookup request.
static struct GNUNET_CREDENTIAL_Handle * credential
Handle to Credential service.
static struct GNUNET_GNS_LookupWithTldRequest * lr
Handle to lookup request.
Definition: gnunet-gns.c:75
static char * subject_key
Subject pubkey string.
Private ECC key encoded for transmission.
uint32_t set_count
Number of delegation sets in this record.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
void(* GNUNET_CREDENTIAL_RemoveDelegateResultProcessor)(void *cls, uint32_t success)
Iterator called on obtained result for an attribute delegation removal.
void GNUNET_CREDENTIAL_disconnect(struct GNUNET_CREDENTIAL_Handle *handle)
Shutdown connection with the Credentail service.
Handle for an ego.
Definition: identity.h:245
uint32_t subject_attribute_len
Length of attribute, may be 0.
uint32_t issuer_attribute_len
Length of the attribute.
struct GNUNET_CREDENTIAL_Handle * GNUNET_CREDENTIAL_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the Credential service.
an ECC signature using ECDSA
GNUNET_CREDENTIAL_CredentialFlags
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
Connection to the CREDENTIAL service.
const char * subject_attribute
The subject attribute.
struct GNUNET_CREDENTIAL_Request * GNUNET_CREDENTIAL_collect(struct GNUNET_CREDENTIAL_Handle *handle, const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, GNUNET_CREDENTIAL_CredentialResultProcessor proc, void *proc_cls)
Performs attribute collection.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:109
Handle to a verify request.
uint64_t data_size
Length of delegation sets.
struct GNUNET_CREDENTIAL_Request * GNUNET_CREDENTIAL_remove_delegation(struct GNUNET_CREDENTIAL_Handle *handle, struct GNUNET_IDENTITY_Ego *issuer, const char *attribute, GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, void *proc_cls)
Remove a delegation.
static char * issuer_key
Issuer pubkey string.
struct GNUNET_CREDENTIAL_Request * GNUNET_CREDENTIAL_add_delegation(struct GNUNET_CREDENTIAL_Handle *handle, struct GNUNET_IDENTITY_Ego *issuer, const char *attribute, struct GNUNET_CRYPTO_EcdsaPublicKey *subject, const char *delegated_attribute, GNUNET_CREDENTIAL_DelegateResultProcessor proc, void *proc_cls)
Delegate an attribute.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
const char * issuer_attribute
The attribute.
configuration data
Definition: configuration.c:85
The attribute delegation record.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
struct GNUNET_CREDENTIAL_Credential * GNUNET_CREDENTIAL_credential_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, struct GNUNET_CRYPTO_EcdsaPublicKey *subject, const char *attribute, struct GNUNET_TIME_Absolute *expiration)
Issue an attribute to a subject.
void * proc_cls
verify_proc closure
Time for absolute times used by GNUnet, in microseconds.
struct GNUNET_CREDENTIAL_Request * GNUNET_CREDENTIAL_verify(struct GNUNET_CREDENTIAL_Handle *handle, const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, uint32_t credential_count, const struct GNUNET_CREDENTIAL_Credential *credentials, GNUNET_CREDENTIAL_CredentialResultProcessor proc, void *proc_cls)
Performs attribute verification.
void(* GNUNET_CREDENTIAL_DelegateResultProcessor)(void *cls, uint32_t success)
Iterator called on obtained result for an attribute delegation.
The attribute delegation record.
The attribute delegation record.
uint32_t issuer_attribute_len
Length of the attribute.