Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fabacab opened this issue Feb 9, 2016 · 2 comments

Comments

@fabacab
Copy link
Owner

fabacab commented Feb 9, 2016

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

@DanielRuf
Copy link

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.

@fabacab
Copy link
Owner Author

fabacab commented May 28, 2017

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 fabacab changed the title Consider an interface to map email addresses to keys Add OpenPGP API method to query keyserver(s) for public keys given a key ID May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants