#! /bin/sh

if type lsh-decode-key ; then
  SSH_CONV=lsh-decode-key
else
  SSH_CONV=./lsh-decode-key
fi

if ! type $SSH_CONV ; then
    echo "Can't find the lsh-decode-key program"
    exit 1
fi

awk 'BEGIN { state = 0; }
     state == 0 && /^---- BEGIN SSH2 PUBLIC KEY/ { state = 1; next; }
     state == 1 && $0 ~ /^---- END SSH2 PUBLIC KEY/ { state = 2 }
     state == 1 && $0 !~ /:/ { print }
     state == 2 { next } 
     /^ssh-dss/ { print $2; }' \
  | $SSH_CONV -b

     
     
