Is there any Python API which can fetch a PGP public key from the public key server?
Asked
Active
Viewed 1,267 times
4
-
3You're going to have to be a lot more specific... – Ned Batchelder Aug 10 '09 at 11:46
-
Querying through HTTP (as suggested in the first answer) is error prone. You could use [`python-hkp`](https://pythonhosted.org/python-gnupg/) (but it's currently Python2 only) or [`python-gnupg`](https://pythonhosted.org/python-gnupg/) to get keys more efficiently and reliably. – Mark E. Haase Jun 03 '15 at 03:16
-
@mehaase could you please elaborate a bit on "error-prone"? What kind of errors one can expect with HTTP(S) requests for PGP keys? – Eugene Mayevski 'Callback Jun 03 '15 at 21:27
-
1If you mean scraping HTML (as suggested in the first answer), then it won't be readily transferable to any other key server and it may break any time they change their page layout. If you mean HKP (HTTP Keyserver Protocol), then that's ideal: a stable way to fetch keys that works across many servers and won't suddenty change without notice some day. – Mark E. Haase Jun 03 '15 at 23:39
1 Answers
3
You can use HTTP (urllib2 and beautiful soup would be my choice) if you're querying the MIT PGP keyserver.

simonvc
- 31
- 1
- 3