znerol.wkd
Ansible Role: WKD
This Ansible role provides Jinja2 filter plugins to create hashes for PGP user IDs, which are formatted according to the Web Key Directory draft standard.
Here are the main functions included:
wkd_hash()
: This function gives you the WKD hash for a PGP user ID string.wkd_host(wkd_method=["advanced","direct"])
: This returns the domain part derived from the PGP user ID string. If you choose theadvanced
method, it adds theopenpgpkey
sub-domain (see Key Discovery in the draft standard).wkd_dir(wkd_method=["advanced","direct"])
: This gives you the directory path derived from the PGP user ID string (see Key Discovery in the draft standard).wkd_url(wkd_method=["advanced","direct"])
: This returns the WKD URL derived from the PGP user ID string (see Key Discovery in the draft standard).
Keep in mind that this role contains a pure Python implementation of the WKD hash algorithm. It does not require GnuPG command line or library, and does not manage PGP key files. If you need more complex functionalities, check out these projects/roles:
- znerol.wkd_gpg: This role exports GPG keys into a WKD directory structure.
Requirements
No specific requirements.
Role Variables
There are no role variables.
Dependencies
There are no dependencies.
Example Playbook
How to use the wkd_hash
filter:
- hosts: localhost
tasks:
- import_role:
name: znerol.wkd
- loop:
- "[email protected]"
- "[email protected]"
- "[email protected]"
- "[email protected]"
- "äëöüï@example.org"
- "[email protected]"
debug:
msg: "WKD hash for {{ item }} is {{ item | wkd_hash() }}"
For sample input/output, see test/test.yml.
License
GPLv3