From 579f465c9b2ed1cd4602ee102073d633fda60cb9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 9 Mar 2015 12:29:41 +0100 Subject: implementing #3632: generate proof of insufficient funds by converting transaction history to JSON --- src/include/taler_json_lib.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/include/taler_json_lib.h') diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index f0ae923f4..2b9d51875 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -60,8 +60,20 @@ TALER_JSON_from_abs (struct GNUNET_TIME_Absolute stamp); * @return the JSON reporesentation of the signature with purpose */ json_t * -TALER_JSON_from_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, - const struct GNUNET_CRYPTO_EddsaSignature *signature); +TALER_JSON_from_eddsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, + const struct GNUNET_CRYPTO_EddsaSignature *signature); + + +/** + * Convert a signature (with purpose) to a JSON object representation. + * + * @param purpose purpose of the signature + * @param signature the signature + * @return the JSON reporesentation of the signature with purpose + */ +json_t * +TALER_JSON_from_ecdsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, + const struct GNUNET_CRYPTO_EcdsaSignature *signature); /** @@ -76,6 +88,17 @@ json_t * TALER_JSON_from_data (const void *data, size_t size); +/** + * Convert binary hash to a JSON string with the base32crockford + * encoding. + * + * @param hc binary data + * @return json string that encodes @a hc + */ +json_t * +TALER_JSON_from_hash (const struct GNUNET_HashCode *hc); + + /** * Parse given JSON object to Amount * @@ -119,7 +142,8 @@ TALER_JSON_to_data (json_t *json, * @return 1 if correctly formatted; 0 if not */ int -TALER_JSON_validate_wireformat (const char *type, json_t *wire); +TALER_JSON_validate_wireformat (const char *type, + json_t *wire); #endif /* TALER_JSON_LIB_H_ */ -- cgit v1.2.3