GNUnet 0.22.1
gnunet_abd_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
35#ifndef GNUNET_ABD_SERVICE_H
36#define GNUNET_ABD_SERVICE_H
37
38
39#include "gnunet_util_lib.h"
40#include "gnunet_gns_service.h"
42
43#ifdef __cplusplus
44extern "C"
45{
46#if 0 /* keep Emacsens' auto-indent happy */
47}
48#endif
49#endif
50
51
56
61
62/*
63* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
64*/
66{
67
68 // Subject had credentials before, but have been revoked now
70
71 // Subject flag indicates that the subject is a holder of this credential and may present it as such
73
74 // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
76
77};
78
84{
85
89 uint32_t set_count;
90
94 uint64_t data_size;
99};
100
105{
106
111
116};
117
118
120
125{
126
131
133
137 const char *subject_attribute;
138};
139
140
145{
146
151
156
161
165 const char *issuer_attribute;
166
171
175 const char *subject_attribute;
176};
177
178
183{
184
189
194
199
204
209
213 const char *issuer_attribute;
214
219
223 const char *subject_attribute;
224
225};
226
227/*
228* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
229*/
231{
232
233 // Subject had credentials before, but have been revoked now
235
236 // Subject flag indicates that the subject is a holder of this credential and may present it as such
238
240
247struct GNUNET_ABD_Handle *
249
250
256void
258
259
269typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls,
270 unsigned int d_count,
271 struct
273 delegation_chain,
274 unsigned int c_count,
276 *delegte);
277
278typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
279 struct
281 delegation,
282 bool is_bw);
283
291typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
292 uint32_t success);
293
302 uint32_t success);
303
304
323struct GNUNET_ABD_Request*
326 const char *issuer_attribute,
327 const struct GNUNET_CRYPTO_PublicKey *subject_key,
328 uint32_t delegate_count,
329 const struct GNUNET_ABD_Delegate *delegates,
332 void *proc_cls,
334 void *proc2_cls);
335
336struct GNUNET_ABD_Request*
339 const char *issuer_attribute,
340 const struct GNUNET_CRYPTO_PrivateKey *subject_key,
343 void *proc_cls,
345 void *proc2_cls);
346
359struct GNUNET_ABD_Request *
361 struct GNUNET_IDENTITY_Ego *issuer,
362 const char *attribute,
364 const char *delegated_attribute,
366 void *proc_cls);
367
378struct GNUNET_ABD_Request *
380 struct GNUNET_IDENTITY_Ego *issuer,
381 const char *attribute,
383 void *proc_cls);
384
385
398 const char *iss_attr,
399 const char *sub_attr,
401
402
408void
410
411
412#if 0 /* keep Emacsens' auto-indent happy */
413{
414#endif
415#ifdef __cplusplus
416}
417#endif
418
419#endif
420 /* end of group */
422 /* end of group addition to reclaim_suite */
static char * issuer_key
Issuer pubkey string.
Definition: gnunet-abd.c:113
static char * subject
Subject pubkey string.
Definition: gnunet-abd.c:87
enum GNUNET_ABD_AlgoDirectionFlags direction
API enum, filled and passed for collect/verify.
Definition: gnunet-abd.c:173
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static struct GNUNET_TIME_Relative expiration
User supplied expiration value.
static struct GNUNET_GNS_LookupWithTldRequest * lr
Handle to lookup request.
Definition: gnunet-gns.c:98
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
API to the GNS service.
Identity service; implements identity management for GNUnet.
struct GNUNET_ABD_Request * GNUNET_ABD_add_delegation(struct GNUNET_ABD_Handle *handle, struct GNUNET_IDENTITY_Ego *issuer, const char *attribute, struct GNUNET_CRYPTO_PublicKey *subject, const char *delegated_attribute, GNUNET_ABD_DelegateResultProcessor proc, void *proc_cls)
Delegate an attribute.
void(* GNUNET_ABD_RemoveDelegateResultProcessor)(void *cls, uint32_t success)
Iterator called on obtained result for an attribute delegation removal.
void(* GNUNET_ABD_IntermediateResultProcessor)(void *cls, struct GNUNET_ABD_Delegation *delegation, bool is_bw)
GNUNET_ABD_AlgoDirectionFlags
struct GNUNET_ABD_Handle * GNUNET_ABD_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the Credential service.
Definition: abd_api.c:354
GNUNET_ABD_CredentialFlags
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_issue(const struct GNUNET_CRYPTO_PrivateKey *issuer, struct GNUNET_CRYPTO_PublicKey *subject, const char *iss_attr, const char *sub_attr, struct GNUNET_TIME_Absolute *expiration)
Issue an attribute to a subject.
void(* GNUNET_ABD_DelegateResultProcessor)(void *cls, uint32_t success)
Iterator called on obtained result for an attribute delegation.
struct GNUNET_ABD_Request * GNUNET_ABD_verify(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_PublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_PublicKey *subject_key, uint32_t delegate_count, const struct GNUNET_ABD_Delegate *delegates, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, GNUNET_ABD_IntermediateResultProcessor, void *proc2_cls)
Performs attribute verification.
Definition: abd_api.c:497
void GNUNET_ABD_disconnect(struct GNUNET_ABD_Handle *handle)
Shutdown connection with the Credential service.
Definition: abd_api.c:376
void GNUNET_ABD_request_cancel(struct GNUNET_ABD_Request *lr)
Cancel pending lookup request.
Definition: abd_api.c:399
struct GNUNET_ABD_Request * GNUNET_ABD_collect(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_PublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_PrivateKey *subject_key, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, GNUNET_ABD_IntermediateResultProcessor, void *proc2_cls)
Performs attribute collection.
Definition: abd_api.c:423
void(* GNUNET_ABD_CredentialResultProcessor)(void *cls, unsigned int d_count, struct GNUNET_ABD_Delegation *delegation_chain, unsigned int c_count, struct GNUNET_ABD_Delegate *delegte)
Iterator called on obtained result for an attribute verification.
struct GNUNET_ABD_Request * GNUNET_ABD_remove_delegation(struct GNUNET_ABD_Handle *handle, struct GNUNET_IDENTITY_Ego *issuer, const char *attribute, GNUNET_ABD_RemoveDelegateResultProcessor proc, void *proc_cls)
Remove a delegation.
@ GNUNET_ABD_FLAG_BACKWARD
@ GNUNET_ABD_FLAG_FORWARD
@ GNUNET_ABD_FLAG_SUBJECT
@ GNUNET_ABD_FLAG_REVOKED
@ GNUNET_ABD_FLAG_ISSUER
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
const char * subject_attribute
The subject attribute.
const char * issuer_attribute
The issuer attribute.
uint32_t issuer_attribute_len
Length of the issuer attribute.
uint32_t subject_attribute_len
Length of the subject attribute.
struct GNUNET_CRYPTO_Signature signature
Signature of this credential.
struct GNUNET_CRYPTO_PublicKey issuer_key
The issuer of the credential.
struct GNUNET_TIME_Absolute expiration
Expiration of this credential.
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this credential was issued to.
The attribute delegation record.
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this attribute was delegated to.
uint32_t subject_attribute_len
Length of attribute, may be 0.
The attribute delegation record.
uint64_t data_size
Length of delegation sets.
uint32_t set_count
Number of delegation sets in this record.
The attribute delegation record.
const char * subject_attribute
The subject attribute.
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this attribute was delegated to.
uint32_t issuer_attribute_len
Length of the attribute.
uint32_t subject_attribute_len
Length of the attribute.
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this attribute was delegated to.
const char * issuer_attribute
The attribute.
const char * subject_attribute
The attribute.
struct GNUNET_CRYPTO_PublicKey issuer_key
The issuer of the delegation.
Connection to the ABD service.
Definition: abd_api.c:96
Handle to a verify request.
Definition: abd_api.c:43
void * proc_cls
verify_proc closure
Definition: abd_api.c:68
void * proc2_cls
verify_proc2 closure
Definition: abd_api.c:78
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
An identity signature as per LSD0001.
Handle for an ego.
Definition: identity.h:37
Time for absolute times used by GNUnet, in microseconds.