From 8f6e911308c717ffbd9bc1a2f955ffc42c6ea784 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 21 Jun 2015 20:43:54 +0200 Subject: -implement signature checking on /deposit --- src/mint-lib/mint_api_handle.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/mint-lib/mint_api_handle.c') diff --git a/src/mint-lib/mint_api_handle.c b/src/mint-lib/mint_api_handle.c index abd4d0db..530cd606 100644 --- a/src/mint-lib/mint_api_handle.c +++ b/src/mint-lib/mint_api_handle.c @@ -752,7 +752,7 @@ TALER_MINT_disconnect (struct TALER_MINT_Handle *mint) * @return sk current online signing key for the mint, NULL on error */ const struct TALER_MintPublicKeyP * -TALER_MINT_get_signing_key (struct TALER_MINT_Keys *keys) +TALER_MINT_get_signing_key (const struct TALER_MINT_Keys *keys) { struct GNUNET_TIME_Absolute now; unsigned int i; @@ -766,4 +766,38 @@ TALER_MINT_get_signing_key (struct TALER_MINT_Keys *keys) } +/** + * Obtain the denomination key details from the mint. + * + * @param keys the mint's key set + * @param pk public key of the denomination to lookup + * @return details about the given denomination key + */ +const struct TALER_MINT_DenomPublicKey * +TALER_MINT_get_denomination_key (const struct TALER_MINT_Keys *keys, + const struct TALER_DenominationPublicKey *pk) +{ + unsigned int i; + + for (i=0;inum_denom_keys;i++) + if (0 == GNUNET_CRYPTO_rsa_public_key_cmp (pk->rsa_public_key, + keys->denom_keys[i].key.rsa_public_key)) + return &keys->denom_keys[i]; + return NULL; +} + + +/** + * Obtain the keys from the mint. + * + * @param mint the mint handle + * @return the mint's key set + */ +const struct TALER_MINT_Keys * +TALER_MINT_get_keys (const struct TALER_MINT_Handle *mint) +{ + return &mint->key_data; +} + + /* end of mint_api_handle.c */ -- cgit v1.2.3