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/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
21 * @file credential/credential.h
22 * @brief IPC messages between CREDENTIAL API and CREDENTIAL service
23 * @author Martin Schanzenbach
28 #include "gnunet_credential_service.h"
30 GNUNET_NETWORK_STRUCT_BEGIN
33 * Message from client to Credential service to collect credentials.
38 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
40 struct GNUNET_MessageHeader header;
45 struct GNUNET_CRYPTO_EcdsaPrivateKey subject_key;
50 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
53 * Length of the issuer attribute
55 uint16_t issuer_attribute_len;
58 * Unique identifier for this request (for key collisions).
60 uint32_t id GNUNET_PACKED;
62 /* Followed by the zero-terminated attribute */
67 * Message from client to Credential service to verify attributes.
72 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
74 struct GNUNET_MessageHeader header;
79 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
84 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
87 * Number of credentials
92 * Length of the issuer attribute
94 uint16_t issuer_attribute_len;
97 * Unique identifier for this request (for key collisions).
99 uint32_t id GNUNET_PACKED;
101 /* 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*/
138 struct DelegationRecordData
143 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
148 uint32_t subject_attribute_len GNUNET_PACKED;
157 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
162 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
167 uint32_t issuer_attribute_len GNUNET_PACKED;
172 uint32_t subject_attribute_len GNUNET_PACKED;
176 struct CredentialEntry
179 * The signature for this credential by the issuer
181 struct GNUNET_CRYPTO_EcdsaSignature signature;
186 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
189 * Public key of the issuer
191 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
194 * Public key of the subject this credential was issued to
196 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
199 * Expiration time of this credential
201 uint64_t expiration GNUNET_PACKED;
204 * Issuer attribute length
206 uint32_t issuer_attribute_len;
209 * Followed by the attribute string
214 GNUNET_NETWORK_STRUCT_END