Network Working Group                                      J. Galbraith
INTERNET-DRAFT                              Van Dyke Technologies, Inc.
draft-ietf-secsh-publickeyfile-00                             R. Thayer
Expires June 2001                                   The Tillerman Group
                                                           January 2000

                      SECSH Public Key File Format


   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of [RFC-2026].

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups. Note that
   other groups may also distribute working documents as

   Internet-Drafts are draft documents valid for a maximum of six
   months and may be updated, replaced, or obsoleted by other documents
   at any time. It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   The list of current Internet-Drafts can be accessed at

   The list of Internet-Draft Shadow Directories can be accessed at


   This document formally documents the existing public key file format
   in use for exchanging public keys between different SECSH

1. Conventions used in this document

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   document are to be interpreted as described in [RFC-2119].

2. Introduction

   In order to use public key authentication, public keys must be
   exchanged between client and server.  This document formally
   describes the existing public key file format, with few exceptions.

   Where this document departs from current practice, it also suggests
   a mechanism for backwards compatability.

J. Galbraith, R. Thayer                                         [Page 1]

                      SECSH Public Key File Format          January 2000

3. Key File Format

   SECSH implementations must share public key files between the client
   and the server in order interoperate.

   A key file consists of a sequence of lines, each of which MUST be
   terminated with a <CR><LF> and MUST NOT exceed 72 bytes in length
   (excluding the <CR><LF> line terminator.)

   Because current practice is to terminate lines with <LF> only,
   implementations SHOULD be able to read files with lines terminated
   only by a <LF> for backwards compatibility reasons.

4. Begin and end markers

   The first line of a conforming key file MUST be a begin marker,
   which is the literal text:

   ---- BEGIN SSH2 PUBLIC KEY ----

   The last line of a conforming key file MUST be a end marker, which
   is the literal text:

   ---- END SSH2 PUBLIC KEY ----

5. Key File Header

   The key file header section consists of multiple RFC822 - style
   header fields.  Each field is a line of the following format:

   Header-tag ':' ' ' Header-value

   The Header-tag MUST NOT be more than 64 bytes.  The Header-value
   MUST NOT be more than 1024 bytes.  Each line in the header MUST be
   less the 72 bytes.

   A line is continued if the last character in the line is a '\'.  If
   the last character of a line is a '\', then the logical contents of
   the line is formed by removing the '\' and appending the contents of
   the next line.

   Header-tag MUST be US-ASCII.  Header-value MUST be encoded in UTF-8

   A line that is not a continuation line that has no ':' in it is
   assumed to be the first line of the base 64 encoded body (Section 8)

   Compliant implementations MUST ignore unrecognized header fields.
   Implementations SHOULD preserve unrecognized header fields when
   manipulating the key file.

   Existing implementations may not correctly handle unrecognized

J. Galbraith, R. Thayer                                         [Page 2]

                      SECSH Public Key File Format          January 2000

   fields. During a transition period, implementations SHOULD generate
   key file headers that contain only a subject field followed by a
   comment field.

6. Subject Header

   This field currently is used to store the login-name that the key
   was generated under.  For example:

   Subject: user

7. Comment Header

   Contain a user specified comment which will be displayed when using
   the key.

   It is suggested that this field default to user@hostname for the
   user and machine used to generate the key.  For example:


8. Public Key File Body

   The body of a public key file consists of the public key blob as
   described in [SSH-TRANS], section 4.6, "Public Key Algorithms",
   encoded in base 64 as specified in [RFC-2045] section 6.8, "Base64

   As with all other lines, each line in the body MUST be no longer
   than 72 characters and terminated with a <CR><LF> character.

9. References

   [SSH-TRANS] Ylonen, T., et al: "SSH Transport Layer Protocol",
   Internet Draft, draft-secsh-transport-09.txt

   [RFC-2044] Yergeau, F: "UTF-8, a Transformation Format of Unicode
   and ISO 10646", October 1996.

   [RFC-2026] S. Bradner: "The Internet Standards Process -- Revision
   3", October 1996.

   [RFC-2119] S. Bradner: "Key words for use in RFCs to Indicate
   Requirement Levels", March 1997.

   [RFC-2045] Freed & Borenstein: "Multipurpose Internet Mail
   Extensions (MIME) Part One: Format of Internet Message Bodies",
   November 1996.

J. Galbraith, R. Thayer                                         [Page 3]

                      SECSH Public Key File Format          January 2000

10. Author's Address

   Joseph Galbraith
   Van Dyke Technologies, Inc.
   4848 Tramway Ridge Rd.
   Suite 101
   Albuquerque, NM 87111
   Phone: +1 505 332 5700

   Rodney Thayer
   The Tillerman Group
   370 Altair Way, PMB 321
   Sunnyvale, CA 94086
   Phone: +1 408 757 9693

J. Galbraith, R. Thayer                                         [Page 4]