wp-pgp-encrypted-emails icon indicating copy to clipboard operation
wp-pgp-encrypted-emails copied to clipboard

Add OpenPGP API method to query keyserver(s) for public keys given a key ID

Open fabacab opened this issue 9 years ago • 2 comments

See item 2 from this list: https://wordpress.org/support/topic/feature-request-add-default-pgp-encryption-key-gpg-key-manager

fabacab avatar Feb 09 '16 05:02 fabacab

Sounds like a keyserver implementation. One (additional) solution would be to query pgp.mit.edu or other keyservers. Generally it is better to map email addresses to key IDs, the actual keys can be imported from the keyservers (if necessary) because the UID / email address can be the same but the actual key and its ID may differ. Key IDs are unique so far.

DanielRuf avatar Feb 20 '16 16:02 DanielRuf

I'm still pretty confident that I do not want to turn this plugin into a keyserver, however there may be some good reasons to provide a mechanism with which to "query the given keyserver for the public key associated with a given key ID" as an API method in the same vein as the other OpenPGP API methods. Perhaps something like

$key_from_keyserver = apply_filters(
    'openpgp_query_keyserver_for_key_id',
    $keyserver,
    $key_id
);

The intention would be to make it easier for other plugin developers to use OpenPGP functions in their plugins, and querying a keyserver for a key is a security-sensitive operation. The API method would have the opportunity to do things like enforce TLS and server certificate validation checks, reducing code and the potential for mistakes in other plugins.

On the flip side, other plugins would still need to obtain a key ID from a user somehow. For example, a plugin that sends email newsletters to subscribers (i.e., email addresses that are not associated with a WP_User in the WordPress database) would still need to provide some interface for the user or an admin to associate the subscriber's address with an OpenPGP public key, or at minimum, a key ID. I think that functionality should still be written in those other plugins, not this one. At that point, those plugins could just as easily do their own keyserver query and store the keys themselves, and so I'm not sure this API method will really be all that widely used.

So this would be something I'd consider a "nice to have" and would appreciate help from a contributor who is interested in doing this to implement, rather than spending time doing this myself.

fabacab avatar May 28 '17 19:05 fabacab