summaryrefslogtreecommitdiffstats
path: root/kbx/keybox-search-desc.h
blob: 84be20f1817e6da4741ff9437560d8e5e9707206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* keybox-search-desc.h - Keybox serch description
 *	Copyright (C) 2001 Free Software Foundation, Inc.
 *
 * This file is part of GnuPG.
 *
 * GnuPG is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GnuPG is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

/* 
   This file is a temporary kludge until we can come up with solution
   to share this description between keybox and the application
   specific keydb
*/

#ifndef KEYBOX_SEARCH_DESC_H
#define KEYBOX_SEARCH_DESC_H 1

typedef enum {
  KEYDB_SEARCH_MODE_NONE,
  KEYDB_SEARCH_MODE_EXACT,
  KEYDB_SEARCH_MODE_SUBSTR,
  KEYDB_SEARCH_MODE_MAIL,
  KEYDB_SEARCH_MODE_MAILSUB,
  KEYDB_SEARCH_MODE_MAILEND,
  KEYDB_SEARCH_MODE_WORDS,
  KEYDB_SEARCH_MODE_SHORT_KID,
  KEYDB_SEARCH_MODE_LONG_KID,
  KEYDB_SEARCH_MODE_FPR16,
  KEYDB_SEARCH_MODE_FPR20,
  KEYDB_SEARCH_MODE_FPR,
  KEYDB_SEARCH_MODE_ISSUER,
  KEYDB_SEARCH_MODE_ISSUER_SN,
  KEYDB_SEARCH_MODE_SN,
  KEYDB_SEARCH_MODE_SUBJECT,
  KEYDB_SEARCH_MODE_FIRST,
  KEYDB_SEARCH_MODE_NEXT
} KeydbSearchMode;

struct keydb_search_desc {
  KeydbSearchMode mode;
  int (*skipfnc)(void *,void*); /* used to be: void*, u32* */
  void *skipfncvalue;
  const unsigned char *sn; 
  int sn_is_string;  /* very ugly */
  union {
    const char *name;
    unsigned char fpr[24];
    unsigned char kid[8]; 
  } u;
};


struct keydb_search_desc;
typedef struct keydb_search_desc KEYDB_SEARCH_DESC;

typedef struct keydb_search_desc KEYBOX_SEARCH_DESC;



#endif /*KEYBOX_SEARCH_DESC_H*/