+ return false;
+}
+
+static void dynamic_endtrans()
+{
+ struct dynamic_backend *backend;
+
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->endtrans != NULL) {
+ loaded_backend->endtrans();
+ }
+ }
+}
+
+static int dynamic_fetch_key(uint64_t keyid,
+ struct openpgp_publickey **publickey, bool intrans)
+{
+ struct dynamic_backend *backend;
+
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->fetch_key != NULL) {
+ return loaded_backend->fetch_key(keyid,publickey,intrans);
+ }
+ }
+
+ return -1;
+}
+
+static int dynamic_store_key(struct openpgp_publickey *publickey, bool intrans,
+ bool update)
+{
+ struct dynamic_backend *backend;
+
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->store_key != NULL) {
+ return loaded_backend->store_key(publickey,intrans,update);
+ }
+ }
+
+ return -1;
+}
+
+static int dynamic_delete_key(uint64_t keyid, bool intrans)
+{
+ struct dynamic_backend *backend;
+
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->delete_key != NULL) {
+ return loaded_backend->delete_key(keyid, intrans);
+ }
+ }
+
+ return -1;
+}
+
+static int dynamic_fetch_key_text(const char *search,
+ struct openpgp_publickey **publickey)
+{
+ struct dynamic_backend *backend;
+
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->fetch_key_text != NULL) {
+ return loaded_backend->fetch_key_text(search, publickey);
+ }
+ }
+
+ return -1;
+}
+
+static int dynamic_iterate_keys(void (*iterfunc)(void *ctx,
+ struct openpgp_publickey *key), void *ctx)
+{
+ struct dynamic_backend *backend;
+
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->iterate_keys != NULL) {
+ return loaded_backend->iterate_keys(iterfunc, ctx);
+ }
+ }
+
+ return -1;