agent/
[gnupg.git] / kbx / keybox-search-desc.h
blob98d81350724d74c96fbdd27d140e3f3a43abc9b4
1 /* keybox-search-desc.h - Keybox serch description
2 * Copyright (C) 2001 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 /*
21 This file is a temporary kludge until we can come up with solution
22 to share this description between keybox and the application
23 specific keydb
26 #ifndef KEYBOX_SEARCH_DESC_H
27 #define KEYBOX_SEARCH_DESC_H 1
29 typedef enum {
30 KEYDB_SEARCH_MODE_NONE,
31 KEYDB_SEARCH_MODE_EXACT,
32 KEYDB_SEARCH_MODE_SUBSTR,
33 KEYDB_SEARCH_MODE_MAIL,
34 KEYDB_SEARCH_MODE_MAILSUB,
35 KEYDB_SEARCH_MODE_MAILEND,
36 KEYDB_SEARCH_MODE_WORDS,
37 KEYDB_SEARCH_MODE_SHORT_KID,
38 KEYDB_SEARCH_MODE_LONG_KID,
39 KEYDB_SEARCH_MODE_FPR16,
40 KEYDB_SEARCH_MODE_FPR20,
41 KEYDB_SEARCH_MODE_FPR,
42 KEYDB_SEARCH_MODE_ISSUER,
43 KEYDB_SEARCH_MODE_ISSUER_SN,
44 KEYDB_SEARCH_MODE_SN,
45 KEYDB_SEARCH_MODE_SUBJECT,
46 KEYDB_SEARCH_MODE_KEYGRIP,
47 KEYDB_SEARCH_MODE_FIRST,
48 KEYDB_SEARCH_MODE_NEXT
49 } KeydbSearchMode;
51 struct keydb_search_desc {
52 KeydbSearchMode mode;
53 int (*skipfnc)(void *,void*); /* used to be: void*, u32* */
54 void *skipfncvalue;
55 const unsigned char *sn;
56 int snlen; /* -1 := sn is a hex string */
57 union {
58 const char *name;
59 unsigned char fpr[24];
60 unsigned char kid[8];
61 unsigned char grip[20];
62 } u;
66 struct keydb_search_desc;
67 typedef struct keydb_search_desc KEYDB_SEARCH_DESC;
69 typedef struct keydb_search_desc KEYBOX_SEARCH_DESC;
73 #endif /*KEYBOX_SEARCH_DESC_H*/