diff options
Diffstat (limited to 'src/include')
-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 ************* */ /** |