diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-04-30 22:28:08 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-04-30 22:28:08 +0200 |
commit | 4a3145fca389fca1bbfc7ba61b7cafd1156ef656 (patch) | |
tree | f95de17dcb3e20036dc3b6c0046cf5a2b18cc935 /src/include | |
parent | 5d9db0012144cbad9ba90b654fdfff17b55b6af9 (diff) |
work on tokens
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_merchant_service.h | 70 |
1 files changed, 65 insertions, 5 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index e3d65188..1907f88f 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -3091,20 +3091,41 @@ TALER_MERCHANT_order_claim_cancel (struct TALER_MERCHANT_OrderClaimHandle *och); */ struct TALER_MERCHANT_PrivateTokenDetails { + + /** + * Master secret used to derive the private key from. + */ + struct TALER_TokenUseMasterSecretP master; + /** * Private key of the token. */ struct TALER_TokenUsePrivateKeyP token_priv; /** + * Public key of the token. + */ + struct TALER_TokenUsePublicKeyP token_pub; + + /** + * Public key of the token. + */ + struct TALER_TokenUsePublicKeyHashP h_token_pub; + + /** + * Blinded public key of the token. + */ + struct TALER_TokenEnvelopeP envelope; + + /** * Value used to blind the key for the signature. */ union GNUNET_CRYPTO_BlindingSecretP blinding_secret; /** - * Unblinded token issue signature made by the merchant. + * Inputs needed from the merchant for blind signing. */ - struct TALER_TokenIssueSignatureP issue_sig; + struct TALER_TokenUseMerchantValues blinding_inputs; /** * Token issue public key. @@ -3112,9 +3133,14 @@ struct TALER_MERCHANT_PrivateTokenDetails struct TALER_TokenIssuePublicKeyP issue_pub; /** - * Inputs needed from the merchant for blind signing. + * Unblinded token issue signature made by the merchant. */ - struct GNUNET_CRYPTO_BlindingInputValues *blinding_inputs; + struct TALER_TokenIssueSignatureP issue_sig; + + /** + * Blinded token issue signature made by the merchant. + */ + struct TALER_TokenIssueBlindSignatureP blinded_sig; }; @@ -3164,7 +3190,7 @@ struct TALER_MERCHANT_PayResponse /** * Array of tokens that were issued for the payment. */ - struct TALER_MERCHANT_PrivateTokenDetails *tokens; + struct TALER_MERCHANT_OutputToken *tokens; /** * Length of the @e tokens array. @@ -3276,6 +3302,32 @@ struct TALER_MERCHANT_UsedToken /** + * Information the frontend forwards to the backend for an output token. The + * blinded issue signature is set once the request return with an HTTP_OK. + * This does not inlcude the blinding secret or any other private information. + */ +struct TALER_MERCHANT_OutputToken +{ + + /** + * Token envelope. + */ + struct TALER_TokenEnvelopeP envelope; + + /** + * Hash of the corresponding token issue public key. + */ + struct TALER_TokenIssuePublicKeyHashP h_issue; + + /** + * Blinded issue signature made by the merchant. + */ + struct TALER_TokenIssueBlindSignatureP blinded_sig; + +}; + + +/** * Pay a merchant. API for frontends talking to backends. Here, * the frontend does not have the coin's private keys, but just * the public keys and signatures. @@ -3292,6 +3344,8 @@ struct TALER_MERCHANT_UsedToken * @param coins array of coins to pay with * @param num_tokens length of the @a tokens array * @param tokens array of tokens used + * @param num_output_tokens length of the @a output_tokens array + * @param output_tokens array of output token to be issued by the merchant * @param pay_cb the callback to call when a reply for this request is available * @param pay_cb_cls closure for @a pay_cb * @return a handle for this request @@ -3307,6 +3361,8 @@ TALER_MERCHANT_order_pay_frontend ( const struct TALER_MERCHANT_PaidCoin coins[static num_coins], unsigned int num_tokens, const struct TALER_MERCHANT_UsedToken tokens[static num_tokens], + unsigned int num_output_tokens, + const struct TALER_MERCHANT_OutputToken output_tokens[static num_output_tokens], TALER_MERCHANT_OrderPayCallback pay_cb, void *pay_cb_cls); @@ -3407,6 +3463,8 @@ struct TALER_MERCHANT_UseToken * @param coins array of coins we use to pay * @param num_tokens number of tokens to used in this payment request * @param tokens array of tokens we use in this payment request + * @param num_output_tokens length of the @a output_tokens array + * @param output_tokens array of output tokens to be issued by the merchant * @param pay_cb the callback to call when a reply for this request is available * @param pay_cb_cls closure for @a pay_cb * @return a handle for this request @@ -3431,6 +3489,8 @@ TALER_MERCHANT_order_pay ( const struct TALER_MERCHANT_PayCoin coins[static num_coins], unsigned int num_tokens, const struct TALER_MERCHANT_UseToken tokens[static num_tokens], + unsigned int num_output_tokens, + const struct TALER_MERCHANT_OutputToken output_tokens[static num_output_tokens], TALER_MERCHANT_OrderPayCallback pay_cb, void *pay_cb_cls); |