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
67 struct GNUNET_MessageHeader header;
69 /* followed by 0-terminated ego name */
74 * Service informs client about status of a pseudonym.
79 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE
81 struct GNUNET_MessageHeader header;
84 * Number of bytes in ego name string including 0-termination, in NBO;
85 * 0 if the ego was deleted.
87 uint16_t name_len GNUNET_PACKED;
90 * Usually #GNUNET_NO, #GNUNET_YES to signal end of list.
92 uint16_t end_of_list GNUNET_PACKED;
97 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
99 /* followed by 0-terminated ego name */
104 * Client requests knowledge about default identity for
105 * a subsystem from identity service.
107 struct GetDefaultMessage
110 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT
112 struct GNUNET_MessageHeader header;
115 * Number of bytes in service name string including 0-termination, in NBO.
117 uint16_t name_len GNUNET_PACKED;
122 uint16_t reserved GNUNET_PACKED;
125 /* followed by 0-terminated service name */
130 * Used from service to client as a result to the GET_DEFAULT
131 * message, used from client to service to SET_DEFAULT.
133 struct SetDefaultMessage
136 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
138 struct GNUNET_MessageHeader header;
141 * Number of bytes in service name string including 0-termination, in NBO.
143 uint16_t name_len GNUNET_PACKED;
148 uint16_t reserved GNUNET_PACKED;
153 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
155 /* followed by 0-terminated service name */
160 * Client requests creation of an identity. Service
161 * will respond with a result code.
163 struct CreateRequestMessage
166 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE
168 struct GNUNET_MessageHeader header;
171 * Number of bytes in identity name string including 0-termination, in NBO.
173 uint16_t name_len GNUNET_PACKED;
178 uint16_t reserved GNUNET_PACKED;
183 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key;
185 /* followed by 0-terminated identity name */
190 * Client requests renaming of an identity. Service
191 * will respond with a result code.
196 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME
198 struct GNUNET_MessageHeader header;
201 * Number of characters in the old name including 0-termination, in NBO.
203 uint16_t old_name_len GNUNET_PACKED;
206 * Number of characters in the new name including 0-termination, in NBO.
208 uint16_t new_name_len GNUNET_PACKED;
210 /* followed by 0-terminated old name */
211 /* followed by 0-terminated new name */
216 * Client requests deletion of an identity. Service
217 * will respond with a result code.
222 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE
224 struct GNUNET_MessageHeader header;
227 * Number of characters in the name including 0-termination, in NBO.
229 uint16_t name_len GNUNET_PACKED;
234 uint16_t reserved GNUNET_PACKED;
236 /* followed by 0-terminated name */
239 GNUNET_NETWORK_STRUCT_END
244 struct GNUNET_IDENTITY_Ego
247 * Private key associated with this ego.
249 struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
252 * Current name associated with this ego.
257 * Client context associated with this ego.
262 * Hash of the public key of this ego.
264 struct GNUNET_HashCode id;