wkd
Ansible Role: WKD
Provides Jinja2 filter plugins to hash PGP user ids in the form required by the Web Key Directory draft standard.
wkd_hash()
: Returns the WKD hash given a PGP user id string.wkd_host(wkd_method=["advanced","direct"])
: Returns the domain-part derived from given PGP user id string. Ifwkd_method
is set toadvanced
theopenpgpkey
sub-domain is prepended (see section Key Discovery in draft standard).wkd_dir(wkd_method=["advanced","direct"])
: Returns the directory path derived from the given PGP user id string (see section Key Discovery in draft standard).wkd_url(wkd_method=["advanced","direct"])
: Returns the WKD URL derived from the given PGP user id string (see section Key Discovery in draft standard).
Note that this role essentially contains pure Python implementation of the WKD hash algorithm. It does not depend on GnuPG command line/library, nor does it provide modules / tasks capable of manipulating PGP key files. The following projects/roles provide higher level abstractions:
- znerol.wkd_gpg: Export GPG keys into a WKD directory structure.
Requirements
None
Role Variables
None
Dependencies
None
Example Playbook
Usage of 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() }}"
See test/test.yml for sample input/output.
License
GPLv3