diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-03-05 12:04:13 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-03-05 12:04:13 +0100 |
commit | 43f8ab6b48d6a51988c85fdc1bcd4f9d4f1a7a01 (patch) | |
tree | 0e419a57c85b8066696e17793ea4d5a4b9e819a8 /src/include | |
parent | 4835ddf60b80a720657d42e2de57a79f258328cd (diff) |
add signing/verifying functions for global fees
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 37 | ||||
-rw-r--r-- | src/include/taler_signatures.h | 36 |
2 files changed, 73 insertions, 0 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index d81f5a71..1beada69 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -3271,6 +3271,43 @@ TALER_exchange_offline_wire_fee_verify ( /** + * Create global fees signature. + * + * @param start_time when do the fees start to apply + * @param end_time when do the fees start to apply + * @param fees the global fees + * @param master_priv private key to sign with + * @param[out] master_sig where to write the signature + */ +void +TALER_exchange_offline_global_fee_sign ( + struct GNUNET_TIME_Timestamp start_time, + struct GNUNET_TIME_Timestamp end_time, + const struct TALER_GlobalFeeSet *fees, + const struct TALER_MasterPrivateKeyP *master_priv, + struct TALER_MasterSignatureP *master_sig); + + +/** + * Verify global fees signature. + * + * @param start_time when do the fees start to apply + * @param end_time when do the fees start to apply + * @param fees the global fees + * @param master_pub public key to verify against + * @param master_sig the signature the signature + * @return #GNUNET_OK if the signature is valid + */ +enum GNUNET_GenericReturnValue +TALER_exchange_offline_global_fee_verify ( + struct GNUNET_TIME_Timestamp start_time, + struct GNUNET_TIME_Timestamp end_time, + const struct TALER_GlobalFeeSet *fees, + const struct TALER_MasterPublicKeyP *master_pub, + const struct TALER_MasterSignatureP *master_sig); + + +/** * Create wire account addition signature. * * @param payto_uri bank account diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index 3758792a..ed985938 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -57,6 +57,12 @@ #define TALER_SIGNATURE_MASTER_ADD_WIRE 1021 /** + * Signature over global set of fees charged by the + * exchange. + */ +#define TALER_SIGNATURE_MASTER_GLOBAL_FEES 1022 + +/** * Remove payto URI from the list of our wire methods. */ #define TALER_SIGNATURE_MASTER_DEL_WIRE 1023 @@ -1251,6 +1257,36 @@ struct TALER_MasterWireFeePS /** + * Global fees charged by the exchange independent of + * denomination or wire method. + */ +struct TALER_MasterGlobalFeePS +{ + + /** + * Purpose is #TALER_SIGNATURE_MASTER_GLOBAL_FEES. + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + + /** + * Start date when the fee goes into effect. + */ + struct GNUNET_TIME_TimestampNBO start_date; + + /** + * End date when the fee stops being in effect (exclusive) + */ + struct GNUNET_TIME_TimestampNBO end_date; + + /** + * Fee charged to the merchant per wire transfer. + */ + struct TALER_GlobalFeeSetNBOP fees; + +}; + + +/** * @brief Message confirming that a denomination key was revoked. */ struct TALER_MasterDenominationKeyRevocationPS |