aboutsummaryrefslogtreecommitdiff
path: root/src/json
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-03-19 19:16:35 +0100
committerChristian Grothoff <christian@grothoff.org>2016-03-19 19:16:35 +0100
commit737e3f4bf67a2048381785328206c595bffe632a (patch)
treeb9c0a93fc43d1e6cd5c0dbd14ff53d0ee2d29fee /src/json
parent3d5e096fa24a2d11873d7e09a0b994a00882325d (diff)
refactor to eliminate duplicated JSON parsing logic (#4150)
Diffstat (limited to 'src/json')
-rw-r--r--src/json/json_helper.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index b61fe21a6..7eaaa441a 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -143,4 +143,36 @@ TALER_JSON_spec_amount (const char *name,
}
+/**
+ * Generate line in parser specification for denomination public key.
+ *
+ * @param field name of the field
+ * @param[out] pk key to initialize
+ * @return corresponding field spec
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_denomination_public_key (const char *field,
+ struct TALER_DenominationPublicKey *pk)
+{
+ return GNUNET_JSON_spec_rsa_public_key (field,
+ &pk->rsa_public_key);
+}
+
+
+/**
+ * Generate line in parser specification for denomination signature.
+ *
+ * @param field name of the field
+ * @param sig the signature to initialize
+ * @return corresponding field spec
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_denomination_signature (const char *field,
+ struct TALER_DenominationSignature *sig)
+{
+ return GNUNET_JSON_spec_rsa_signature (field,
+ &sig->rsa_signature);
+}
+
+
/* end of json/json_helper.c */