correction, Re: HushMail interoperability
Bob Mathews
bobmathews@alumni.calpoly.edu
Fri Sep 6 08:47:38 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 31 December 1969 04:00 pm, David Picón Álvarez wrote:
> > Not true, really. If you get them to send you their keys, you won't have
> > to use Hushmail's web form at all.
>
> The users in question are kind of clueless so this is more than they can do
> ;-)
Here's a perl script that fetches hushmail keys using their xml api. It could
use some work, but it gets the job done.
The xml api used to be documented on their web site, but I couldn't find it
when I looked just now. You can always read the source code at
http://www.hush.ai/. I don't see any restrictive license agreements.
-bob
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTTP::Request;
my $url = "https://keys1.hush.com/";
die "usage: hushkeys addresses...\n" unless @ARGV;
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new(POST => $url);
$req->header("Content-Type" => "text/xml");
$req->content(join "",
'<?xml version="1.0" encoding="UTF-8"?>',
'<requestBlock>',
map(qq[<publicKeyLookupRequest alias="$_"/>], @ARGV),
'</requestBlock>',
);
my $resp = $ua->request($req);
die "Request failed: ".$resp->message()."\n" unless $resp->is_success();
my $content = $resp->content();
$content =~ s/(?=-----BEGIN PGP PUBLIC KEY BLOCK-----)/\n/g;
print $content;
-----BEGIN PGP SIGNATURE-----
iD8DBQE9dOIIPgDecCrBEpcRAq+iAKCOeSLQYO/Zq0YHBlvvefqchaiBtwCdF7WF
uh6e+RQj7T0KfHURsuKCZs8=
=X7pW
-----END PGP SIGNATURE-----