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.
35 struct CollectMessage {
37 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
39 struct GNUNET_MessageHeader header;
44 struct GNUNET_CRYPTO_EcdsaPrivateKey subject_key;
49 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
52 * Length of the issuer attribute
54 uint16_t issuer_attribute_len;
57 * Unique identifier for this request (for key collisions).
59 uint32_t id GNUNET_PACKED;
61 /* Followed by the zero-terminated attribute */
66 * Message from client to Credential service to verify attributes.
68 struct VerifyMessage {
70 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
72 struct GNUNET_MessageHeader header;
77 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
82 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
85 * Number of credentials
90 * Length of the issuer attribute
92 uint16_t issuer_attribute_len;
95 * Unique identifier for this request (for key collisions).
97 uint32_t id GNUNET_PACKED;
99 /* Followed by the zero-terminated attribute and credentials to look up */
104 * Message from CREDENTIAL service to client: new results.
106 struct DelegationChainResultMessage {
108 * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT
110 struct GNUNET_MessageHeader header;
113 * Unique identifier for this request (for key collisions).
115 uint32_t id GNUNET_PACKED;
118 * Indicates if credential has been found at all
120 uint32_t cred_found GNUNET_PACKED;
123 * The number of delegations in the response
125 uint32_t d_count GNUNET_PACKED;
128 * The number of credentials in the response
130 uint32_t c_count GNUNET_PACKED;
132 /* followed by ad_count GNUNET_CREDENTIAL_RecordData structs*/
135 struct DelegationRecordData {
139 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
144 uint32_t subject_attribute_len GNUNET_PACKED;
152 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
157 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
162 uint32_t issuer_attribute_len GNUNET_PACKED;
167 uint32_t subject_attribute_len GNUNET_PACKED;
171 struct CredentialEntry {
173 * The signature for this credential by the issuer
175 struct GNUNET_CRYPTO_EcdsaSignature signature;
180 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
183 * Public key of the issuer
185 struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
188 * Public key of the subject this credential was issued to
190 struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
193 * Expiration time of this credential
195 uint64_t expiration GNUNET_PACKED;
198 * Issuer attribute length
200 uint32_t issuer_attribute_len;
203 * Followed by the attribute string
208 GNUNET_NETWORK_STRUCT_END