~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to kbx/keybox.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Mueller
  • Date: 2005-03-29 10:30:32 UTC
  • Revision ID: james.westby@ubuntu.com-20050329103032-sj42n2ain3ipx310
Tags: upstream-1.9.15
ImportĀ upstreamĀ versionĀ 1.9.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* keybox.h - Keybox operations
 
2
 *      Copyright (C) 2001, 2003 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 2 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, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
19
 */
 
20
 
 
21
#ifndef KEYBOX_H
 
22
#define KEYBOX_H 1
 
23
#ifdef __cplusplus
 
24
extern "C" { 
 
25
#if 0
 
26
 }
 
27
#endif
 
28
#endif
 
29
 
 
30
#include "keybox-search-desc.h"
 
31
 
 
32
#define KEYBOX_WITH_OPENPGP 1 
 
33
#define KEYBOX_WITH_X509 1
 
34
 
 
35
 
 
36
#ifdef KEYBOX_WITH_OPENPGP
 
37
#  undef KEYBOX_WITH_OPENPGP
 
38
/*#include <lib-to-handle-gpg-data-structs.h>*/
 
39
#endif
 
40
 
 
41
#ifdef KEYBOX_WITH_X509
 
42
# include <ksba.h>
 
43
#endif
 
44
 
 
45
typedef struct keybox_handle *KEYBOX_HANDLE;
 
46
 
 
47
 
 
48
typedef enum
 
49
  {
 
50
    KEYBOX_FLAG_BLOB,       /* The blob flags. */
 
51
    KEYBOX_FLAG_VALIDITY,   /* The validity of the entire key. */
 
52
    KEYBOX_FLAG_OWNERTRUST, /* The assigned ownertrust. */
 
53
    KEYBOX_FLAG_KEY,        /* The key flags; requires a key index. */
 
54
    KEYBOX_FLAG_UID,        /* The user ID flags; requires an uid index. */
 
55
    KEYBOX_FLAG_UID_VALIDITY,/* The validity of a specific uid, requires
 
56
                               an uid index. */
 
57
    KEYBOX_FLAG_CREATED_AT  /* The date the block was created. */
 
58
  } keybox_flag_t;
 
59
 
 
60
 
 
61
/*-- keybox-init.c --*/
 
62
void *keybox_register_file (const char *fname, int secret);
 
63
int keybox_is_writable (void *token);
 
64
 
 
65
KEYBOX_HANDLE keybox_new (void *token, int secret);
 
66
void keybox_release (KEYBOX_HANDLE hd);
 
67
const char *keybox_get_resource_name (KEYBOX_HANDLE hd);
 
68
int keybox_set_ephemeral (KEYBOX_HANDLE hd, int yes);
 
69
 
 
70
 
 
71
/*-- keybox-search.c --*/
 
72
#ifdef KEYBOX_WITH_X509 
 
73
int keybox_get_cert (KEYBOX_HANDLE hd, ksba_cert_t *ret_cert);
 
74
#endif /*KEYBOX_WITH_X509*/
 
75
int keybox_get_flags (KEYBOX_HANDLE hd, int what, int idx, unsigned int *value);
 
76
 
 
77
int keybox_search_reset (KEYBOX_HANDLE hd);
 
78
int keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc);
 
79
 
 
80
 
 
81
/*-- keybox-update.c --*/
 
82
#ifdef KEYBOX_WITH_X509 
 
83
int keybox_insert_cert (KEYBOX_HANDLE hd, ksba_cert_t cert,
 
84
                        unsigned char *sha1_digest);
 
85
int keybox_update_cert (KEYBOX_HANDLE hd, ksba_cert_t cert,
 
86
                        unsigned char *sha1_digest);
 
87
#endif /*KEYBOX_WITH_X509*/
 
88
int keybox_set_flags (KEYBOX_HANDLE hd, int what, int idx, unsigned int value);
 
89
 
 
90
int keybox_delete (KEYBOX_HANDLE hd);
 
91
int keybox_compress (KEYBOX_HANDLE hd);
 
92
 
 
93
 
 
94
/*--  --*/
 
95
 
 
96
#if 0
 
97
int keybox_lock (KEYBOX_HANDLE hd, int yes);
 
98
int keybox_get_keyblock (KEYBOX_HANDLE hd, KBNODE *ret_kb);
 
99
int keybox_locate_writable (KEYBOX_HANDLE hd);
 
100
int keybox_search_reset (KEYBOX_HANDLE hd);
 
101
int keybox_search (KEYBOX_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc);
 
102
int keybox_rebuild_cache (void *);
 
103
#endif
 
104
 
 
105
 
 
106
/*-- keybox-util.c --*/
 
107
void keybox_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
 
108
                               void *(*new_realloc_func)(void *p, size_t n),
 
109
                               void (*new_free_func)(void*) );
 
110
 
 
111
 
 
112
#ifdef __cplusplus
 
113
}
 
114
#endif
 
115
#endif /*KEYBOX_H*/