More info about PGP keyservers

This commit is contained in:
the-djmaze 2022-02-08 11:21:29 +01:00
parent ff8e76631b
commit 8134a2567d
2 changed files with 29 additions and 10 deletions

View file

@ -152,16 +152,6 @@ trait Pgp
$sEmail = $aMatch[0];
}
if ($sEmail) {
/** https://wiki.gnupg.org/WKD
DNS:
openpgpkey.example.org. 300 IN CNAME wkd.keys.openpgp.org.
https://openpgpkey.example.com/.well-known/openpgpkey/example.com/hu/
else https://example.com/.well-known/openpgpkey/hu/
An example: https://example.com/.well-known/openpgpkey/hu/it5sewh54rxz33fwmr8u6dy4bbz8itz4
is the direct method URL for "bernhard.reiter@example.com"
*/
$aKeys = \SnappyMail\PGP\Keyservers::index($sEmail);
if ($aKeys) {
$sKeyId = $aKeys[0]['keyid'];

View file

@ -7,6 +7,7 @@
*
* https://datatracker.ietf.org/doc/html/rfc4387
* https://datatracker.ietf.org/doc/html/rfc7929
* https://datatracker.ietf.org/doc/html/draft-koch-openpgp-webkey-service-13
*/
namespace SnappyMail\PGP;
@ -189,4 +190,32 @@ abstract class Keyservers
}
*/
}
/** https://wiki.gnupg.org/WKD */
public static function wkd(string $host, string $keyid)
{
/*
"https://{$host}/.well-known/openpgpkey/hu/{$keyid}";
/** https://wiki.gnupg.org/WKD
DNS:
openpgpkey.example.org. 300 IN CNAME wkd.keys.openpgp.org.
https://openpgpkey.example.com/.well-known/openpgpkey/example.com/hu/
else https://example.com/.well-known/openpgpkey/hu/
An example: https://example.com/.well-known/openpgpkey/hu/it5sewh54rxz33fwmr8u6dy4bbz8itz4
is the direct method URL for "bernhard.reiter@example.com"
*/
}
public static function dns(string $host, string $keyid)
{
/*
// Resource Record (RR) TYPE = 61
\dns_get_record("{$keyid}._openpgpkey.{$host}", DNS_CNAME);
$tlsa_record = shell_exec('timeout 5 dig +short +dnssec +time=5 TLSA ' . \escapeshellarg("{$keyid}._openpgpkey.{$host}")
. " 2>&1 | head -n 1");
*/
}
}