Web Key Directory is a way for non-Proton users find your keys and encrypt the messages sent to you. Proton doesn't offer this for custom domains out-of-the-box, but you can proxy requests from your domain to Proton.
- Create a Cloudflare Worker
- Put this code in the Worker:
export default {
async fetch(request, env, ctx) {
var url = new URL(request.url);
if (!url.pathname.startsWith("/.well-known/openpgpkey/"))
return new Response("Path not found", { status: 404 });
url.hostname = "api.protonmail.ch";
return fetch(url.toString(), request);
},
};
- Save and assign it to
openpgpkey.mydomain.com
and you're done.