3 if test "x$1" = "x" -o "x$2" = "x" -o "x$3" = "x" ; then
4 echo "Usage: ssh2putty hostname port ssh-private-key"
12 # XXX - support DSA keys too
13 if ! grep -q "BEGIN RSA PRIVATE KEY" $KEYFILE ; then
14 echo "Unsupported private key format"
19 openssl rsa -noout -text -in $KEYFILE | grep ^publicExponent |
22 test $? -ne 0 && exit 1
25 openssl rsa -noout -modulus -in $KEYFILE | grep ^Modulus= |
26 sed 's/^Modulus=/0x/' | tr A-Z a-z
28 test $? -ne 0 && exit 1
30 echo "rsa2@$PORT:$HOST $public_exponent,$modulus"