gnunet_revocation_service.h (4030B)
1 /* 2 This file is part of GNUnet 3 Copyright (C) 2013 GNUnet e.V. 4 5 GNUnet is free software: you can redistribute it and/or modify it 6 under the terms of the GNU Affero General Public License as published 7 by the Free Software Foundation, either version 3 of the License, 8 or (at your option) any later version. 9 10 GNUnet is distributed in the hope that it will be useful, but 11 WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Affero General Public License for more details. 14 15 You should have received a copy of the GNU Affero General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 SPDX-License-Identifier: AGPL3.0-or-later 19 */ 20 21 #ifndef GNUNET_REVOCATION_SERVICE_H_ 22 #define GNUNET_REVOCATION_SERVICE_H_ 23 24 25 #include "gnunet_gnsrecord_lib.h" 26 #include "gnunet_identity_service.h" 27 28 /** 29 * @addtogroup egos Ego management 30 * @{ 31 * 32 * @author Christian Grothoff 33 * 34 * @file 35 * API to perform and access key revocations 36 * 37 * @defgroup revocation Revocation service 38 * Perform and access key revocations. 39 * 40 * @see [Documentation](https://gnunet.org/revocation-subsystem) 41 * 42 * @{ 43 */ 44 45 #ifdef __cplusplus 46 extern "C" 47 { 48 #if 0 /* keep Emacsens' auto-indent happy */ 49 } 50 #endif 51 #endif 52 53 #include "gnunet_util_lib.h" 54 55 /** 56 * Version of the key revocation API. 57 */ 58 #define GNUNET_REVOCATION_VERSION 0x00000001 59 60 61 /** 62 * Handle for the key revocation query. 63 */ 64 struct GNUNET_REVOCATION_Query; 65 66 /** 67 * Callback to call with the result of a key revocation query. 68 * 69 * @param cls closure 70 * @param is_valid #GNUNET_NO of the key is/was revoked, 71 * #GNUNET_YES if the key is still valid, 72 * #GNUNET_SYSERR if we had trouble querying the service 73 * 74 */ 75 typedef void (*GNUNET_REVOCATION_Callback) (void *cls, 76 enum GNUNET_GenericReturnValue 77 is_valid); 78 79 80 /** 81 * Check if a key was revoked. 82 * 83 * @param cfg the configuration to use 84 * @param key key to check for revocation 85 * @param func function to call with the result of the check 86 * @param func_cls closure to pass to @a func 87 * @return handle to use in #GNUNET_REVOCATION_query_cancel to stop REVOCATION from invoking the callback 88 */ 89 struct GNUNET_REVOCATION_Query * 90 GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, 91 const struct GNUNET_CRYPTO_BlindablePublicKey *key, 92 GNUNET_REVOCATION_Callback func, void *func_cls); 93 94 95 /** 96 * Cancel key revocation check. 97 * 98 * @param q query to cancel 99 */ 100 void 101 GNUNET_REVOCATION_query_cancel (struct GNUNET_REVOCATION_Query *q); 102 103 104 /** 105 * Handle for the key revocation operation. 106 */ 107 struct GNUNET_REVOCATION_Handle; 108 109 110 /** 111 * Perform key revocation. 112 * 113 * @param cfg the configuration to use 114 * @param pow proof of work to use (should have been created by 115 * iteratively calling #GNUNET_CRYPTO_pow_round) 116 * @param func function to call with the result of the check 117 * (called with `is_valid` being #GNUNET_NO if 118 * the revocation worked). 119 * @param func_cls closure to pass to @a func 120 * @return handle to use in #GNUNET_REVOCATION_revoke_cancel to stop REVOCATION from invoking the callback 121 */ 122 struct GNUNET_REVOCATION_Handle * 123 GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, 124 const struct GNUNET_GNSRECORD_PowP *pow, 125 GNUNET_REVOCATION_Callback func, void *func_cls); 126 127 128 /** 129 * Cancel key revocation. 130 * 131 * @param h operation to cancel 132 */ 133 void 134 GNUNET_REVOCATION_revoke_cancel (struct GNUNET_REVOCATION_Handle *h); 135 136 137 #if 0 /* keep Emacsens' auto-indent happy */ 138 { 139 #endif 140 #ifdef __cplusplus 141 } 142 #endif 143 144 #endif /* GNUNET_REVOCATION_SERVICE_H_ */ 145 146 /** @} */ /* end of group revocation */ 147 148 /** @} */ /* end of group addition */