Major openpgp2ssh overhaul. It's an unforgiving and brittle tool, but
[monkeysphere.git] / man / man1 / openpgp2ssh.1
1 .\"  -*- nroff -*-
2 .Dd $Mdocdate: June 11, 2008 $
3 .Dt OPENPGP2SSH 1
4 .Os
5 .Sh NAME
6 openpgp2ssh
7 .Nd translate OpenPGP keys to SSH keys
8 .Sh SYNOPSIS
9 .Nm openpgp2ssh < mykey.gpg 
10
11 .Nm gpg --export $KEYID | openpgp2ssh $KEYID
12
13 .Nm gpg --export-secret-key $KEYID | openpgp2ssh $KEYID
14 .Sh DESCRIPTION
15 openpgp2ssh takes an OpenPGP-formatted primary key and associated
16 subkeys on standard input, and spits out the requested equivalent
17 SSH-style key on standard output.
18
19 If the data on standard input contains no subkeys, you can invoke
20 openpgp2ssh without arguments.  If the data on standard input contains
21 multiple keys (e.g. a primary key and associated subkeys), you must
22 specify a specific OpenPGP keyid (e.g. CCD2ED94D21739E9) or
23 fingerprint as the first argument to indicate which key to export.
24 The keyid must be exactly 16 hex characters.
25
26 If the input contains an OpenPGP RSA or DSA public key, it will be
27 converted to the OpenSSH-style single-line keystring, prefixed with
28 the key type.  This format is suitable (with minor alterations) for
29 insertion into known_hosts files and authorized_keys files.
30
31 If the input contains an OpenPGP RSA or DSA secret key, it will be
32 converted to the equivalent PEM-encoded private key.
33
34 openpgp2ssh is part of the
35 .Xr monkeysphere 1
36 framework for providing a PKI for SSH.
37 .Sh CAVEATS
38 The keys produced by this process are stripped of all identifying
39 information, including certifications, self-signatures, etc.  This is
40 intentional, since ssh attaches no inherent significance to these
41 features.
42
43 openpgp2ssh only works with RSA or DSA keys, because those are the
44 only ones which work with ssh.
45
46 Assuming a valid key type, though, openpgp2ssh will produce output for
47 any requested key.  This means, among other things, that it will
48 happily export revoked keys, unverifiable keys, expired keys, etc.
49 Make sure you do your own key validation before using this tool!
50 .Sh EXAMPLES
51 .Nm gpg --export-secret-key $KEYID | openpgp2ssh $KEYID | ssh-add -c /dev/stdin
52
53 This pushes the secret key into the active
54 .Xr ssh-agent 1 . 
55 Tools such as 
56 .Xr ssh 1
57 which know how to talk to the 
58 .Xr ssh-agent 1
59 can now rely on the key.
60 .Sh AUTHOR
61 openpgp2ssh and this man page were written by Daniel Kahn Gillmor
62 <dkg@fifthhorseman.net>.
63 .Sh BUGS
64 openpgp2ssh currently only exports into formats used by the OpenSSH.
65 It should support other key output formats, such as those used by
66 lsh(1) and putty(1).
67
68 Secret key output is currently not passphrase-protected.
69
70 openpgp2ssh currently cannot handle passphrase-protected secret keys on input.
71
72 It would be nice to be able to use keyids shorter or longer than 16
73 hex characters.
74
75 openpgp2ssh only acts on keys associated with the first primary key
76 passed in.  If you send it more than one primary key, it will silently
77 ignore later ones.
78 .Sh SEE ALSO
79 .Xr monkeysphere 1 ,
80 .Xr ssh 1 ,
81 .Xr monkeysphere-server 8