I recently discovered a new DNS Resource Record type called OPENPGPKEY. Being a user of OpenPGP and having some interest in DANE, I decided to give it a try.
The RR is specified in RFC7929, which is still an experimental RFC. I think it is important to mention that the use of the OPENPGPKEY RR has some security implications that shouldn’t be ignored by users. They are talked about in detail in Section 7 of the aforementioned RFC.
Creating an OPENPGPKEY Resource Record
Creating the resource record is a rather simple operation. The name is formed
by a SHA-256 hash of the local part of the email address truncated to 28 octets
(or 56 chars) in hexadecimal. This is then followed by a _opengpgkey
on the
next level. The domain part of the email address is then appended to it and
that forms the FQDN.
The data part is simply the public key, encoded in Base64. Special case should be taken with the size, as PGP keys can be quite big. Some considerations in regards to size are listed in Section 2.1.2 of the RFC.
As an example, let’s take something@yolo.engineer
. The first part of the
FQDN can be created with:
|
|
To that we append _openpgpkey.yolo.engineer
and we have our FQDN.
The data part, you can create by using gpg --armor --export <key_id>
and
cutting out the -----BEGIN PGP PUBLIC KEY BLOCK-----
and
-----END PGP PUBLIC KEY BLOCK-----
lines.
A full RR entry for BIND DNS would look like:
|
|
Importing keys published via DNS/DANE
Importing keys published via this method is quite trivial as the gpg
binary
provides tooling for it.
|
|
It is important to remember that the imported key fingerprint should still be checked in an out-of-band manner, as recommended by the RFC.