2 This file is part of GNUnet
3 Copyright (C) 2012-2014 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * @author Martin Schanzenbach
25 * API to the Credential service
27 * @defgroup credential Credential service
32 #ifndef GNUNET_CREDENTIAL_SERVICE_H
33 #define GNUNET_CREDENTIAL_SERVICE_H
35 #include "gnunet_util_lib.h"
36 #include "gnunet_gns_service.h"
41 #if 0 /* keep Emacsens' auto-indent happy */
48 * Connection to the Credential service.
50 struct GNUNET_CREDENTIAL_Handle;
53 * Handle to control a lookup operation.
55 struct GNUNET_CREDENTIAL_LookupRequest;
59 * Initialize the connection with the Credential service.
61 * @param cfg configuration to use
62 * @return handle to the Credential service, or NULL on error
64 struct GNUNET_Credential_Handle *
65 GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
69 * Shutdown connection with the Credentail service.
71 * @param handle connection to shut down
74 GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle);
78 * Iterator called on obtained result for a Credential lookup.
81 * @param issuer the issuer chain
82 * @param issuer_len length of issuer chain
83 * @param value the value returned
86 (*GNUNET_CREDENTIAL_LookupResultProcessor) (void *cls,
87 struct GNUNET_IDENTITY_Ego *issuer,
89 const struct GNUNET_CREDENTIAL_Value *value);
93 * Perform an asynchronous lookup operation for a credential.
95 * @param handle handle to the Credential service
96 * @param credential the credential to look up
97 * @param subject Ego to check the credential for
98 * @param proc function to call on result
99 * @param proc_cls closure for processor
100 * @return handle to the queued request
102 struct GNUNET_CREDENTIAL_LookupRequest *
103 GNUNET_CREDENTIAL_lookup (struct GNUNET_CREDENTIAL_Handle *handle,
104 const char *credential,
105 const struct GNUNET_IDENTITY_Ego *subject,
106 GNUNET_CREDENTIAL_LookupResultProcessor proc,
111 * Issue a credential to an identity
113 * @param handle handle to the Credential service
114 * @param issuer the identity that issues the credential
115 * @param subject the subject of the credential
116 * @param credential the name of the credential
117 * @param value the value of the credential
118 * @return handle to the queued request
120 struct GNUNET_CREDENTIAL_IssueRequest *
121 GNUNET_CREDENTIAL_issue (struct GNUNET_CREDENTIAL_Handle *handle,
122 struct GNUNET_IDENTITY_Ego *issuer,
123 struct GNUNET_IDENTITY_Ego *subject,
124 const char *credential,
125 struct GNUNET_CREDENTIAL_Value *value,
126 GNUNET_CREDENTIAL_IssueResultProcessor proc,
130 * Remove a credential
132 * @param handle handle to the Credential service
133 * @param issuer the identity that issued the credential
134 * @param subject the subject of the credential
135 * @param credential the name of the credential
136 * @return handle to the queued request
138 struct GNUNET_CREDENTIAL_IssueRequest *
139 GNUNET_CREDENTIAL_remove (struct GNUNET_CREDENTIAL_Handle *handle,
140 struct GNUNET_IDENTITY_Ego *issuer,
141 struct GNUNET_IDENTITY_Ego *subject,
142 const char *credential,
143 GNUNET_CREDENTIAL_IssueResultProcessor proc,
149 * Cancel pending lookup request
151 * @param lr the lookup request to cancel
154 GNUNET_CREDENTIAL_lookup_cancel (struct GNUNET_CREDENTIAL_LookupRequest *lr);
157 #if 0 /* keep Emacsens' auto-indent happy */
166 /** @} */ /* end of group */