chiark / gitweb /
gnupg2 (2.1.17-3) unstable; urgency=medium
[gnupg2.git] / g10 / keyring.h
1 /* keyring.h - Keyring operations
2  *      Copyright (C) 2001 Free Software Foundation, Inc.
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  */
19
20 #ifndef GPG_KEYRING_H
21 #define GPG_KEYRING_H 1
22
23 #include "../common/userids.h"
24
25 typedef struct keyring_handle *KEYRING_HANDLE;
26
27 int keyring_register_filename (const char *fname, int read_only, void **ptr);
28 int keyring_is_writable (void *token);
29
30 KEYRING_HANDLE keyring_new (void *token);
31 void keyring_release (KEYRING_HANDLE hd);
32 void keyring_push_found_state (KEYRING_HANDLE hd);
33 void keyring_pop_found_state (KEYRING_HANDLE hd);
34 const char *keyring_get_resource_name (KEYRING_HANDLE hd);
35 int keyring_lock (KEYRING_HANDLE hd, int yes);
36 int keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb);
37 int keyring_update_keyblock (KEYRING_HANDLE hd, KBNODE kb);
38 int keyring_insert_keyblock (KEYRING_HANDLE hd, KBNODE kb);
39 int keyring_delete_keyblock (KEYRING_HANDLE hd);
40 int keyring_search_reset (KEYRING_HANDLE hd);
41 int keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
42                     size_t ndesc, size_t *descindex, int skip_legacy);
43 int keyring_rebuild_cache (void *token,int noisy);
44
45 #endif /*GPG_KEYRING_H*/