def getkey_dl_ascii(keyid): key = pgp.get_pgp_armor_key(keyid) if key: return key, 200, {"Content-Type": "text/plain", "Content-Disposition": "attachment; filename={}.asc".format(keyid)} else: return "No such key", 404, {"Content-Type": "text/plain"}
def getkey(keyid): # Load the key. key = pgp.get_pgp_armor_key(keyid) if key: return json.dumps({"key": key}), 200, {"Content-Type": "application/json", "Cache-Control": "no-cache", "Pragma": "no-cache"} else: return json.dumps({"key": None}), 404, {"Content-Type": "application/json", "Cache-Control": "no-cache", "Pragma": "no-cache"}
def getkeyinfo(key: str): if key.startswith("0x"): key = key.replace("0x", "") # Keyinfo route. keydata = pgp.get_pgp_keyinfo(key) if request.args.get("added", False): added = True else: added = False if keydata: keyascii = pgp.get_pgp_armor_key(key) return render_template("keyinfo.html", added=added, key=keydata, keydata=keyascii, found=True) else: return render_template("keyinfo.html", found=False, keyid=key), 404
def pksgetkey(): if 'op' in request.args and request.args.get("op") == "get": # Lookup the key keyid = request.args.get("search") if keyid is None or not keyid.startswith("0x"): return "Invalid key data", 401 else: key = pgp.get_pgp_armor_key(keyid) if key: return key, 200, {"Cache-Control": "no-cache", "Pragma": "no-cache", "Content-Type": "application/x-pgp-key"} else: return "", 404 elif 'op' in request.args and request.args.get("op") == "index": return pkssearch(request.args) else: return "Invalid request", 400
def getkey_dl_ascii(keyid): key = pgp.get_pgp_armor_key(keyid) if key: return key, 200, {"Content-Type": "text/plain", "Content-Disposition": "attachment; filename={}.asc".format(keyid)} else: return "No such key", 404, {"Content-Type": "text/plain"} #@frontend_keys.route("/<keyid>/dl/raw") #def getkey_dl_raw(keyid): # key = pgp.get_pgp_armor_key(keyid) # if key: # return key, 200, {"Content-Type": "application/octet-stream", "Content-Disposition": "attachment; filename={}.gpg".format(keyid)} # else: # return "No such key", 404, {"Content-Type": "text/plain"}
def getkey(keyid): key = pgp.get_pgp_armor_key(keyid) if key: return key, 200, {"Content-Type": "text/plain"} else: return "No such key", 404, {"Content-Type": "text/plain"}