aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h36
-rw-r--r--src/include/taler_exchange_service.h8
2 files changed, 41 insertions, 3 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 554cb1a26..71ad07712 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -2207,7 +2207,7 @@ TALER_CRYPTO_contract_encrypt_for_merge (
/**
- * Encrypt contract for the party that will
+ * Decrypt contract for the party that will
* merge it into a reserve.
*
* @param purse_pub public key of the purse
@@ -2226,6 +2226,40 @@ TALER_CRYPTO_contract_decrypt_for_merge (
struct TALER_PurseMergePrivateKeyP *merge_priv);
+/**
+ * Encrypt contract for transmission to a party that will
+ * pay for it.
+ *
+ * @param purse_pub public key of the purse
+ * @param contract_priv private key of the contract
+ * @param contract_terms contract terms to encrypt
+ * @param[out] econtract set to encrypted contract
+ * @param[out] econtract_size set to number of bytes in @a econtract
+ */
+void
+TALER_CRYPTO_contract_encrypt_for_deposit (
+ const struct TALER_PurseContractPublicKeyP *purse_pub,
+ const struct TALER_ContractDiffiePrivateP *contract_priv,
+ const json_t *contract_terms,
+ void **econtract,
+ size_t *econtract_size);
+
+
+/**
+ * Decrypt contract for the party that will pay for it.
+ *
+ * @param contract_priv private key of the contract
+ * @param econtract encrypted contract
+ * @param econtract_size number of bytes in @a econtract
+ * @return decrypted contract terms, or NULL on failure
+ */
+json_t *
+TALER_CRYPTO_contract_decrypt_for_deposit (
+ const struct TALER_ContractDiffiePrivateP *contract_priv,
+ const void *econtract,
+ size_t econtract_size);
+
+
/* **************** Helper-based RSA operations **************** */
/**
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 93f6816c7..3095ac2b8 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -4433,6 +4433,8 @@ struct TALER_EXCHANGE_PurseCreateMergeHandle;
* @param exchange the exchange hosting the reserve
* @param reserve_priv private key of the reserve
* @param purse_priv private key of the purse
+ * @param merge_priv private key of the merge capability
+ * @param contract_priv private key to get the contract
* @param contract_terms contract the purse is about
* @param upload_contract true to upload the contract
* @param purse_expiration when will the unmerged purse expire
@@ -4447,6 +4449,8 @@ TALER_EXCHANGE_purse_create_with_merge (
struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_ReservePrivateKeyP *reserve_priv,
const struct TALER_PurseContractPrivateKeyP *purse_priv,
+ const struct TALER_PurseMergePrivateKeyP *merge_priv,
+ const struct TALER_ContractDiffiePrivateP *contract_priv,
const json_t *contract_terms,
bool upload_contract,
struct GNUNET_TIME_Timestamp purse_expiration,
@@ -4459,11 +4463,11 @@ TALER_EXCHANGE_purse_create_with_merge (
/**
* Cancel #TALER_EXCHANGE_purse_create_with_merge() operation.
*
- * @param pch handle of the operation to cancel
+ * @param pcm handle of the operation to cancel
*/
void
TALER_EXCHANGE_purse_create_with_merge_cancel (
- struct TALER_EXCHANGE_PurseCreateMergeHandle *pch);
+ struct TALER_EXCHANGE_PurseCreateMergeHandle *pcm);
/**