2 This file is part of GNUnet.
3 Copyright (C) 2016 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 Liceidentity 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 Liceidentity for more details.
15 You should have received a copy of the GNU General Public Liceidentity
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
23 * @file identity-provider/identity_provider.h
25 * @brief Common type definitions for the identity provider
28 #ifndef IDENTITY_PROVIDER_H
29 #define IDENTITY_PROVIDER_H
31 #include "gnunet_common.h"
34 GNUNET_NETWORK_STRUCT_BEGIN
37 * Use to store an identity attribute
39 struct AttributeStoreMessage
42 * Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT
44 struct GNUNET_MessageHeader header;
47 * Unique identifier for this request (for key collisions).
49 uint32_t id GNUNET_PACKED;
52 * The length of the attribute
54 uint32_t attr_len GNUNET_PACKED;
59 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
61 /* followed by the serialized attribute */
66 * Attribute store response message
68 struct AttributeStoreResultMessage
73 struct GNUNET_MessageHeader header;
76 * Unique identifier for this request (for key collisions).
78 uint32_t id GNUNET_PACKED;
81 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
83 int32_t op_result GNUNET_PACKED;
88 * Attribute is returned from the idp.
90 struct AttributeResultMessage
95 struct GNUNET_MessageHeader header;
98 * Unique identifier for this request (for key collisions).
100 uint32_t id GNUNET_PACKED;
103 * Length of serialized attribute data
105 uint16_t attr_len GNUNET_PACKED;
108 * always zero (for alignment)
110 uint16_t reserved GNUNET_PACKED;
113 * The public key of the identity.
115 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
118 * serialized attribute data
124 * Start a attribute iteration for the given identity
126 struct AttributeIterationStartMessage
131 struct GNUNET_MessageHeader header;
134 * Unique identifier for this request (for key collisions).
136 uint32_t id GNUNET_PACKED;
141 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
147 * Ask for next result of attribute iteration for the given operation
149 struct AttributeIterationNextMessage
152 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT
154 struct GNUNET_MessageHeader header;
157 * Unique identifier for this request (for key collisions).
159 uint32_t id GNUNET_PACKED;
165 * Stop attribute iteration for the given operation
167 struct AttributeIterationStopMessage
170 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_STOP
172 struct GNUNET_MessageHeader header;
175 * Unique identifier for this request (for key collisions).
177 uint32_t id GNUNET_PACKED;
182 * Start a ticket iteration for the given identity
184 struct TicketIterationStartMessage
189 struct GNUNET_MessageHeader header;
192 * Unique identifier for this request (for key collisions).
194 uint32_t id GNUNET_PACKED;
199 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
202 * Identity is audience or issuer
204 uint32_t is_audience GNUNET_PACKED;
209 * Ask for next result of ticket iteration for the given operation
211 struct TicketIterationNextMessage
214 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT
216 struct GNUNET_MessageHeader header;
219 * Unique identifier for this request (for key collisions).
221 uint32_t id GNUNET_PACKED;
227 * Stop ticket iteration for the given operation
229 struct TicketIterationStopMessage
232 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP
234 struct GNUNET_MessageHeader header;
237 * Unique identifier for this request (for key collisions).
239 uint32_t id GNUNET_PACKED;
246 * Ticket issue message
248 struct IssueTicketMessage
251 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET
253 struct GNUNET_MessageHeader header;
256 * Unique identifier for this request (for key collisions).
258 uint32_t id GNUNET_PACKED;
263 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
268 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
271 * length of serialized attribute list
273 uint32_t attr_len GNUNET_PACKED;
275 //Followed by a serialized attribute list
279 * Ticket revoke message
281 struct RevokeTicketMessage
284 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET
286 struct GNUNET_MessageHeader header;
289 * Unique identifier for this request (for key collisions).
291 uint32_t id GNUNET_PACKED;
296 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
299 * length of serialized attribute list
301 uint32_t attrs_len GNUNET_PACKED;
303 //Followed by a ticket and serialized attribute list
307 * Ticket revoke message
309 struct RevokeTicketResultMessage
312 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT
314 struct GNUNET_MessageHeader header;
317 * Unique identifier for this request (for key collisions).
319 uint32_t id GNUNET_PACKED;
324 uint32_t success GNUNET_PACKED;
329 * Ticket result message
331 struct TicketResultMessage
334 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT
336 struct GNUNET_MessageHeader header;
339 * Unique identifier for this request (for key collisions).
341 uint32_t id GNUNET_PACKED;
346 * Ticket consume message
348 struct ConsumeTicketMessage
351 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET
353 struct GNUNET_MessageHeader header;
356 * Unique identifier for this request (for key collisions).
358 uint32_t id GNUNET_PACKED;
363 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
365 //Followed by a serialized ticket
369 * Attribute list is returned from the idp.
371 struct ConsumeTicketResultMessage
376 struct GNUNET_MessageHeader header;
379 * Unique identifier for this request (for key collisions).
381 uint32_t id GNUNET_PACKED;
384 * Length of serialized attribute data
386 uint16_t attrs_len GNUNET_PACKED;
389 * always zero (for alignment)
391 uint16_t reserved GNUNET_PACKED;
394 * The public key of the identity.
396 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
399 * serialized attributes data
405 GNUNET_NETWORK_STRUCT_END