Specification: https://github.com/fedi-e2ee/public-key-directory-specificat...
I've been working on solving this problem so we can have end-to-end encryption for DMs on ActivityPub (and therefore Mastodon).
I thought I'd share it here in case anyone was interested in this work.