libkdenetwork Library API Documentation

engine-backend.h

00001 /* engine-backend.h -  A crypto backend for the engine interface.
00002    Copyright (C) 2002, 2003 g10 Code GmbH
00003  
00004    This file is part of GPGME.
00005  
00006    GPGME is free software; you can redistribute it and/or modify it
00007    under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010  
00011    GPGME is distributed in the hope that it will be useful, but
00012    WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    General Public License for more details.
00015  
00016    You should have received a copy of the GNU General Public License
00017    along with GPGME; if not, write to the Free Software Foundation,
00018    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00019 
00020 #ifndef ENGINE_BACKEND_H
00021 #define ENGINE_BACKEND_H
00022 
00023 #include "engine.h"
00024 
00025 /* FIXME: Correct check?  */
00026 #ifdef GPGSM_PATH
00027 #define ENABLE_GPGSM 1
00028 #endif
00029 
00030 struct engine_ops
00031 {
00032   /* Static functions.  */
00033   const char *(*get_file_name) (void);
00034   const char *(*get_version) (void);
00035   const char *(*get_req_version) (void);
00036   gpgme_error_t (*new) (void **r_engine,
00037             const char *lc_ctype, const char *lc_messages);
00038 
00039   /* Member functions.  */
00040   void (*release) (void *engine);
00041   void (*set_status_handler) (void *engine, engine_status_handler_t fnc,
00042                   void *fnc_value);
00043   gpgme_error_t (*set_command_handler) (void *engine,
00044                     engine_command_handler_t fnc,
00045                     void *fnc_value, gpgme_data_t data);
00046   gpgme_error_t (*set_colon_line_handler) (void *engine,
00047                        engine_colon_line_handler_t fnc,
00048                        void *fnc_value);
00049   gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph,
00050                 gpgme_data_t plain);
00051   gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
00052   gpgme_error_t (*edit) (void *engine, int type, gpgme_key_t key,
00053              gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
00054   gpgme_error_t (*encrypt) (void *engine, gpgme_key_t recp[],
00055                 gpgme_encrypt_flags_t flags,
00056                 gpgme_data_t plain, gpgme_data_t ciph,
00057                 int use_armor);
00058   gpgme_error_t (*encrypt_sign) (void *engine, gpgme_key_t recp[],
00059                  gpgme_encrypt_flags_t flags,
00060                  gpgme_data_t plain, gpgme_data_t ciph,
00061                  int use_armor, gpgme_ctx_t ctx /* FIXME */);
00062   gpgme_error_t (*export) (void *engine, const char *pattern,
00063                unsigned int reserved, gpgme_data_t keydata,
00064                int use_armor);
00065   gpgme_error_t (*export_ext) (void *engine, const char *pattern[],
00066                    unsigned int reserved, gpgme_data_t keydata,
00067                    int use_armor);
00068   gpgme_error_t (*genkey) (void *engine, gpgme_data_t help_data, int use_armor,
00069                gpgme_data_t pubkey, gpgme_data_t seckey);
00070   gpgme_error_t (*import) (void *engine, gpgme_data_t keydata);
00071   gpgme_error_t (*keylist) (void *engine, const char *pattern,
00072                 int secret_only, gpgme_keylist_mode_t mode);
00073   gpgme_error_t (*keylist_ext) (void *engine, const char *pattern[],
00074                 int secret_only, int reserved,
00075                 gpgme_keylist_mode_t mode);
00076   gpgme_error_t (*sign) (void *engine, gpgme_data_t in, gpgme_data_t out,
00077              gpgme_sig_mode_t mode, int use_armor,
00078              int use_textmode,
00079              int include_certs, gpgme_ctx_t ctx /* FIXME */);
00080   gpgme_error_t (*trustlist) (void *engine, const char *pattern);
00081   gpgme_error_t (*verify) (void *engine, gpgme_data_t sig,
00082                gpgme_data_t signed_text,
00083                gpgme_data_t plaintext);
00084   
00085   void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs);
00086   void (*io_event) (void *engine, gpgme_event_io_t type, void *type_data);
00087 
00088   gpgme_error_t (*cancel) (void *engine);
00089 };
00090 
00091 
00092 extern struct engine_ops _gpgme_engine_ops_gpg;     /* OpenPGP.  */
00093 #ifdef ENABLE_GPGSM
00094 extern struct engine_ops _gpgme_engine_ops_gpgsm;   /* CMS.  */
00095 #endif
00096 
00097 #endif /* ENGINE_BACKEND_H */
KDE Logo
This file is part of the documentation for libkdenetwork Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:39:09 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003