summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-06 16:52:14 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-06 16:52:14 +0100
commit8175fdfa0f47e74e239190e809eff4dda5565a76 (patch)
treeb8d46fe55fc9de418953eae23bc12f35295f4ba1 /src/include
parent938e2ce39c56ae5afc6c12f15be8f49c7edbf2fd (diff)
downloadexchange-8175fdfa0f47e74e239190e809eff4dda5565a76.tar.gz
exchange-8175fdfa0f47e74e239190e809eff4dda5565a76.tar.bz2
exchange-8175fdfa0f47e74e239190e809eff4dda5565a76.zip
introduce TALER_wallet_deposit_verify
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 6bb4a50e2..881e368ee 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -1549,6 +1549,68 @@ TALER_CRYPTO_helper_esign_disconnect (
/* ********************* wallet signing ************************** */
+
+/**
+ * Sign a deposit permission. Function for wallets.
+ *
+ * @param amount the amount to be deposited
+ * @param deposit_fee the deposit fee we expect to pay
+ * @param h_wire hash of the merchant’s account details
+ * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
+ * @param h_extensions hash over the extensions
+ * @param h_denom_pub hash of the coin denomination's public key
+ * @param coin_priv coin’s private key
+ * @param wallet_timestamp timestamp when the contract was finalized, must not be too far in the future
+ * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
+ * @param refund_deadline date until which the merchant can issue a refund to the customer via the exchange (can be zero if refunds are not allowed); must not be after the @a wire_deadline
+ * @param[out] coin_sig set to the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_DEPOSIT
+ */
+void
+TALER_wallet_deposit_sign (
+ const struct TALER_Amount *amount,
+ const struct TALER_Amount *deposit_fee,
+ const struct TALER_MerchantWireHash *h_wire,
+ const struct TALER_PrivateContractHash *h_contract_terms,
+ const struct TALER_ExtensionContractHash *h_extensions,
+ const struct TALER_DenominationHash *h_denom_pub,
+ struct GNUNET_TIME_Absolute wallet_timestamp,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ struct GNUNET_TIME_Absolute refund_deadline,
+ const struct TALER_CoinSpendPrivateKeyP *coin_priv,
+ struct TALER_CoinSpendSignatureP *coin_sig);
+
+
+/**
+ * Verify a deposit permission.
+ *
+ * @param amount the amount to be deposited
+ * @param deposit_fee the deposit fee we expect to pay
+ * @param h_wire hash of the merchant’s account details
+ * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
+ * @param h_extensions hash over the extensions
+ * @param h_denom_pub hash of the coin denomination's public key
+ * @param wallet_timestamp timestamp when the contract was finalized, must not be too far in the future
+ * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
+ * @param refund_deadline date until which the merchant can issue a refund to the customer via the exchange (can be zero if refunds are not allowed); must not be after the @a wire_deadline
+ * @param coin_pub coin’s public key
+ * @param coin_sig the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_DEPOSIT
+ * @return #GNUNET_OK if the signature is valid
+ */
+enum GNUNET_GenericReturnValue
+TALER_wallet_deposit_verify (
+ const struct TALER_Amount *amount,
+ const struct TALER_Amount *deposit_fee,
+ const struct TALER_MerchantWireHash *h_wire,
+ const struct TALER_PrivateContractHash *h_contract_terms,
+ const struct TALER_ExtensionContractHash *h_extensions,
+ const struct TALER_DenominationHash *h_denom_pub,
+ struct GNUNET_TIME_Absolute wallet_timestamp,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ struct GNUNET_TIME_Absolute refund_deadline,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_CoinSpendSignatureP *coin_sig);
+
+
/**
* Sign link data.
*