1 /* key-clean.h - Functions to clean a keyblock 2 * Copyright (C) 2018 Werner Koch 3 * 4 * This file is part of GnuPG. 5 * 6 * GnuPG is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * GnuPG is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, see <https://www.gnu.org/licenses/>. 18 * SPDX-License-Identifier: GPL-3.0-or-later 19 */ 20 21 #ifndef GNUPG_G10_KEY_CLEAN_H 22 #define GNUPG_G10_KEY_CLEAN_H 23 24 #include "gpg.h" 25 26 /* No explicit cleaning. */ 27 #define KEY_CLEAN_NONE 0 28 /* Remove only invalid subkeys (ie. missing key-bindings) */ 29 #define KEY_CLEAN_INVALID 1 30 /* Remove expired encryption keys */ 31 #define KEY_CLEAN_ENCR 2 32 /* Remove expired authentication and encryption keys. */ 33 #define KEY_CLEAN_AUTHENCR 3 34 /* Remove all expired subkeys. */ 35 #define KEY_CLEAN_ALL 4 36 37 38 void mark_usable_uid_certs (ctrl_t ctrl, kbnode_t keyblock, kbnode_t uidnode, 39 u32 *main_kid, struct key_item *klist, 40 u32 curtime, u32 *next_expire); 41 42 void clean_one_uid (ctrl_t ctrl, kbnode_t keyblock, kbnode_t uidnode, 43 int noisy, int self_only, 44 int *uids_cleaned, int *sigs_cleaned); 45 void clean_all_uids (ctrl_t ctrl, kbnode_t keyblock, int noisy, int self_only, 46 int *uids_cleaned,int *sigs_cleaned); 47 void clean_all_subkeys (ctrl_t ctrl, kbnode_t keyblock, 48 int noisy, int clean_level, 49 int *subkeys_cleaned, int *sigs_cleaned); 50 51 52 #endif /*GNUPG_G10_KEY_CLEAN_H*/ 53