From 3b0dadc28bb1d8b9849243fa9114603303f149ba Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 17 May 2015 17:28:18 +0200 Subject: add functions for conversion from json to rsa public key/signature for symmetry, testing, etc. --- src/include/taler_json_lib.h | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'src/include') diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index 2f0c54498..ede2a20ee 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -96,17 +96,6 @@ 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 * @@ -142,6 +131,27 @@ TALER_json_to_data (json_t *json, void *out, size_t out_size); + +/** + * Convert JSON to RSA public key. + * + * @param pk JSON encoding to convert + * @return corresponding public key + */ +struct GNUNET_CRYPTO_rsa_PublicKey * +TALER_json_to_rsa_public_key (json_t *json); + + +/** + * Convert JSON to RSA signature. + * + * @param pk JSON encoding to convert + * @return corresponding signature + */ +struct GNUNET_CRYPTO_rsa_Signature * +TALER_json_to_rsa_signature (json_t *json); + + /** * Check if the given wire format JSON object is correctly formatted * -- cgit v1.2.3