After creating a PGP key, it is common to distribute it to various keyservers. However, anyone can upload to these keyservers impersonating someone else. One solution is to use a decentralized identities approach, however, if your email is on your own domain that you tell every soul about, why not have your own website host the key? This is where the Web Key Directory (WKD) protocol comes in.
## Setting up WKD
To start we need to create a new folder on our webserver:
```bash
mkdir .well-known/openpgpkey/hu
```
In it, add an empty policy file
```bsah
touch .well-known/openpgpkey/hu/policy
```
Now we need to add our key to the folder. The key needs to be stored in the file named after the email's WKD hash. We can get this hash through the following command:
The string starting with`o1dbwk` is the WKD hash for `brozek@brandonrozek.com` and the string starting with `im4cc8qh` is the WKD hash for `hello@brandonrozek.com`.
Let's store that hash in `$WKD`
```bash
export WKD="o1dbwkdx683fduwgzmrbwa3yip41frdn"
```
The WKD specification says to upload the non-armored (binary) version of our key.
This will not only locate but import the key into our keystore.
With WKD, we didn't have to trust anyone but the DNS provider in order to retrieve the key. The biggest downside with this approach, however, is that most people do not have an email on their own domain. Since nowadays, many people use gmail as their primary provider, they will have to fallback to using a different approach for distributing their keys.