GNUnet  0.11.x
gnunet_identity_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2013 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 
42 #ifndef GNUNET_IDENTITY_SERVICE_H
43 #define GNUNET_IDENTITY_SERVICE_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #if 0 /* keep Emacsens' auto-indent happy */
48 }
49 #endif
50 #endif
51 
52 #include "gnunet_util_lib.h"
53 
54 
58 #define GNUNET_IDENTITY_VERSION 0x00000100
59 
64 
68 struct GNUNET_IDENTITY_Ego;
69 
74 
75 
82 const struct GNUNET_CRYPTO_EcdsaPrivateKey *
84 
85 
91 const struct GNUNET_IDENTITY_Ego *
93 
94 
101 void
104 
105 
140 typedef void
142  struct GNUNET_IDENTITY_Ego *ego,
143  void **ctx,
144  const char *name);
145 
146 
155 struct GNUNET_IDENTITY_Handle *
158  void *cb_cls);
159 
160 
172  const char *service_name,
174  void *cb_cls);
175 
176 
184 typedef void
186  const char *emsg);
187 
188 
201  const char *service_name,
202  struct GNUNET_IDENTITY_Ego *ego,
204  void *cont_cls);
205 
206 
212 void
214 
215 
224 typedef void
226  void *cls,
227  const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk,
228  const char *emsg);
229 
230 
243  const char *name,
244  const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey,
246  void *cont_cls);
247 
248 
261  const char *old_name,
262  const char *new_name,
264  void *cb_cls);
265 
266 
278  const char *name,
280  void *cb_cls);
281 
282 
291 void
293 
294 
295 /* ************* convenience API to lookup an ego ***************** */
296 
303 typedef void
305  struct GNUNET_IDENTITY_Ego *ego);
306 
311 
312 
324  const char *name,
326  void *cb_cls);
327 
328 
334 void
336 
344 typedef void
346  void *cls,
347  const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
348  const char *ego_name);
349 
350 
355 
356 
372  const char *suffix,
374  void *cb_cls);
375 
376 
382 void
385 
386 
387 #if 0 /* keep Emacsens' auto-indent happy */
388 {
389 #endif
390 #ifdef __cplusplus
391 }
392 #endif
393 
394 /* ifndef GNUNET_IDENTITY_SERVICE_H */
395 #endif
396  /* end of group identity */
398 
399 /* end of gnunet_identity_service.h */
struct GNUNET_IDENTITY_Handle * GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Connect to the identity service.
Definition: identity_api.c:566
void GNUNET_IDENTITY_cancel(struct GNUNET_IDENTITY_Operation *op)
Cancel an identity operation.
Definition: identity_api.c:867
void GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el)
Abort ego lookup attempt.
Handle for ego lookup.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
void(* GNUNET_IDENTITY_Callback)(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name)
Method called to inform about the egos of this peer.
void(* GNUNET_IDENTITY_CreateContinuation)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk, const char *emsg)
Function called once the requested operation has been completed.
struct GNUNET_CRYPTO_EcdsaPrivateKey pk
Private key from command line option, or NULL.
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_delete(struct GNUNET_IDENTITY_Handle *id, const char *name, GNUNET_IDENTITY_Continuation cb, void *cb_cls)
Delete an existing ego.
Definition: identity_api.c:826
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_set(struct GNUNET_IDENTITY_Handle *id, const char *service_name, struct GNUNET_IDENTITY_Ego *ego, GNUNET_IDENTITY_Continuation cont, void *cont_cls)
Set the preferred/default ego for a service.
Definition: identity_api.c:677
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:595
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_create(struct GNUNET_IDENTITY_Handle *id, const char *name, const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey, GNUNET_IDENTITY_CreateContinuation cont, void *cont_cls)
Create a new ego with the given name.
Definition: identity_api.c:724
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_get(struct GNUNET_IDENTITY_Handle *id, const char *service_name, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Obtain the ego that is currently preferred/default for a service.
Definition: identity_api.c:632
Private ECC key encoded for transmission.
Handle for an operation with the identity service.
Definition: identity_api.c:39
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
Handle for an ego.
Definition: identity.h:245
Handle for the service.
Definition: identity_api.c:95
struct GNUNET_IDENTITY_EgoSuffixLookup * GNUNET_IDENTITY_ego_lookup_by_suffix(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *suffix, GNUNET_IDENTITY_EgoSuffixCallback cb, void *cb_cls)
Obtain the ego with the maximum suffix match between the ego&#39;s name and the given domain name suffix...
static char * service_name
Option -s: service name (hash to get service descriptor)
Definition: gnunet-vpn.c:51
void GNUNET_IDENTITY_ego_lookup_by_suffix_cancel(struct GNUNET_IDENTITY_EgoSuffixLookup *el)
Abort ego suffix lookup attempt.
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
Definition: identity_api.c:884
GNUNET_IDENTITY_Continuation cont
Continuation to invoke with the result of the transmission; cb and create_cont will be NULL in this c...
Definition: identity_api.c:66
GNUNET_IDENTITY_EgoSuffixCallback cb
Function to call with the result.
struct GNUNET_IDENTITY_EgoLookup * GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *name, GNUNET_IDENTITY_EgoCallback cb, void *cb_cls)
Lookup an ego by name.
configuration data
Definition: configuration.c:84
void(* GNUNET_IDENTITY_EgoCallback)(void *cls, struct GNUNET_IDENTITY_Ego *ego)
Function called with the result.
const char * name
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
GNUNET_IDENTITY_EgoCallback cb
Function to call with the result.
void * cls
Closure for cont or cb.
Definition: identity_api.c:88
const struct GNUNET_IDENTITY_Ego * GNUNET_IDENTITY_ego_get_anonymous(void)
Obtain the ego representing &#39;anonymous&#39; users.
Definition: identity_api.c:156
struct GNUNET_IDENTITY_Operation * GNUNET_IDENTITY_rename(struct GNUNET_IDENTITY_Handle *id, const char *old_name, const char *new_name, GNUNET_IDENTITY_Continuation cb, void *cb_cls)
Renames an existing ego.
Definition: identity_api.c:773
void * cb_cls
Closure for cb.
Definition: identity_api.c:121
char * suffix
Suffix we are looking up.
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:144
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:51
void(* GNUNET_IDENTITY_Continuation)(void *cls, const char *emsg)
Function called once the requested operation has been completed.
void * cb_cls
Closure for cb.
GNUNET_IDENTITY_Callback cb
Function to call when we receive updates.
Definition: identity_api.c:116
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_EcdsaPublicKey *pk)
Get the identifier (public key) of an ego.
Definition: identity_api.c:608
GNUNET_IDENTITY_Callback cb
Continuation to invoke with the result of the transmission for &#39;get&#39; operations (cont and create_cont...
Definition: identity_api.c:83
static char * ego_name
ego
Definition: gnunet-abd.c:117
void(* GNUNET_IDENTITY_EgoSuffixCallback)(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const char *ego_name)
Function called with the result.