2 This file is part of GNUnet.
3 Copyright (C) 2013 GNUnet e.V.
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.
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.
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/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
22 * @author Christian Grothoff
23 * @file identity/identity.h
25 * @brief Common type definitions for the identity
31 #include "gnunet_common.h"
34 GNUNET_NETWORK_STRUCT_BEGIN
38 * Answer from service to client about last operation;
39 * GET_DEFAULT maybe answered with this message on failure;
40 * CREATE and RENAME will always be answered with this message.
42 struct ResultCodeMessage
45 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE
47 struct GNUNET_MessageHeader header;
50 * Status code for the last operation, in NBO.
51 * (currently not used).
53 uint32_t result_code GNUNET_PACKED;
55 /* followed by 0-terminated error message (on error) */
60 * Client informs service about desire to lookup a (single) pseudonym.
65 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP or
66 * #GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP_BY_SUFFIX
68 struct GNUNET_MessageHeader header;
70 /* followed by 0-terminated ego name */
75 * Service informs client about status of a pseudonym.
80 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE
82 struct GNUNET_MessageHeader header;
85 * Number of bytes in ego name string including 0-termination, in NBO;
86 * 0 if the ego was deleted.
88 uint16_t name_len GNUNET_PACKED;
91 * Usually #GNUNET_NO, #GNUNET_YES to signal end of list.
93 uint16_t end_of_list GNUNET_PACKED;
98 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
100 /* followed by 0-terminated ego name */
105 * Client requests knowledge about default identity for
106 * a subsystem from identity service.
108 struct GetDefaultMessage
111 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT
113 struct GNUNET_MessageHeader header;
116 * Number of bytes in service name string including 0-termination, in NBO.
118 uint16_t name_len GNUNET_PACKED;
123 uint16_t reserved GNUNET_PACKED;
126 /* followed by 0-terminated service name */
131 * Used from service to client as a result to the GET_DEFAULT
132 * message, used from client to service to SET_DEFAULT.
134 struct SetDefaultMessage
137 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
139 struct GNUNET_MessageHeader header;
142 * Number of bytes in service name string including 0-termination, in NBO.
144 uint16_t name_len GNUNET_PACKED;
149 uint16_t reserved GNUNET_PACKED;
154 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
156 /* followed by 0-terminated service name */
161 * Client requests creation of an identity. Service
162 * will respond with a result code.
164 struct CreateRequestMessage
167 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE
169 struct GNUNET_MessageHeader header;
172 * Number of bytes in identity name string including 0-termination, in NBO.
174 uint16_t name_len GNUNET_PACKED;
179 uint16_t reserved GNUNET_PACKED;
184 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
186 /* followed by 0-terminated identity name */
191 * Client requests renaming of an identity. Service
192 * will respond with a result code.
197 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME
199 struct GNUNET_MessageHeader header;
202 * Number of characters in the old name including 0-termination, in NBO.
204 uint16_t old_name_len GNUNET_PACKED;
207 * Number of characters in the new name including 0-termination, in NBO.
209 uint16_t new_name_len GNUNET_PACKED;
211 /* followed by 0-terminated old name */
212 /* followed by 0-terminated new name */
217 * Client requests deletion of an identity. Service
218 * will respond with a result code.
223 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE
225 struct GNUNET_MessageHeader header;
228 * Number of characters in the name including 0-termination, in NBO.
230 uint16_t name_len GNUNET_PACKED;
235 uint16_t reserved GNUNET_PACKED;
237 /* followed by 0-terminated name */
240 GNUNET_NETWORK_STRUCT_END
245 struct GNUNET_IDENTITY_Ego
248 * Private key associated with this ego.
250 struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
253 * Current name associated with this ego.
258 * Client context associated with this ego.
263 * Hash of the public key of this ego.
265 struct GNUNET_HashCode id;