We have reached a state where we are able to import certs and
[gnupg.git] / kbx / keybox.h
index 9008823..645f1e7 100644 (file)
@@ -27,6 +27,8 @@ extern "C" {
 #endif
 #endif
 
+#include "keybox-search-desc.h"
+
 #define KEYBOX_WITH_OPENPGP 1 
 #define KEYBOX_WITH_X509 1
 
@@ -51,8 +53,13 @@ typedef enum {
   KEYBOX_Write_Error = 6,
   KEYBOX_File_Error = 7,
   KEYBOX_Blob_Too_Short = 8,
-  KEYBOX_Blob_Too_Large = 9
-
+  KEYBOX_Blob_Too_Large = 9,
+  KEYBOX_Invalid_Handle = 10,
+  KEYBOX_File_Create_Error = 11,
+  KEYBOX_File_Open_Error = 12,
+  KEYBOX_File_Close_Error = 13,
+  KEYBOX_Nothing_Found = 14,
+  KEYBOX_Wrong_Blob_Type = 15,
 } KeyboxError;
 
 
@@ -60,24 +67,41 @@ typedef enum {
 typedef struct keybox_handle *KEYBOX_HANDLE;
 
 
-
 /*-- keybox-init.c --*/
 void *keybox_register_file (const char *fname, int secret);
 int keybox_is_writable (void *token);
 
-
-/*--  --*/
-
 KEYBOX_HANDLE keybox_new (void *token, int secret);
 void keybox_release (KEYBOX_HANDLE hd);
 const char *keybox_get_resource_name (KEYBOX_HANDLE hd);
-int keybox_lock (KEYBOX_HANDLE hd, int yes);
+
+
+/*-- keybox-search.c --*/
+#ifdef KEYBOX_WITH_X509 
+int keybox_get_cert (KEYBOX_HANDLE hd, KsbaCert *ret_cert);
+#endif /*KEYBOX_WITH_X509*/
+
+int keybox_search_reset (KEYBOX_HANDLE hd);
+int keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc);
+
+
+/*-- keybox-update.c --*/
+#ifdef KEYBOX_WITH_X509 
+int keybox_insert_cert (KEYBOX_HANDLE hd, KsbaCert cert,
+                        unsigned char *sha1_digest);
+int keybox_update_cert (KEYBOX_HANDLE hd, KsbaCert cert,
+                        unsigned char *sha1_digest);
+#endif /*KEYBOX_WITH_X509*/
+
+int keybox_delete (KEYBOX_HANDLE hd);
+
+
+/*--  --*/
+
 #if 0
+int keybox_lock (KEYBOX_HANDLE hd, int yes);
 int keybox_get_keyblock (KEYBOX_HANDLE hd, KBNODE *ret_kb);
-int keybox_update_keyblock (KEYBOX_HANDLE hd, KBNODE kb);
-int keybox_insert_keyblock (KEYBOX_HANDLE hd, KBNODE kb);
 int keybox_locate_writable (KEYBOX_HANDLE hd);
-int keybox_delete_keyblock (KEYBOX_HANDLE hd);
 int keybox_search_reset (KEYBOX_HANDLE hd);
 int keybox_search (KEYBOX_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc);
 int keybox_rebuild_cache (void *);