GNUnet  0.10.x
credential_serialization.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009-2013, 2016 GNUnet e.V.
4 
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.
9 
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.
14 
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/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
21 
28 #ifndef CREDENTIAL_SERIALIZATION_H
29 #define CREDENTIAL_SERIALIZATION_H
30 
31 #include "platform.h"
32 #include "gnunet_util_lib.h"
33 #include "gnunet_constants.h"
35 
44 size_t
45 GNUNET_CREDENTIAL_delegation_set_get_size(unsigned int ds_count,
46  const struct GNUNET_CREDENTIAL_DelegationSet *dsr);
47 
57 ssize_t
59  const struct GNUNET_CREDENTIAL_DelegationSet *dsr,
60  size_t dest_size,
61  char *dest);
62 
63 
73 int
75  const char *src,
76  unsigned int d_count,
78 
89 size_t
91  const struct GNUNET_CREDENTIAL_Delegation *dd,
92  unsigned int c_count,
93  const struct GNUNET_CREDENTIAL_Credential *cd);
94 
106 ssize_t
108  const struct GNUNET_CREDENTIAL_Delegation *dd,
109  unsigned int c_count,
110  const struct GNUNET_CREDENTIAL_Credential *cd,
111  size_t dest_size,
112  char *dest);
113 
114 
126 int
128  const char *src,
129  unsigned int d_count,
130  struct GNUNET_CREDENTIAL_Delegation *dd,
131  unsigned int c_count,
132  struct GNUNET_CREDENTIAL_Credential *cd);
133 size_t
134 GNUNET_CREDENTIAL_credentials_get_size(unsigned int c_count,
135  const struct GNUNET_CREDENTIAL_Credential *cd);
136 
137 ssize_t
138 GNUNET_CREDENTIAL_credentials_serialize(unsigned int c_count,
139  const struct GNUNET_CREDENTIAL_Credential *cd,
140  size_t dest_size,
141  char *dest);
142 
143 
144 int
146  const char *src,
147  unsigned int c_count,
148  struct GNUNET_CREDENTIAL_Credential *cd);
149 
150 
151 int
153  char **data);
154 
157  size_t data_size);
158 #endif
159 /* end of credential_serialization.h */
struct GNUNET_CREDENTIAL_Credential * GNUNET_CREDENTIAL_credential_deserialize(const char *data, size_t data_size)
int GNUNET_CREDENTIAL_credential_serialize(struct GNUNET_CREDENTIAL_Credential *cred, char **data)
ssize_t GNUNET_CREDENTIAL_delegation_set_serialize(unsigned int d_count, const struct GNUNET_CREDENTIAL_DelegationSet *dsr, size_t dest_size, char *dest)
Serizalize the given delegation record entries.
size_t GNUNET_CREDENTIAL_delegation_chain_get_size(unsigned int d_count, const struct GNUNET_CREDENTIAL_Delegation *dd, unsigned int c_count, const struct GNUNET_CREDENTIAL_Credential *cd)
Calculate how many bytes we will need to serialize the given delegation chain and credential...
ssize_t GNUNET_CREDENTIAL_credentials_serialize(unsigned int c_count, const struct GNUNET_CREDENTIAL_Credential *cd, size_t dest_size, char *dest)
Serizalize the given credentials.
int GNUNET_CREDENTIAL_delegation_chain_deserialize(size_t len, const char *src, unsigned int d_count, struct GNUNET_CREDENTIAL_Delegation *dd, unsigned int c_count, struct GNUNET_CREDENTIAL_Credential *cd)
Deserialize the given destination.
size_t GNUNET_CREDENTIAL_delegation_set_get_size(unsigned int ds_count, const struct GNUNET_CREDENTIAL_DelegationSet *dsr)
Calculate how many bytes we will need to serialize the given delegation record.
ssize_t GNUNET_CREDENTIAL_delegation_chain_serialize(unsigned int d_count, const struct GNUNET_CREDENTIAL_Delegation *dd, unsigned int c_count, const struct GNUNET_CREDENTIAL_Credential *cd, size_t dest_size, char *dest)
Serizalize the given delegation chain entries and credential.
int GNUNET_CREDENTIAL_delegation_set_deserialize(size_t len, const char *src, unsigned int d_count, struct GNUNET_CREDENTIAL_DelegationSet *dsr)
Deserialize the given destination.
size_t GNUNET_CREDENTIAL_credentials_get_size(unsigned int c_count, const struct GNUNET_CREDENTIAL_Credential *cd)
Calculate how many bytes we will need to serialize the credentials.
int GNUNET_CREDENTIAL_credentials_deserialize(size_t len, const char *src, unsigned int c_count, struct GNUNET_CREDENTIAL_Credential *cd)
Deserialize the given destination.
uint32_t data
The data value.
static size_t data_size
Number of bytes in data.
The attribute delegation record.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...