iterate_active_signkeys.h (3385B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file src/include/exchange-database/iterate_active_signkeys.h 18 * @brief implementation of the iterate_active_signkeys function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_ITERATE_ACTIVE_SIGNKEYS_H 22 #define EXCHANGE_DATABASE_ITERATE_ACTIVE_SIGNKEYS_H 23 24 #include "taler/taler_json_lib.h" 25 #include "exchangedb_lib.h" 26 27 28 /** 29 * Signature of a function called with information about the exchange's 30 * online signing keys. 31 * 32 * @param cls closure with a `struct TEH_KeyStateHandle *` 33 * @param exchange_pub public key of the exchange 34 * @param meta meta data information about the signing type (expirations) 35 * @param master_sig master signature affirming the validity of this denomination 36 */ 37 #ifndef TALER_EXCHANGEDB_ACTIVE_SIGNKEYS_RESULT_CLOSURE 38 /** 39 * Type of the closure for #TALER_EXCHANGEDB_ActiveSignkeysCallback. 40 */ 41 #define TALER_EXCHANGEDB_ACTIVE_SIGNKEYS_RESULT_CLOSURE void 42 #endif 43 typedef void 44 (*TALER_EXCHANGEDB_ActiveSignkeysCallback)( 45 TALER_EXCHANGEDB_ACTIVE_SIGNKEYS_RESULT_CLOSURE *cls, 46 const struct TALER_ExchangePublicKeyP *exchange_pub, 47 const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, 48 const struct TALER_MasterSignatureP *master_sig); 49 50 51 /* Callback typedefs */ 52 /** 53 * Signature of a function called with information about the exchange's 54 * online signing keys. 55 * 56 * @param cls closure with a `struct TEH_KeyStateHandle *` 57 * @param exchange_pub public key of the exchange 58 * @param meta meta data information about the signing type (expirations) 59 * @param master_sig master signature affirming the validity of this denomination 60 */ 61 typedef void 62 (*TALER_EXCHANGEDB_ActiveSignkeysCallback)( 63 TALER_EXCHANGEDB_ACTIVE_SIGNKEYS_RESULT_CLOSURE *cls, 64 const struct TALER_ExchangePublicKeyP *exchange_pub, 65 const struct TALER_EXCHANGEDB_SignkeyMetaData *meta, 66 const struct TALER_MasterSignatureP *master_sig); 67 68 /** 69 * Function called to invoke @a cb on every non-revoked exchange signing key 70 * that has been signed by the master key. Revoked and (for signing!) 71 * expired keys are skipped. Runs in its own read-only transaction. 72 * 73 * @param pg the database context 74 * @param cb function to call on each signing key 75 * @param cb_cls closure for @a cb 76 * @return transaction status code 77 */ 78 enum GNUNET_DB_QueryStatus 79 TALER_EXCHANGEDB_iterate_active_signkeys (struct 80 TALER_EXCHANGEDB_PostgresContext *pg, 81 TALER_EXCHANGEDB_ActiveSignkeysCallback 82 cb, 83 TALER_EXCHANGEDB_ACTIVE_SIGNKEYS_RESULT_CLOSURE 84 *cb_cls); 85 86 #endif