diff options
Diffstat (limited to 'src/mint-lib/mint_api_handle.c')
-rw-r--r-- | src/mint-lib/mint_api_handle.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/mint-lib/mint_api_handle.c b/src/mint-lib/mint_api_handle.c index abd4d0db7..530cd6062 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;i<keys->num_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 */ |