50 if (0 ==
cred->subject_attribute_len)
53 "%s.%s -> %s | %s | %" SCNu64,
55 cred->issuer_attribute,
58 cred->expiration.abs_value_us);
63 "%s.%s -> %s.%s | %s | %" SCNu64,
65 cred->issuer_attribute,
67 cred->subject_attribute,
69 cred->expiration.abs_value_us);
79#define KEY_LEN_ENC (260 / 5)
87 char iss_attr[253 + 1];
89 char sub_attr[253 + 1] =
"";
98 "%58s.%253s -> %58s.%253s | %s | %" SCNu64,
108 "%58s.%253s -> %58s | %s | %" SCNu64,
116 "Unable to parse DEL record string `%s'\n",
123 if (strcmp (sub_attr,
"") == 0)
125 attr_len = strlen (iss_attr) + 1;
129 attr_len = strlen (iss_attr) + strlen (sub_attr) + 2;
134 char tmp_str[attr_len];
136 if (strcmp (sub_attr,
"") != 0)
138 tmp_str[strlen (iss_attr)] =
'\0';
143 tmp_str[attr_len - 1] =
'\0';
171 if (strcmp (sub_attr,
"") == 0)
200 const char *iss_attr,
201 const char *sub_attr,
209 if (NULL == sub_attr)
212 attr_len = strlen (iss_attr) + 1;
217 attr_len = strlen (iss_attr) + strlen (sub_attr) + 2;
222 char tmp_str[attr_len];
224 if (NULL != sub_attr)
226 tmp_str[strlen (iss_attr)] =
'\0';
231 tmp_str[attr_len - 1] =
'\0';
240 del->issuer_attribute_len = htonl (strlen (iss_attr) + 1);
241 if (NULL == sub_attr)
243 del->subject_attribute_len = htonl (0);
247 del->subject_attribute_len = htonl (strlen (sub_attr) + 1);
266 if (NULL == sub_attr)
IPC messages between ABD API and ABD service.
char * GNUNET_ABD_delegate_to_string(const struct GNUNET_ABD_Delegate *cred)
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_from_string(const char *s)
Delegate helper functions.
struct GNUNET_CRYPTO_PublicKey issuer_pkey
Issuer key.
static char * subject
Subject pubkey string.
struct GNUNET_CRYPTO_PublicKey subject_pkey
Subject key.
static gnutls_certificate_credentials_t cred
The credential.
static struct GNUNET_TIME_Relative expiration
User supplied expiration value.
static int del
Desired action is to remove a record.
API to the Credential service.
#define GNUNET_SIGNATURE_PURPOSE_DELEGATE
Signature for a GNUnet credential (Reclaim)
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_issue(const struct GNUNET_CRYPTO_PrivateKey *issuer, struct GNUNET_CRYPTO_PublicKey *subject, const char *iss_attr, const char *sub_attr, struct GNUNET_TIME_Absolute *expiration)
Issue an attribute to a subject.
#define GNUNET_log(kind,...)
char * GNUNET_CRYPTO_public_key_to_string(const struct GNUNET_CRYPTO_PublicKey *key)
Creates a (Base32) string representation of the public key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_key_get_public(const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key)
Retrieves the public key representation of a private key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_sign_(const struct GNUNET_CRYPTO_PrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_Signature *sig)
Sign a given block.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_public_key_from_string(const char *str, struct GNUNET_CRYPTO_PublicKey *key)
Parses a (Base32) string representation of the public key.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_ERROR
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
size_t GNUNET_STRINGS_base64_decode(const char *data, size_t len, void **output)
Decode from Base64.
size_t GNUNET_STRINGS_base64_encode(const void *in, size_t len, char **output)
Encode into Base64.
static unsigned int size
Size of the "table".
const char * subject_attribute
The subject attribute.
const char * issuer_attribute
The issuer attribute.
uint32_t issuer_attribute_len
Length of the issuer attribute.
uint32_t subject_attribute_len
Length of the subject attribute.
struct GNUNET_CRYPTO_Signature signature
Signature of this credential.
struct GNUNET_CRYPTO_PublicKey issuer_key
The issuer of the credential.
struct GNUNET_TIME_Absolute expiration
Expiration of this credential.
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this credential was issued to.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
An identity signature as per LSD0001.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.