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;
57 * The expiration interval of the attribute
59 uint64_t exp GNUNET_PACKED;
64 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
66 /* followed by the serialized attribute */
71 * Attribute store response message
73 struct AttributeStoreResultMessage
78 struct GNUNET_MessageHeader header;
81 * Unique identifier for this request (for key collisions).
83 uint32_t id GNUNET_PACKED;
86 * #GNUNET_SYSERR on failure, #GNUNET_OK on success
88 int32_t op_result GNUNET_PACKED;
93 * Attribute is returned from the idp.
95 struct AttributeResultMessage
100 struct GNUNET_MessageHeader header;
103 * Unique identifier for this request (for key collisions).
105 uint32_t id GNUNET_PACKED;
108 * Length of serialized attribute data
110 uint16_t attr_len GNUNET_PACKED;
113 * always zero (for alignment)
115 uint16_t reserved GNUNET_PACKED;
118 * The public key of the identity.
120 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
123 * serialized attribute data
129 * Start a attribute iteration for the given identity
131 struct AttributeIterationStartMessage
136 struct GNUNET_MessageHeader header;
139 * Unique identifier for this request (for key collisions).
141 uint32_t id GNUNET_PACKED;
146 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
152 * Ask for next result of attribute iteration for the given operation
154 struct AttributeIterationNextMessage
157 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT
159 struct GNUNET_MessageHeader header;
162 * Unique identifier for this request (for key collisions).
164 uint32_t id GNUNET_PACKED;
170 * Stop attribute iteration for the given operation
172 struct AttributeIterationStopMessage
175 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_STOP
177 struct GNUNET_MessageHeader header;
180 * Unique identifier for this request (for key collisions).
182 uint32_t id GNUNET_PACKED;
187 * Start a ticket iteration for the given identity
189 struct TicketIterationStartMessage
194 struct GNUNET_MessageHeader header;
197 * Unique identifier for this request (for key collisions).
199 uint32_t id GNUNET_PACKED;
204 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
207 * Identity is audience or issuer
209 uint32_t is_audience GNUNET_PACKED;
214 * Ask for next result of ticket iteration for the given operation
216 struct TicketIterationNextMessage
219 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT
221 struct GNUNET_MessageHeader header;
224 * Unique identifier for this request (for key collisions).
226 uint32_t id GNUNET_PACKED;
232 * Stop ticket iteration for the given operation
234 struct TicketIterationStopMessage
237 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP
239 struct GNUNET_MessageHeader header;
242 * Unique identifier for this request (for key collisions).
244 uint32_t id GNUNET_PACKED;
251 * Ticket issue message
253 struct IssueTicketMessage
256 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET
258 struct GNUNET_MessageHeader header;
261 * Unique identifier for this request (for key collisions).
263 uint32_t id GNUNET_PACKED;
268 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
273 struct GNUNET_CRYPTO_EcdsaPublicKey rp;
276 * length of serialized attribute list
278 uint32_t attr_len GNUNET_PACKED;
280 //Followed by a serialized attribute list
284 * Ticket revoke message
286 struct RevokeTicketMessage
289 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET
291 struct GNUNET_MessageHeader header;
294 * Unique identifier for this request (for key collisions).
296 uint32_t id GNUNET_PACKED;
301 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
304 * length of serialized attribute list
306 uint32_t attrs_len GNUNET_PACKED;
308 //Followed by a ticket and serialized attribute list
312 * Ticket revoke message
314 struct RevokeTicketResultMessage
317 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT
319 struct GNUNET_MessageHeader header;
322 * Unique identifier for this request (for key collisions).
324 uint32_t id GNUNET_PACKED;
329 uint32_t success GNUNET_PACKED;
334 * Ticket result message
336 struct TicketResultMessage
339 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_RESULT
341 struct GNUNET_MessageHeader header;
344 * Unique identifier for this request (for key collisions).
346 uint32_t id GNUNET_PACKED;
351 * Ticket consume message
353 struct ConsumeTicketMessage
356 * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET
358 struct GNUNET_MessageHeader header;
361 * Unique identifier for this request (for key collisions).
363 uint32_t id GNUNET_PACKED;
368 struct GNUNET_CRYPTO_EcdsaPrivateKey identity;
370 //Followed by a serialized ticket
374 * Attribute list is returned from the idp.
376 struct ConsumeTicketResultMessage
381 struct GNUNET_MessageHeader header;
384 * Unique identifier for this request (for key collisions).
386 uint32_t id GNUNET_PACKED;
389 * Length of serialized attribute data
391 uint16_t attrs_len GNUNET_PACKED;
394 * always zero (for alignment)
396 uint16_t reserved GNUNET_PACKED;
399 * The public key of the identity.
401 struct GNUNET_CRYPTO_EcdsaPublicKey identity;
404 * serialized attributes data
410 GNUNET_NETWORK_STRUCT_END