-
Notifications
You must be signed in to change notification settings - Fork 39
/
gpg-recv-key-tor
executable file
·68 lines (61 loc) · 3.03 KB
/
gpg-recv-key-tor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
#-----------------------------------------------------------------------------
# gpg-recv-keys-tor
# -----------------
# Download GPG keys over Tor. The default keyserver is
# http://cryptonomicon.mit.edu.
#
# :authors: Isis Agora Lovecruft, 0xa3adb67a2cdb8b35
# :license: GPLv3+
# :version: 0.0.3
#-----------------------------------------------------------------------------
TOR_SOCKSPORT=59050
keyservopts="verbose no-honor-keyserver-url no-honor-pka-record include-subkeys"
keyservopts=$keyservopts"no-include-attributes http-proxy=socks4a://127.0.0.1:"
keyservopts=$keyservopts$TOR_SOCKSPORT
#keyserver='http://18.9.60.141' ## cryptonomicon.mit
#keyserver='hkp://209.234.253.170' ## keys.mayfirst.org
#kerservopts=$keyservopts" ca-cert-file=~/.keys.indymedia.org.pem"
#keyserver='hkps://2eghzlv2wwcq7u7y.onion' ## keys.indymedia.org (hkps)
#kerserver='https://qtt2yl5jocgrk7nu.onion'
if ! dpkg -l gnupg-curl 2>&1 >/dev/null ; then
printf "Install gnupg-curl."
fi
if test $# -lt 1 ; then
printf "Usage: %s <keyid>\n" "${0%%\/}"
else
## We would use this cert, if using gnupg-curl, and using keys.indymedia.org
## for the keyserver, but this seems broken on most boxes :(
# cat > ~/.keys.indymedia.org.pem <<EOF
# -----BEGIN CERTIFICATE-----
# MIIEjzCCA3mgAwIBAgIETkE8YzALBgkqhkiG9w0BAQUwgY4xCzAJBgNVBAYTAlhY
# MRIwEAYDVQQKEwlJbmR5bWVkaWExEzARBgNVBAsTCktleXNlcnZlcnMxDzANBgNV
# BAcTBkdsb2JhbDEdMBsGA1UEAxMUSW5keW1lZGlh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MAsGCSqGSIb3DQEBBQOC
# AQEASLc14DqY25wug0BBYHZzoitmbHKduCGdwKp0Fxf9aVfQAzK98w09n3zzU3lX
# FxNBEPOL6Tulo11ttmG5U3tU5mCRyFMrjx4U7wtMaFqk60Y6sjlMA7z8Se+NPdl4
# ZxO5dXikge7QXEjriqec/Al5ACSSxOa80x6xk584N7i0qjZpbW6vZm/DYKjWmuWs
# kHcXfs7kSTBfyMGmygQopCZWBzY6B6F7JmRoOtD1kGqYDNvsk6UMaTvrgwFgeOU1
# 9gjbgVmLBWDpiduqR5ILU0tpp7k5hTL26P+JQrDn2aWOXdDtMiDb4gsl2l0bzQv8
# OtvrQO/Qg4rD/oxY7Cq5h+8jmg==
# -----END CERTIFICATE-----
#
# EOF
gpg2 --keyserver hkp://18.9.60.141 \
--keyserver-options "$keyservopts" --recv-keys $@
fi