g10: Add new delete operations that allow more flags.
[gpgme.git] / src / engine-backend.h
index b3cc412..90328ec 100644 (file)
@@ -14,7 +14,7 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with this program; if not, see <http://www.gnu.org/licenses/>.
+   License along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef ENGINE_BACKEND_H
@@ -44,11 +44,13 @@ struct engine_ops
   const char *(*get_req_version) (void);
 
   gpgme_error_t (*new) (void **r_engine,
-                       const char *file_name, const char *home_dir);
+                       const char *file_name, const char *home_dir,
+                        const char *version);
 
   /* Member functions.  */
   void (*release) (void *engine);
   gpgme_error_t (*reset) (void *engine);
+  void (*set_status_cb) (void *engine, gpgme_status_cb_t cb, void *cb_value);
   void (*set_status_handler) (void *engine, engine_status_handler_t fnc,
                              void *fnc_value);
   gpgme_error_t (*set_command_handler) (void *engine,
@@ -59,11 +61,12 @@ struct engine_ops
                                           void *fnc_value);
   gpgme_error_t (*set_locale) (void *engine, int category, const char *value);
   gpgme_error_t (*set_protocol) (void *engine, gpgme_protocol_t protocol);
-  gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph,
-                           gpgme_data_t plain);
-  gpgme_error_t (*decrypt_verify) (void *engine, gpgme_data_t ciph,
-                                  gpgme_data_t plain);
-  gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
+  gpgme_error_t (*decrypt) (void *engine,
+                            gpgme_decrypt_flags_t flags,
+                            gpgme_data_t ciph,
+                           gpgme_data_t plain, int export_session_key,
+                            const char *override_session_key);
+  gpgme_error_t (*delete) (void *engine, gpgme_key_t key, unsigned int flags);
   gpgme_error_t (*edit) (void *engine, int type, gpgme_key_t key,
                         gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
   gpgme_error_t (*encrypt) (void *engine, gpgme_key_t recp[],
@@ -80,22 +83,38 @@ struct engine_ops
   gpgme_error_t (*export_ext) (void *engine, const char *pattern[],
                               gpgme_export_mode_t mode, gpgme_data_t keydata,
                               int use_armor);
-  gpgme_error_t (*genkey) (void *engine, gpgme_data_t help_data, int use_armor,
+  gpgme_error_t (*genkey) (void *engine,
+                           const char *userid, const char *algo,
+                           unsigned long reserved, unsigned long expires,
+                           gpgme_key_t key, unsigned int flags,
+                           gpgme_data_t help_data,
+                           unsigned int extraflags,
                           gpgme_data_t pubkey, gpgme_data_t seckey);
   gpgme_error_t (*import) (void *engine, gpgme_data_t keydata,
                            gpgme_key_t *keyarray);
   gpgme_error_t (*keylist) (void *engine, const char *pattern,
-                           int secret_only, gpgme_keylist_mode_t mode);
+                           int secret_only, gpgme_keylist_mode_t mode,
+                           int engine_flags);
   gpgme_error_t (*keylist_ext) (void *engine, const char *pattern[],
                                int secret_only, int reserved,
-                               gpgme_keylist_mode_t mode);
+                               gpgme_keylist_mode_t mode,
+                               int engine_flags);
+  gpgme_error_t (*keylist_data) (void *engine, gpgme_data_t data);
+  gpgme_error_t (*keysign) (void *engine,
+                            gpgme_key_t key, const char *userid,
+                            unsigned long expires, unsigned int flags,
+                            gpgme_ctx_t ctx);
+  gpgme_error_t (*tofu_policy) (void *engine,
+                                gpgme_key_t key,
+                                gpgme_tofu_policy_t policy);
   gpgme_error_t (*sign) (void *engine, gpgme_data_t in, gpgme_data_t out,
                         gpgme_sig_mode_t mode, int use_armor,
                         int use_textmode, int include_certs,
                         gpgme_ctx_t ctx /* FIXME */);
   gpgme_error_t (*trustlist) (void *engine, const char *pattern);
   gpgme_error_t (*verify) (void *engine, gpgme_data_t sig,
-                          gpgme_data_t signed_text, gpgme_data_t plaintext);
+                          gpgme_data_t signed_text, gpgme_data_t plaintext,
+                           gpgme_ctx_t ctx);
   gpgme_error_t  (*getauditlog) (void *engine, gpgme_data_t output,
                                  unsigned int flags);
   gpgme_error_t  (*opassuan_transact) (void *engine,
@@ -110,6 +129,10 @@ struct engine_ops
   gpgme_error_t  (*conf_load) (void *engine, gpgme_conf_comp_t *conf_p);
   gpgme_error_t  (*conf_save) (void *engine, gpgme_conf_comp_t conf);
 
+  gpgme_error_t  (*query_swdb) (void *engine,
+                                const char *name, const char *iversion,
+                                gpgme_query_swdb_result_t result);
+
   void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs);
   void (*io_event) (void *engine, gpgme_event_io_t type, void *type_data);