exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

iterate_active_signkeys.h (3013B)


      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 typedef void
     38 (*TALER_EXCHANGEDB_ActiveSignkeysCallback)(
     39   void *cls,
     40   const struct TALER_ExchangePublicKeyP *exchange_pub,
     41   const struct TALER_EXCHANGEDB_SignkeyMetaData *meta,
     42   const struct TALER_MasterSignatureP *master_sig);
     43 
     44 
     45 /* Callback typedefs */
     46 /**
     47  * Signature of a function called with information about the exchange's
     48  * online signing keys.
     49  *
     50  * @param cls closure with a `struct TEH_KeyStateHandle *`
     51  * @param exchange_pub public key of the exchange
     52  * @param meta meta data information about the signing type (expirations)
     53  * @param master_sig master signature affirming the validity of this denomination
     54  */
     55 typedef void
     56 (*TALER_EXCHANGEDB_ActiveSignkeysCallback)(
     57   void *cls,
     58   const struct TALER_ExchangePublicKeyP *exchange_pub,
     59   const struct TALER_EXCHANGEDB_SignkeyMetaData *meta,
     60   const struct TALER_MasterSignatureP *master_sig);
     61 
     62 /**
     63  * Function called to invoke @a cb on every non-revoked exchange signing key
     64  * that has been signed by the master key.  Revoked and (for signing!)
     65  * expired keys are skipped. Runs in its own read-only transaction.
     66  *
     67  * @param pg the database context
     68  * @param cb function to call on each signing key
     69  * @param cb_cls closure for @a cb
     70  * @return transaction status code
     71  */
     72 enum GNUNET_DB_QueryStatus
     73 TALER_EXCHANGEDB_iterate_active_signkeys (struct
     74                                           TALER_EXCHANGEDB_PostgresContext *pg,
     75                                           TALER_EXCHANGEDB_ActiveSignkeysCallback
     76                                           cb,
     77                                           void *cb_cls);
     78 
     79 #endif