summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-12-21 14:04:43 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-12-21 14:04:43 +0100
commitdf6eda3994236a29f961d473308c44d5fb85e187 (patch)
tree804b50f7426325fe14ec02280145dda8f3d1e8ba /src/include
parent7d8d8b2e8a2a1c8737b805c63c83ae9892c7bab9 (diff)
downloadexchange-df6eda3994236a29f961d473308c44d5fb85e187.tar.gz
exchange-df6eda3994236a29f961d473308c44d5fb85e187.tar.bz2
exchange-df6eda3994236a29f961d473308c44d5fb85e187.zip
Provide test API for keys serialization.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_testing_lib.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index bdd035107..40b1d6b9c 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -1436,6 +1436,14 @@ TALER_TESTING_cmd_is_batch (const struct TALER_TESTING_Command *cmd);
struct TALER_TESTING_Command *
TALER_TESTING_cmd_batch_get_current (const struct TALER_TESTING_Command *cmd);
+/**
+ * Make a serialize-keys CMD.
+ *
+ * @param label CMD label
+ * @return the CMD.
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_serialize_keys (const char *label);
/* *** Generic trait logic for implementing traits ********* */
@@ -1914,6 +1922,36 @@ TALER_TESTING_make_trait_wire_details
(unsigned int index,
const json_t *wire_details);
+
+/**
+ * Obtain serialized exchange keys from @a cmd.
+ *
+ * @param cmd command to extract the keys from.
+ * @param index index number associate with the keys on offer.
+ * @param keys[out] where to write the serialized keys.
+ * @return #GNUNET_OK on success.
+ */
+int
+TALER_TESTING_get_trait_exchange_keys
+ (const struct TALER_TESTING_Command *cmd,
+ unsigned int index,
+ const json_t **keys);
+
+
+/**
+ * Offer serialized keys in a trait.
+ *
+ * @param index index number associate with the serial keys
+ * on offer.
+ * @param keys serialized keys to offer.
+ * @return the trait.
+ */
+struct TALER_TESTING_Trait
+TALER_TESTING_make_trait_exchange_keys
+ (unsigned int index,
+ const json_t *keys);
+
+
/**
* Obtain a private key from a "peer". Used e.g. to obtain
* a merchant's priv to sign a /track request.