2 This file is part of GNUnet
3 Copyright (C) 2012-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/>.
19 * @file credential/credential.h
20 * @brief IPC messages between CREDENTIAL API and CREDENTIAL service
21 * @author Martin Schanzenbach
26 #include "gnunet_credential_service.h"
28 GNUNET_NETWORK_STRUCT_BEGIN
31 * Message from client to Credential service to collect credentials.
36 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
38 struct GNUNET_MessageHeader header;
43 struct GNUNET_CRYPTO_EcdsaPrivateKey subject_key;
48 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
51 * Length of the issuer attribute
53 uint16_t issuer_attribute_len;
56 * Unique identifier for this request (for key collisions).
58 uint32_t id GNUNET_PACKED;
60 /* Followed by the zero-terminated attribute */
66 * Message from client to Credential service to verify attributes.
71 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
73 struct GNUNET_MessageHeader header;
78 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
83 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
86 * Number of credentials
91 * Length of the issuer attribute
93 uint16_t issuer_attribute_len;
96 * Unique identifier for this request (for key collisions).
98 uint32_t id GNUNET_PACKED;
100 /* Followed by the zero-terminated attribute and credentials to look up */
106 * Message from CREDENTIAL service to client: new results.
108 struct DelegationChainResultMessage
111 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT
113 struct GNUNET_MessageHeader header;
116 * Unique identifier for this request (for key collisions).
118 uint32_t id GNUNET_PACKED;
121 * Indicates if credential has been found at all
123 uint32_t cred_found GNUNET_PACKED;
126 * The number of delegations in the response
128 uint32_t d_count GNUNET_PACKED;
131 * The number of credentials in the response
133 uint32_t c_count GNUNET_PACKED;
135 /* followed by ad_count GNUNET_CREDENTIAL_RecordData structs*/
139 struct DelegationRecordData
144 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
149 uint32_t subject_attribute_len GNUNET_PACKED;
158 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
163 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
168 uint32_t issuer_attribute_len GNUNET_PACKED;
173 uint32_t subject_attribute_len GNUNET_PACKED;
177 struct CredentialEntry
181 * The signature for this credential by the issuer
183 struct GNUNET_CRYPTO_EcdsaSignature signature;
188 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
191 * Public key of the issuer
193 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
196 * Public key of the subject this credential was issued to
198 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
201 * Expiration time of this credential
203 uint64_t expiration GNUNET_PACKED;
206 * Issuer attribute length
208 uint32_t issuer_attribute_len;
211 * Followed by the attribute string
216 GNUNET_NETWORK_STRUCT_END