+#endif
+
+#ifdef NEED_GETFULLKEYID
+/**
+ * getfullkeyid - Maps a 32bit key id to a 64bit one.
+ * @keyid: The 32bit keyid.
+ *
+ * This function maps a 32bit key id to the full 64bit one. It returns the
+ * full keyid.
+ */
+uint64_t getfullkeyid(uint64_t keyid)
+{
+ struct openpgp_publickey *publickey = NULL;
+
+ if (keyid < 0x100000000) {
+ fetch_key(keyid, &publickey, false);
+ keyid = get_keyid(publickey);
+ free_publickey(publickey);
+ }
+
+ return keyid;
+}
+#endif