+ GNUNET_free (subject_pkey);
+ return attr_str;
+ }
+ case GNUNET_GNSRECORD_TYPE_CREDENTIAL:
+ {
+ struct GNUNET_CREDENTIAL_CredentialRecordData cred;
+ struct GNUNET_TIME_Absolute etime_abs;
+ char *cred_str;
+ char *subject_pkey;
+ char *issuer_pkey;
+ char *signature;
+ const char *expiration;
+
+
+ if (data_size < sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData))
+ return NULL; /* malformed */
+ memcpy (&cred,
+ data,
+ sizeof (cred));
+ cdata = data;
+ subject_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.subject_key);
+ issuer_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.issuer_key);
+ etime_abs.abs_value_us = GNUNET_ntohll(cred.expiration);
+ expiration = GNUNET_STRINGS_absolute_time_to_string (etime_abs);
+ GNUNET_STRINGS_base64_encode ((char*)&cred.signature,
+ sizeof (struct GNUNET_CRYPTO_EcdsaSignature),
+ &signature);
+ GNUNET_asprintf (&cred_str,
+ "%s.%s -> %s | %s | %s",
+ issuer_pkey,
+ &cdata[sizeof (cred)],
+ subject_pkey,
+ signature,
+ expiration);
+ GNUNET_free (subject_pkey);
+ GNUNET_free (issuer_pkey);
+ GNUNET_free (signature);
+ return cred_str;
+ }
+ default:
+ return NULL;