+ return count;
+}
+
+/**
+ * hkp_fetch_key_id - Given a keyid fetch the key from HKP server.
+ */
+static int hkp_fetch_key_id(uint64_t keyid,
+ struct openpgp_publickey **publickey,
+ bool intrans)
+{
+ char keyurl[1024];
+
+ snprintf(keyurl, sizeof(keyurl),
+ "%s/lookup?op=get&search=0x%08" PRIX64,
+ hkpbase, keyid);
+
+ return (hkp_fetch_key_url(keyurl, publickey, intrans));
+}
+
+/**
+ * hkp_fetch_key_fp - Given a fingerprint fetch the key from HKP server.
+ */
+static int hkp_fetch_key_fp(uint8_t *fp, size_t fpsize,
+ struct openpgp_publickey **publickey,
+ bool intrans)
+{
+ char keyurl[1024];
+ int i, ofs;
+
+ if (fpsize > MAX_FINGERPRINT_LEN) {
+ return 0;
+ }
+
+ ofs = snprintf(keyurl, sizeof(keyurl),
+ "%s/lookup?op=get&search=0x", hkpbase);
+
+ if ((ofs + fpsize * 2 + 1)> sizeof(keyurl)) {
+ return 0;
+ }
+
+ for (i = 0; i < fpsize; i++) {
+ ofs += sprintf(&keyurl[ofs], "%02X", fp[i]);
+ }
+
+ return (hkp_fetch_key_url(keyurl, publickey, intrans));