+ } else if (!strcmp("hget", argv[optind])) {
+ if (!parse_skshash(search, &hash)) {
+ puts("Couldn't parse sks hash.");
+ } else if (dbctx->fetch_key_skshash(dbctx, &hash,
+ &keys)) {
+ logthing(LOGTHING_INFO, "Got key.");
+ flatten_publickey(keys,
+ &packets,
+ &list_end);
+ free_publickey(keys);
+ if (binary) {
+ write_openpgp_stream(stdout_putchar,
+ NULL,
+ packets);
+ } else {
+ armor_openpgp_stream(stdout_putchar,
+ NULL,
+ packets);
+ }
+ free_packet_list(packets);
+ packets = NULL;
+ } else {
+ puts("Key not found");
+ }
+ } else if (!strcmp("reindex", argv[optind])) {
+ dbctx->starttrans(dbctx);
+ if (dbctx->fetch_key_id(dbctx, keyid, &keys, true)) {
+ get_fingerprint(keys->publickey, &fingerprint);
+ dbctx->delete_key(dbctx, &fingerprint, true);
+ cleankeys(dbctx, &keys, config.clean_policies);
+ dbctx->store_key(dbctx, keys, true, false);
+ } else {
+ puts("Key not found");
+ }
+ dbctx->endtrans(dbctx);