summaryrefslogtreecommitdiff
path: root/man/man1/openpgp2ssh.1
blob: 6ac8f921a8ed49f8f7aa3c7306daebf241510d77 (plain)
  1. .\"  -*- nroff -*-
  2. .Dd $Mdocdate: January 18, 2013 $
  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. .Pp
  11. .Nm gpg \-\-export $KEYID | openpgp2ssh $KEYID
  12. .Pp
  13. .Nm gpg \-\-export $KEYID | openpgp2pem $KEYID
  14. .Pp
  15. .Nm gpg \-\-export\-secret\-key $KEYID | openpgp2ssh $KEYID
  16. .Sh DESCRIPTION
  17. .Nm
  18. takes an OpenPGP-formatted primary key and associated
  19. subkeys on standard input, and spits out the requested equivalent
  20. SSH-style (or PEM-encoded) key on standard output.
  21. .Pp
  22. If the data on standard input contains no subkeys, you can invoke
  23. .Nm
  24. without arguments. If the data on standard input contains multiple
  25. keys (e.g. a primary key and associated subkeys), you must specify a
  26. specific OpenPGP key identifier as the first argument to indicate
  27. which key to export. The key ID is normally the 40 hex digit OpenPGP
  28. fingerprint of the key or subkey desired, but
  29. .Nm
  30. will accept as few as the last 8 digits of the fingerprint as a key
  31. ID.
  32. .Pp
  33. If the input contains an OpenPGP RSA public key, it will be converted
  34. to the OpenSSH-style single-line keystring, prefixed with the key type
  35. (`ssh\-rsa'). This format is suitable (with minor alterations) for
  36. insertion into known_hosts files and authorized_keys files. If
  37. invoked as `openpgp2pem', a PEM-encoded public key will be emitted
  38. instead.
  39. .Pp
  40. If the input contains an OpenPGP RSA secret key, it will be converted
  41. to the equivalent PEM-encoded private key.
  42. .Pp
  43. .Nm
  44. is part of the
  45. .Xr monkeysphere 7
  46. framework for providing a PKI for SSH.
  47. .Sh CAVEATS
  48. The keys produced by this process are stripped of all identifying
  49. information, including certifications, self-signatures, etc. This is
  50. intentional, since ssh attaches no inherent significance to these
  51. features.
  52. .Pp
  53. .Nm
  54. will produce output for any requested RSA key. This means, among
  55. other things, that it will happily export revoked keys, unverifiable
  56. keys, expired keys, etc. Make sure you do your own key validation
  57. before using this tool!
  58. .Sh EXAMPLES
  59. .Nm gpg \-\-export\-secret\-key $KEYID | openpgp2ssh $KEYID | ssh\-add \-c /dev/stdin
  60. .Pp
  61. This pushes the secret key into the active
  62. .Xr ssh\-agent 1 .
  63. Tools such as
  64. .Xr ssh 1
  65. which know how to talk to the
  66. .Xr ssh\-agent 1
  67. can now rely on the key.
  68. .Sh AUTHOR
  69. .Nm
  70. and this man page were written by Daniel Kahn Gillmor
  71. <dkg@fifthhorseman.net>.
  72. .Sh BUGS
  73. .Nm
  74. only works with RSA keys. DSA keys are the only other key type
  75. available in both OpenPGP and SSH, but they are currently unsupported
  76. by this utility.
  77. .Pp
  78. .Nm
  79. only accepts raw OpenPGP packets on standard input. It does not
  80. accept ASCII-armored input.
  81. .Nm
  82. Currently only exports into formats used by the OpenSSH.
  83. It should support other key output formats, such as those used by
  84. .Xr lsh 1
  85. and
  86. .Xr putty 1 .
  87. .Pp
  88. Secret key output is currently not passphrase-protected.
  89. .Pp
  90. .Nm
  91. currently cannot handle passphrase-protected secret keys on input.
  92. .Sh SEE ALSO
  93. .Xr pem2openpgp 1 ,
  94. .Xr monkeysphere 1 ,
  95. .Xr monkeysphere 7 ,
  96. .Xr ssh 1 ,
  97. .Xr monkeysphere-authentication 8 ,
  98. .Xr monkeysphere-host 8