can gpg print a key straight from keyserver?
Anthony E. Greene
agreene@pobox.com
Tue Nov 13 07:18:02 2001
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 4 Nov 2001, Douglas Elznic wrote:
> I would like to include the most up to date copy of my key on my web
>page. I know very little php so this is hard. Optimally i would like to
>have php just get the data from an url and print it.
It seems to me that you should be posting the version you have, not the
version posted on keyservers.
I'd do this by having cron run a shell script that exported my public key
and compared it to the copy that is already posted. If the two don't match
the new key would be copied over the local copy of the old key and would
also be uploaded to my web site:
#!/bin/sh
#
oldkey=$HOME/public_html/mykey.asc
newkey=$HOME/tmp/mykey.asc.$$
gpg --export --armor 0xNNNNNNNN > $newkey
if diff --brief $oldkey $newkey; then
# no changes
exit
else
# key has changed
cp $newkey $oldkey
ftp $HOME/etc/upload_key.ftp
rm $newkey
fi
# end of script
The basic FTP client that ships with Linux is scriptable. In this case I
assumed there is an FTP script that contains the commands to log into the
web server and upload the key. The script may look like this:
open www.myisp.com
user myusername
pass mypassword
lcd /home/username/public_html
cd /path/to/webpages
binary
put mykey.asc
quit
This script contains a password and should have it's permission set to
600. Alternatively, you could omit the "user" and "pass" commands by
creating a ~/.netrc file that contains passwords for all your FTP
accounts. The FTP client automatically looks for this file and uses it to
auto-login to remote hosts. man ftp.
Tony
- --
Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
Chat: AOL/Yahoo: TonyG05
Linux. The choice of a GNU Generation. <http://www.linux.org/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Anthony E. Greene <agreene@pobox.com> 0x6C94329D
iD8DBQE78KZzpCpg3WyUI50RAqICAJ9jKTT+C76Fbb3Sq7U/w80q3li9BACggQH+
oeCGXXwl6IjoJkUUxR82WbQ=
=+7W7
-----END PGP SIGNATURE-----