diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-28 20:23:19 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-28 20:23:19 +0100 |
commit | 62d3d352502f5b1d109b18456a87c704a70fcca5 (patch) | |
tree | 020ccf88cf701c29faa59a3f22650946e5d0eb2b /src/include/taler_util.h | |
parent | 2debf6c3f0462a4743484c0cde7c951940e5cd2a (diff) | |
download | exchange-62d3d352502f5b1d109b18456a87c704a70fcca5.tar.xz |
move coin validity test to libtalerutil
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r-- | src/include/taler_util.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h index ab5ee11df..5ee90a6cc 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -251,6 +251,47 @@ TALER_data_to_string_alloc (const void *buf, size_t size); +/* ****************** Coin crypto primitives ************* */ + +/** + * Public information about a coin (including the public key + * of the coin, the denomination key and the signature with + * the denomination key). + */ +struct TALER_CoinPublicInfo +{ + /** + * The coin's public key. + */ + struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub; + + /** + * Public key representing the denomination of the coin + * that is being deposited. + */ + struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub; + + /** + * (Unblinded) signature over @e coin_pub with @e denom_pub, + * which demonstrates that the coin is valid. + */ + struct GNUNET_CRYPTO_rsa_Signature *denom_sig; +}; + + +/** + * Check if a coin is valid; that is, whether the denomination key exists, + * is not expired, and the signature is correct. + * + * @param coin_public_info the coin public info to check for validity + * @return #GNUNET_YES if the coin is valid, + * #GNUNET_NO if it is invalid + * #GNUNET_SYSERROR if an internal error occured + */ +int +TALER_test_coin_valid (const struct TALER_CoinPublicInfo *coin_public_info); + + /* ****************** Refresh crypto primitives ************* */ /** |