2001-11-10 19:10:11 +01:00
|
|
|
/* keydb.h - Key database
|
|
|
|
* Copyright (C) 1998, 1999, 2000, 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
|
2007-07-04 21:49:40 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-11-10 19:10:11 +01:00
|
|
|
* (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
|
2016-11-05 12:02:19 +01:00
|
|
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
2001-11-10 19:10:11 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GNUPG_KEYDB_H
|
|
|
|
#define GNUPG_KEYDB_H
|
|
|
|
|
2001-11-13 13:50:14 +01:00
|
|
|
#include <ksba.h>
|
|
|
|
|
2009-12-08 17:30:33 +01:00
|
|
|
#include "../common/userids.h"
|
2001-11-13 13:50:14 +01:00
|
|
|
|
2001-11-10 19:10:11 +01:00
|
|
|
typedef struct keydb_handle *KEYDB_HANDLE;
|
|
|
|
|
2004-02-02 18:09:35 +01:00
|
|
|
/* Flag value used with KEYBOX_FLAG_VALIDITY. */
|
|
|
|
#define VALIDITY_REVOKED (1<<5)
|
|
|
|
|
2001-11-10 19:10:11 +01:00
|
|
|
|
|
|
|
/*-- keydb.c --*/
|
2016-11-10 17:01:19 +01:00
|
|
|
gpg_error_t keydb_add_resource (ctrl_t ctrl, const char *url,
|
|
|
|
int force, int *auto_created);
|
2016-11-10 15:38:14 +01:00
|
|
|
KEYDB_HANDLE keydb_new (void);
|
2001-11-10 19:10:11 +01:00
|
|
|
void keydb_release (KEYDB_HANDLE hd);
|
2002-06-19 10:30:10 +02:00
|
|
|
int keydb_set_ephemeral (KEYDB_HANDLE hd, int yes);
|
2001-11-10 19:10:11 +01:00
|
|
|
const char *keydb_get_resource_name (KEYDB_HANDLE hd);
|
2004-02-02 18:09:35 +01:00
|
|
|
gpg_error_t keydb_lock (KEYDB_HANDLE hd);
|
2001-11-13 13:50:14 +01:00
|
|
|
|
2004-02-02 18:09:35 +01:00
|
|
|
gpg_error_t keydb_get_flags (KEYDB_HANDLE hd, int which, int idx,
|
|
|
|
unsigned int *value);
|
|
|
|
gpg_error_t keydb_set_flags (KEYDB_HANDLE hd, int which, int idx,
|
|
|
|
unsigned int value);
|
2014-06-02 15:55:00 +02:00
|
|
|
void keydb_push_found_state (KEYDB_HANDLE hd);
|
|
|
|
void keydb_pop_found_state (KEYDB_HANDLE hd);
|
2003-12-17 13:28:24 +01:00
|
|
|
int keydb_get_cert (KEYDB_HANDLE hd, ksba_cert_t *r_cert);
|
|
|
|
int keydb_insert_cert (KEYDB_HANDLE hd, ksba_cert_t cert);
|
|
|
|
int keydb_update_cert (KEYDB_HANDLE hd, ksba_cert_t cert);
|
2001-11-13 13:50:14 +01:00
|
|
|
|
2006-05-22 16:35:04 +02:00
|
|
|
int keydb_delete (KEYDB_HANDLE hd, int unlock);
|
2001-11-13 13:50:14 +01:00
|
|
|
|
2001-11-10 19:10:11 +01:00
|
|
|
int keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved);
|
|
|
|
void keydb_rebuild_caches (void);
|
2001-11-13 13:50:14 +01:00
|
|
|
|
2016-01-13 15:08:42 +01:00
|
|
|
gpg_error_t keydb_search_reset (KEYDB_HANDLE hd);
|
2016-11-10 17:01:19 +01:00
|
|
|
int keydb_search (ctrl_t ctrl, KEYDB_HANDLE hd,
|
|
|
|
KEYDB_SEARCH_DESC *desc, size_t ndesc);
|
|
|
|
int keydb_search_first (ctrl_t ctrl, KEYDB_HANDLE hd);
|
|
|
|
int keydb_search_next (ctrl_t ctrl, KEYDB_HANDLE hd);
|
|
|
|
int keydb_search_kid (ctrl_t ctrl, KEYDB_HANDLE hd, u32 *kid);
|
|
|
|
int keydb_search_fpr (ctrl_t ctrl, KEYDB_HANDLE hd, const byte *fpr);
|
|
|
|
int keydb_search_issuer (ctrl_t ctrl, KEYDB_HANDLE hd, const char *issuer);
|
|
|
|
int keydb_search_issuer_sn (ctrl_t ctrl, KEYDB_HANDLE hd,
|
2001-11-13 13:50:14 +01:00
|
|
|
const char *issuer, const unsigned char *serial);
|
2016-11-10 17:01:19 +01:00
|
|
|
int keydb_search_subject (ctrl_t ctrl, KEYDB_HANDLE hd, const char *issuer);
|
2001-11-10 19:10:11 +01:00
|
|
|
|
2016-11-10 17:01:19 +01:00
|
|
|
int keydb_store_cert (ctrl_t ctrl, ksba_cert_t cert, int ephemeral,
|
|
|
|
int *existed);
|
|
|
|
gpg_error_t keydb_set_cert_flags (ctrl_t ctrl, ksba_cert_t cert, int ephemeral,
|
2007-03-20 17:57:40 +01:00
|
|
|
int which, int idx,
|
|
|
|
unsigned int mask, unsigned int value);
|
2002-01-15 14:02:47 +01:00
|
|
|
|
2006-10-02 13:54:35 +02:00
|
|
|
void keydb_clear_some_cert_flags (ctrl_t ctrl, strlist_t names);
|
2004-04-28 10:59:34 +02:00
|
|
|
|
2001-11-10 19:10:11 +01:00
|
|
|
|
|
|
|
#endif /*GNUPG_KEYDB_H*/
|