diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-04-25 16:27:10 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-04-25 16:27:20 +0200 |
commit | 002b4bf117c73ad6fca1731e23b6816a0d2800c2 (patch) | |
tree | f0256a0b378b402c2c8762be6c33c93b2d640008 | |
parent | 0ab917d46cd3b4e73f3fe79e8b4a97236fc90ee5 (diff) | |
download | exchange-002b4bf117c73ad6fca1731e23b6816a0d2800c2.tar.gz exchange-002b4bf117c73ad6fca1731e23b6816a0d2800c2.tar.bz2 exchange-002b4bf117c73ad6fca1731e23b6816a0d2800c2.zip |
add token issue signature methods
-rw-r--r-- | src/include/taler_crypto_lib.h | 38 | ||||
-rw-r--r-- | src/util/tokens.c | 2 |
2 files changed, 36 insertions, 4 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 00f93c26d..e2f377448 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -2302,7 +2302,7 @@ struct TALER_TokenIssueBlindSignatureP /** * The public key of a token. An EdDSA public key generated by the wallet - * and blindly signed by the merchant using the @struct TALER_TokenIssuePrivateKey. + * and blindly signed by the merchant using the @struct TALER_TokenIssuePrivateKeyP. */ struct TALER_TokenUsePublicKeyP { @@ -2328,6 +2328,17 @@ struct TALER_TokenUseSignatureP struct GNUNET_CRYPTO_EddsaSignature signature; }; +/** + * The blinded token use public key of a token. Ready to be signed by the merchant. + */ +struct TALER_TokenEnvelopeP +{ + /** + * Blinded public key of the token. + */ + struct GNUNET_CRYPTO_BlindedMessage blinded_pub; +}; + /** * Free internals of @a issue_sig, but not @a issue_sig itself. @@ -3913,12 +3924,33 @@ TALER_merchant_refund_verify ( const struct TALER_MerchantSignatureP *merchant_sig); +/** + * Issue a new token by signing a token envelope, that contains the + * blinded public key provided by the wallet. + * + * @param envelope the token envelope to sign + * @param issue_priv token issue private key to sign with + * @param[out] blind_sig where to write the blinded issue signature + */ void -TALER_merchant_token_issue_sign (); +TALER_merchant_token_issue_sign ( + const struct TALER_TokenEnvelopeP *envelope, + const struct TALER_TokenIssuePrivateKeyP *issue_priv, + struct TALER_TokenIssueBlindSignatureP *blind_sig); +/** + * Verify a token issue signature. + * + * @param use_pub token use public key + * @param issue_pub token issue public key + * @param ub_sig unblinded signature + */ enum GNUNET_GenericReturnValue -TALER_merchant_token_issue_verify (); +TALER_merchant_token_issue_verify ( + const struct TALER_TokenUsePublicKeyP *use_pub, + const struct TALER_TokenIssuePublicKeyP *issue_pub, + const struct TALER_TokenIssueSignatureP *ub_sig); /* ********************* exchange deposit signing ************************* */ diff --git a/src/util/tokens.c b/src/util/tokens.c index 61fe40501..3086d8777 100644 --- a/src/util/tokens.c +++ b/src/util/tokens.c @@ -23,7 +23,7 @@ void -TALER_token_issue_sig_free (struct TALER_TokenIssueSignature *issue_sig) +TALER_token_issue_sig_free (struct TALER_TokenIssueSignatureP *issue_sig) { if (NULL != issue_sig->signature) { |