aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_identity_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-06 14:18:31 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-06 14:18:31 +0000
commitfe76c075e315c0351e2fe465434ae39087daf014 (patch)
tree436887ccaf331932a3c13a8b9d2a2a710dad4be6 /src/include/gnunet_identity_service.h
parent7eb2835d8a494c83aedb720a2ac6f6e5ba23f22f (diff)
downloadgnunet-fe76c075e315c0351e2fe465434ae39087daf014.tar.gz
gnunet-fe76c075e315c0351e2fe465434ae39087daf014.zip
moving to new, fixed-size encoding of public and private ECC keys everywhere, also improving ECC API to better support ECRS/GADS operations
Diffstat (limited to 'src/include/gnunet_identity_service.h')
-rw-r--r--src/include/gnunet_identity_service.h41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h
index 1d67c568c..dfc643d22 100644
--- a/src/include/gnunet_identity_service.h
+++ b/src/include/gnunet_identity_service.h
@@ -74,7 +74,18 @@ struct GNUNET_IDENTITY_Operation;
74 * @return associated ECC key, valid as long as the ego is valid 74 * @return associated ECC key, valid as long as the ego is valid
75 */ 75 */
76const struct GNUNET_CRYPTO_EccPrivateKey * 76const struct GNUNET_CRYPTO_EccPrivateKey *
77GNUNET_IDENTITY_ego_get_key (struct GNUNET_IDENTITY_Ego *ego); 77GNUNET_IDENTITY_ego_get_private_key (struct GNUNET_IDENTITY_Ego *ego);
78
79
80/**
81 * Get the identifier (public key) of an ego.
82 *
83 * @param ego identity handle with the private key
84 * @param pk set to ego's public key
85 */
86void
87GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego,
88 struct GNUNET_CRYPTO_EccPublicKey *pk);
78 89
79 90
80/** 91/**
@@ -83,7 +94,7 @@ GNUNET_IDENTITY_ego_get_key (struct GNUNET_IDENTITY_Ego *ego);
83 * 94 *
84 * When used with 'GNUNET_IDENTITY_connect', this function is 95 * When used with 'GNUNET_IDENTITY_connect', this function is
85 * initially called for all egos and then again whenever a 96 * initially called for all egos and then again whenever a
86 * ego's identifier changes or if it is deleted. At the end of 97 * ego's name changes or if it is deleted. At the end of
87 * the initial pass over all egos, the function is once called 98 * the initial pass over all egos, the function is once called
88 * with 'NULL' for 'ego'. That does NOT mean that the callback won't 99 * with 'NULL' for 'ego'. That does NOT mean that the callback won't
89 * be invoked in the future or that there was an error. 100 * be invoked in the future or that there was an error.
@@ -97,10 +108,10 @@ GNUNET_IDENTITY_ego_get_key (struct GNUNET_IDENTITY_Ego *ego);
97 * that one was not NULL). 108 * that one was not NULL).
98 * 109 *
99 * When an identity is renamed, this function is called with the 110 * When an identity is renamed, this function is called with the
100 * (known) ego but the NEW identifier. 111 * (known) ego but the NEW name.
101 * 112 *
102 * When an identity is deleted, this function is called with the 113 * When an identity is deleted, this function is called with the
103 * (known) ego and "NULL" for the 'identifier'. In this case, 114 * (known) ego and "NULL" for the 'name'. In this case,
104 * the 'ego' is henceforth invalid (and the 'ctx' should also be 115 * the 'ego' is henceforth invalid (and the 'ctx' should also be
105 * cleaned up). 116 * cleaned up).
106 * 117 *
@@ -108,14 +119,14 @@ GNUNET_IDENTITY_ego_get_key (struct GNUNET_IDENTITY_Ego *ego);
108 * @param ego ego handle 119 * @param ego ego handle
109 * @param ego_ctx context for application to store data for this ego 120 * @param ego_ctx context for application to store data for this ego
110 * (during the lifetime of this process, initially NULL) 121 * (during the lifetime of this process, initially NULL)
111 * @param identifier identifier assigned by the user for this ego, 122 * @param name name assigned by the user for this ego,
112 * NULL if the user just deleted the ego and it 123 * NULL if the user just deleted the ego and it
113 * must thus no longer be used 124 * must thus no longer be used
114 */ 125 */
115typedef void (*GNUNET_IDENTITY_Callback)(void *cls, 126typedef void (*GNUNET_IDENTITY_Callback)(void *cls,
116 struct GNUNET_IDENTITY_Ego *ego, 127 struct GNUNET_IDENTITY_Ego *ego,
117 void **ctx, 128 void **ctx,
118 const char *identifier); 129 const char *name);
119 130
120 131
121/** 132/**
@@ -188,17 +199,17 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h);
188 199
189 200
190/** 201/**
191 * Create a new identity with the given identifier. 202 * Create a new identity with the given name.
192 * 203 *
193 * @param id identity service to use 204 * @param id identity service to use
194 * @param identifier desired identifier 205 * @param name desired name
195 * @param cont function to call with the result (will only be called once) 206 * @param cont function to call with the result (will only be called once)
196 * @param cont_cls closure for cont 207 * @param cont_cls closure for cont
197 * @return handle to abort the operation 208 * @return handle to abort the operation
198 */ 209 */
199struct GNUNET_IDENTITY_Operation * 210struct GNUNET_IDENTITY_Operation *
200GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id, 211GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id,
201 const char *identifier, 212 const char *name,
202 GNUNET_IDENTITY_Continuation cont, 213 GNUNET_IDENTITY_Continuation cont,
203 void *cont_cls); 214 void *cont_cls);
204 215
@@ -207,16 +218,16 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id,
207 * Renames an existing identity. 218 * Renames an existing identity.
208 * 219 *
209 * @param id identity service to use 220 * @param id identity service to use
210 * @param old_identifier old identifier 221 * @param old_name old name
211 * @param new_identifier desired new identifier 222 * @param new_name desired new name
212 * @param cb function to call with the result (will only be called once) 223 * @param cb function to call with the result (will only be called once)
213 * @param cb_cls closure for cb 224 * @param cb_cls closure for cb
214 * @return handle to abort the operation 225 * @return handle to abort the operation
215 */ 226 */
216struct GNUNET_IDENTITY_Operation * 227struct GNUNET_IDENTITY_Operation *
217GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id, 228GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id,
218 const char *old_identifier, 229 const char *old_name,
219 const char *new_identifier, 230 const char *new_name,
220 GNUNET_IDENTITY_Continuation cb, 231 GNUNET_IDENTITY_Continuation cb,
221 void *cb_cls); 232 void *cb_cls);
222 233
@@ -225,14 +236,14 @@ GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id,
225 * Delete an existing identity. 236 * Delete an existing identity.
226 * 237 *
227 * @param id identity service to use 238 * @param id identity service to use
228 * @param identifier identifier of the identity to delete 239 * @param name name of the identity to delete
229 * @param cb function to call with the result (will only be called once) 240 * @param cb function to call with the result (will only be called once)
230 * @param cb_cls closure for cb 241 * @param cb_cls closure for cb
231 * @return handle to abort the operation 242 * @return handle to abort the operation
232 */ 243 */
233struct GNUNET_IDENTITY_Operation * 244struct GNUNET_IDENTITY_Operation *
234GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id, 245GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id,
235 const char *identifier, 246 const char *name,
236 GNUNET_IDENTITY_Continuation cb, 247 GNUNET_IDENTITY_Continuation cb,
237 void *cb_cls); 248 void *cb_cls);
238 249