1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

wkd: New command --print-wkd-url for gpg-wks-client.

* tools/gpg-wks-client.c (aPrintWKDURL): New.
(opts): Add option.
(main): Implement.
* tools/wks-util.c (wks_cmd_print_wkd_url): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-03-25 15:13:59 +01:00
parent 2fc9a51751
commit 70c97a862a
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 50 additions and 5 deletions

View file

@ -1103,7 +1103,7 @@ wks_cmd_remove_key (const char *userid)
}
/* Print the WKD hash for the user ids to stdout. */
/* Print the WKD hash for the user id to stdout. */
gpg_error_t
wks_cmd_print_wkd_hash (const char *userid)
{
@ -1120,3 +1120,28 @@ wks_cmd_print_wkd_hash (const char *userid)
xfree (addrspec);
return err;
}
/* Print the WKD URL for the user id to stdout. */
gpg_error_t
wks_cmd_print_wkd_url (const char *userid)
{
gpg_error_t err;
char *addrspec, *fname;
char *domain;
err = wks_fname_from_userid (userid, 1, &fname, &addrspec);
if (err)
return err;
domain = strchr (addrspec, '@');
if (domain)
*domain++ = 0;
es_printf ("https://openpgpkey.%s/.well-known/openpgpkey/%s/hu/%s?l=%s\n",
domain, domain, fname, addrspec);
xfree (fname);
xfree (addrspec);
return err;
}