summaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_parsing.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-29 15:45:05 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-29 15:45:05 +0100
commit4a27969e5e439fb0f277dcf9f0461817d83e36b4 (patch)
tree9dbcea3e7bb5723438a1817a9a8c840f55ce92f2 /src/mint/taler-mint-httpd_parsing.h
parenta284561298af60ade27eb18008f29ebf63ac62b7 (diff)
downloadexchange-4a27969e5e439fb0f277dcf9f0461817d83e36b4.tar.gz
exchange-4a27969e5e439fb0f277dcf9f0461817d83e36b4.tar.bz2
exchange-4a27969e5e439fb0f277dcf9f0461817d83e36b4.zip
make TALER_MINT_parse_json_data more expressive, add RSA types as well
Diffstat (limited to 'src/mint/taler-mint-httpd_parsing.h')
-rw-r--r--src/mint/taler-mint-httpd_parsing.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/mint/taler-mint-httpd_parsing.h b/src/mint/taler-mint-httpd_parsing.h
index 86205a070..f14090172 100644
--- a/src/mint/taler-mint-httpd_parsing.h
+++ b/src/mint/taler-mint-httpd_parsing.h
@@ -108,7 +108,19 @@ enum TALER_MINT_JsonNavigationCommand
* or -1 for any type).
* Params: (int, json_t **)
*/
- JNAV_RET_TYPED_JSON
+ JNAV_RET_TYPED_JSON,
+
+ /**
+ * Return a `struct GNUNET_CRYPTO_rsa_PublicKey` which was
+ * encoded as variable-size base32crockford encoded data.
+ */
+ JNAV_RET_RSA_PUBLIC_KEY,
+
+ /**
+ * Return a `struct GNUNET_CRYPTO_rsa_Signature` which was
+ * encoded as variable-size base32crockford encoded data.
+ */
+ JNAV_RET_RSA_SIGNATURE
};
@@ -230,15 +242,34 @@ TALER_MINT_release_parsed_data (struct GNUNET_MINT_ParseFieldSpec *spec);
* Generate line in parser specification for JSON array value.
*
* @param field name of the field
+ * @param ptraddr address of pointer to initialize (a `void **`)
*/
-#define TALER_MINT_PARSE_ARRAY(field) { field, NULL, 0, 0, JNAV_RET_TYPED_JSON, JSON_ARRAY }
+#define TALER_MINT_PARSE_ARRAY(field,ptraddr) { field, ptraddr, 0, 0, JNAV_RET_TYPED_JSON, JSON_ARRAY }
/**
* Generate line in parser specification for JSON object value.
*
* @param field name of the field
+ * @param ptraddr address of pointer to initialize (a `void **`)
*/
-#define TALER_MINT_PARSE_OBJECT(field) { field, NULL, 0, 0, JNAV_RET_TYPED_JSON, JSON_OBJECT }
+#define TALER_MINT_PARSE_OBJECT(field,ptraddr) { field, ptraddr, 0, 0, JNAV_RET_TYPED_JSON, JSON_OBJECT }
+
+/**
+ * Generate line in parser specification for RSA public key.
+ *
+ * @param field name of the field
+ * @param ptraddr address of `struct GNUNET_CRYPTO_rsa_PublicKey *` initialize
+ */
+#define TALER_MINT_PARSE_RSA_PUBLIC_KEY(field,ptrpk) { field, ptrpk, 0, 0, JNAV_RET_RSA_PUBLIC_KEY, 0 }
+
+/**
+ * Generate line in parser specification for RSA public key.
+ *
+ * @param field name of the field
+ * @param ptrsig address of `struct GNUNET_CRYPTO_rsa_Signature *` initialize
+ */
+#define TALER_MINT_PARSE_RSA_SIGNATURE(field,ptrsig) { field, ptrsig, 0, 0, JNAV_RET_RSA_SIGNATURE, 0 }
+
/**