Last active
December 16, 2017 03:35
-
-
Save orangecms/8c5f7e86fdb5314501a87a8c74fdf82c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
_KEY=$1 | |
curl "https://keyserver.opensuse.org/pks/lookup?op=get&search=0x$_KEY" | tail -n +13 | head -n -2 > "/tmp/$_KEY.asc" | |
gpg --import "/tmp/$_KEY.asc" | |
rm "/tmp/$_KEY.asc" |
HKP uses port 11371, so if that was blocked, it won't work. But hkps uses port 443 just as https, so that will always work. Just make sure you choose a hkps-capable keyserver or pool and you should be ok (except that GnuPG nowadays also needs to do DNS lookups, but it's uncommon for those to be blocked).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why?
gpg --recv-keys
should also do it, right? Well, I was in a network where everything but HTTP/S was blocked. Boo.Remarks: Don't use the plain HTTP version of course. Just don't. It was a stupid mistake to put it here in the first place. Anyway, read before usage. If you want to use a different keyserver, just swap it out, make it a variable, whatever. You might need to adjust head/tail to filter out a different number of lines of HTML. :)