#!/bin/sh # $Id: lget,v 1.6 2005/03/25 19:39:22 jason Exp jason $ # This uses GPG's gpgkeys_ldap to fetch a key by keyid or fingerprint from # the LDAP server specified below. The output is saved like wget -x would # save an HKP query, allowing */pks/* expansions to include our output. # This works with long or short keyids as well as fingerprints of pubkeys # and long keyids or fingerprints of subkeys. host=horowitz.surfnet.nl port=11370 # 389 is standard LDAP port path=ldap_$host:$port/pks mkdir -p $path key=$1 file=$path/$key (echo "VERSION 1"; echo "HOST $host:$port"; echo "OPTION verbose"; \ echo "OPTION timeout=120"; \ echo "COMMAND GET"; echo; echo "$key") \ | gpgkeys_ldap > $file