+ return false;
+}
+
+static void dynamic_endtrans()
+{
+ 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)
+{
+ 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)
+{
+ 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)
+{
+ 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)
+{
+ 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_fetch_key_skshash(const struct skshash *hash,
+ struct openpgp_publickey **publickey)
+{
+ if (loaded_backend == NULL) {
+ load_backend();
+ }
+
+ if (loaded_backend != NULL) {
+ if (loaded_backend->fetch_key_skshash != NULL) {
+ return loaded_backend->fetch_key_skshash(hash,
+ publickey);
+ }
+ }
+
+ return -1;
+}
+
+static int dynamic_iterate_keys(void (*iterfunc)(void *ctx,
+ struct openpgp_publickey *key), void *ctx)
+{
+ 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;