- " You must supply a keyid.");
- } else if (config.dbbackend->fetch_key(keyid, &keys,
- false)) {
+ " You must supply a keyid / "
+ "fingerprint.");
+ } else if ((isfp &&
+ dbctx->fetch_key_fp(dbctx,
+ &fingerprint,
+ &keys, false)) ||
+ (ishex &&
+ dbctx->fetch_key_id(dbctx, keyid,
+ &keys, false))) {
+ 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("hget", argv[optind])) {
+ if (!parse_skshash(search, &hash)) {
+ puts("Couldn't parse sks hash.");
+ } else if (dbctx->fetch_key_skshash(dbctx, &hash,
+ &keys)) {