summaryrefslogtreecommitdiff
path: root/src/exchange-lib/exchange_api_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange-lib/exchange_api_common.c')
-rw-r--r--src/exchange-lib/exchange_api_common.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/exchange-lib/exchange_api_common.c b/src/exchange-lib/exchange_api_common.c
index de05348f3..6b0aa6ff6 100644
--- a/src/exchange-lib/exchange_api_common.c
+++ b/src/exchange-lib/exchange_api_common.c
@@ -325,4 +325,29 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
}
+/**
+ * Obtain meta data about an exchange (online) signing
+ * key.
+ *
+ * @param keys from where to obtain the meta data
+ * @param exchange_pub public key to lookup
+ * @return NULL on error (@a exchange_pub not known)
+ */
+const struct TALER_EXCHANGE_SigningPublicKey *
+TALER_EXCHANGE_get_exchange_signing_key_info (const struct TALER_EXCHANGE_Keys *keys,
+ const struct TALER_ExchangePublicKeyP *exchange_pub)
+{
+ for (unsigned int i=0;i<keys->num_sign_keys;i++)
+ {
+ const struct TALER_EXCHANGE_SigningPublicKey *spk;
+
+ spk = &keys->sign_keys[i];
+ if (0 == memcmp (exchange_pub,
+ &spk->key,
+ sizeof (struct TALER_ExchangePublicKeyP)))
+ return spk;
+ }
+ return NULL;
+}
+
/* end of exchange_api_common.c */