XEP-0189: Public Key Publishing

Abstract:This specification defines a method by which an entity can publish its public keys over XMPP.
Authors:Peter Saint-Andre, Dirk Meyer, Ian Paterson
Copyright:© 1999 - 2009 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.10
Last Updated:2009-12-15

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.


Table of Contents


1. Introduction
2. Approach
3. Public Keys
4. Revocations
5. Attestations
6. Publication via PEP
7. Requesting a Public Key Directly
8. Determining Support
9. Security Considerations
10. IANA Considerations
11. XMPP Registrar Considerations
    11.1. Protocol Namespaces
    11.2. Protocol Versioning
12. XML Schemas

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

End-to-end encryption between XMPP clients and mutual authentication between a client and a server are desirable goals for the XMPP network. To enable these features, typically an XMPP user will need to possess a public key (or multiple keys), along with an associated private key that is not made public. The goal of this document is to provide simple methods for the exchange of public keys among XMPP users -- specifically, data formats that enable an XMPP entity to complete the following use cases:

2. Approach

This document assumes that each user will have a privately-generated key. A user might have more than one key (e.g., different keys for different clients) and the user's key might be signed by other entities, such as a certification authority (CA) or another user. However, the simplest case is a single key per user.

The data formats defined here are deliberately kept very simple, with the key itself represented as ASCII output (of the kind supported by most cryptographic libraries) and any metadata represented using a few straightforward XML elements and attributes. This document does not use the 'http://www.w3.org/2000/09/xmldsig#' namespace as specified in XML Signature [1]; although that format is quite powerful, it introduces unnecessary levels of complexity for this use case.

We define three payload elements:

  1. The <pubkey/> element (qualified by the 'urn:xmpp:pubkey:1' namespace) specifies a single public key for a user.
  2. The <revoke/> element (qualified by the 'urn:xmpp:revoke:1' namespace) specifies old keys that a user once used but has now revoked.
  3. The <attest/> element (qualified by the 'urn:xmpp:attest:1' namespace) specifies one or more signed copies of a user's public key.

An entity MAY support only public key publishing (the 'urn:xmpp:pubkey:1' namespace) and not support revocations and attestations.

3. Public Keys

A single public key is contained in a <pubkey/> element qualified by the 'urn:xmpp:pubkey:1' namespace (see Namespace Versioning regarding the possibility of incrementing the version number), for which the defined child elements are as follows:

Table 1: Children of the <pubkey/> Element

Element Description
<begin/> The UTC DateTime before which the key shall not be considered valid, formatted according to XMPP Date and Time Profiles [2].
<end/> The UTC DateTime after which the key shall not be considered valid, formatted according to XEP-0082.
<jid/> The XMPP address associated with this key.
<key/> The ASCII output representation of an RSA public key generated in accordance with RFC 3447 [3].
<print/> The SHA-256 fingerprint for this key.
<uri/> A URI at which the key can be retrieved outside the XMPP network; this element is OPTIONAL.

An example follows.

Example 1. A public key

<pubkey xmlns='urn:xmpp:pubkey:1'>
  <begin>2009-12-11T20:12:37</begin>
  <end>2010-12-11T23:59:59</end>
  <jid>peter@jabber.org</jid>
  <key>
    MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA25/Y7oonF3+pRjZCk0cQ
    lQFiUFvyMeUOnn01NLfqfBeT4xjahsxaYFPd+V8jIHtpO3nbkpfrBh5aLPCkqDzS
    UFvmLaVSIMUt085kcT/Yv72BUWUGaISt7swSNfictRbVZ0k8TbXUDLIAYWN8lsie
    NVxL13PS9pu3WNoORuKAV5RuzDS3djnjb6fti7fTwEUpQVwRrJXY6jNhv4c4zE3x
    Pjm48gIlHbZrxuWNrXnKT6uwXnr6PJ6O3YspferJG1oA3kmOwm41yWDkalbKgkNZ
    WeS+ahB/i9LIG+41CdekPpI0Kr0Ll9X7+zaPV6xzjlG8dYy7ZGm4eTL9STuWlPdL
    +wIDAQAB
  </key>
  <print>13475c8e27399908b4447d7c52ab30822872832eba3a654f0d80e07fb4157673</print>
</pubkey>
  

4. Revocations

A user can revoke his own key. The revocation is contained in a <revoke/> element qualified by the 'urn:xmpp:revoke:1' namespace (see Namespace Versioning regarding the possibility of incrementing the version number), for which the defined child elements are as follows:

Table 2: Children of the <revoke/> Element

Element Description
<key/> The public key that was revoked.
<keyprint/> The SHA-256 fingerprint of the public key that was revoked.
<signature/> A signature for the revocation, as described below.
<revocationprint/> The SHA-256 fingerprint of the key used to sign the revocation.
<revocationtime/> The UTC DateTime at which the key was revoked, formatted according to XEP-0082.

The data that is signed MUST be the revoked public key (i.e., the XML character data of the <key/> element), the SHA-256 fingerprint of the revoked public key (i.e., the XML character data of the <keyprint/> element), the SHA-256 fingerprint of the key used to sign the revocation (i.e., the XML character data of the <revocationprint/> element), and the time of the revocation (i.e., the XML character data of the <revocationtime/> element), concatenated together with no spaces or other additional characters.

As an example, consider a revocation of the key from Example 1, where the SHA-256 fingerprint of the revoked key is 13475c8e27399908b4447d7c52ab30822872832eba3a654f0d80e07fb4157673, the SHA-256 fingerprint of the key used to sign the revocation is becb78566783166f4a1a7c64e28dae288fe1a0f2825f6b593b336ce186c6b056, and the time of the revocation is 2009-12-14T20:49:16Z. The string to be signed would be as follows (where line breaks are not significant).

    MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA25/Y7oonF3+pRjZCk0cQ
    lQFiUFvyMeUOnn01NLfqfBeT4xjahsxaYFPd+V8jIHtpO3nbkpfrBh5aLPCkqDzS
    UFvmLaVSIMUt085kcT/Yv72BUWUGaISt7swSNfictRbVZ0k8TbXUDLIAYWN8lsie
    NVxL13PS9pu3WNoORuKAV5RuzDS3djnjb6fti7fTwEUpQVwRrJXY6jNhv4c4zE3x
    Pjm48gIlHbZrxuWNrXnKT6uwXnr6PJ6O3YspferJG1oA3kmOwm41yWDkalbKgkNZ
    WeS+ahB/i9LIG+41CdekPpI0Kr0Ll9X7+zaPV6xzjlG8dYy7ZGm4eTL9STuWlPdL
    +wIDAQAB13475c8e27399908b4447d7c52ab30822872832eba3a654f0d80e07f
    b4157673becb78566783166f4a1a7c64e28dae288fe1a0f2825f6b593b336ce1
    86c6b0562009-12-14T20:49:16Z
  

An example follows.

Example 2. A revocation

<revocation xmlns='urn:xmpp:revoke:1'>
  <key>
    MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA25/Y7oonF3+pRjZCk0cQ
    lQFiUFvyMeUOnn01NLfqfBeT4xjahsxaYFPd+V8jIHtpO3nbkpfrBh5aLPCkqDzS
    UFvmLaVSIMUt085kcT/Yv72BUWUGaISt7swSNfictRbVZ0k8TbXUDLIAYWN8lsie
    NVxL13PS9pu3WNoORuKAV5RuzDS3djnjb6fti7fTwEUpQVwRrJXY6jNhv4c4zE3x
    Pjm48gIlHbZrxuWNrXnKT6uwXnr6PJ6O3YspferJG1oA3kmOwm41yWDkalbKgkNZ
    WeS+ahB/i9LIG+41CdekPpI0Kr0Ll9X7+zaPV6xzjlG8dYy7ZGm4eTL9STuWlPdL
    +wIDAQAB
  </key>
  <keyprint>60561AEE-4187-4122-8A71-ACF9195DE572</keyprint>
  <revocationprint>becb78566783166f4a1a7c64e28dae288fe1a0f2825f6b593b336ce186c6b056</revocationprint>
  <revocationtime>2009-12-14T20:49:16Z</revocationtime>
  <signature>
    iEYEARECAAYFAksnvfsACgkQNL8k5A2w/vyVHgCglI5fPQfcu1e5PTA3bMPKiL0F
    J5cAnirpKzJ45OD+03b66UHoIosKQ31O
    =PGFT
  </signature>
</revocation>
  

5. Attestations

Whether in the context of the public key infrastructure (PKI) or a web of trust, a user might want to publish signed copies of his public key, where the signer might be another user or a trusted third party such as a certification authority (CA). The signing key could even be another key owned by the user (e.g., a primary key used to sign a secondary key associated with a particular device controlled by the user). Furthermore, the signing material might be an RSA key, a DSA key, an X.509 certificate, an OpenPGP key, or any other format.

Each signed copy is contained in an <attest/> element qualified by the 'urn:xmpp:attest:1' namespace (see Namespace Versioning regarding the possibility of incrementing the version number), for which the defined child elements are as follows:

Table 3: Children of the <attest/> Element

Element Description
<keyprint/> The SHA-256 fingerprint of the public key that was signed.
<signature/> The signature itself, as described below.
<signerjid/> The XMPP address of the signer.
<signerprint/> The SHA-256 fingerprint of the signer's key.
<signtime/> The UTC DateTime at which the key was signed, formatted according to XEP-0082.

The data that is signed MUST be the user's public key (i.e., the XML character data of the <key/> element), the SHA-256 fingerprint of the user's public key (i.e., the XML character data of the <keyprint/> element), the signer's JID (i.e., the XML character data of the <signerjid/> element), the SHA-256 fingerprint of the signer's key (i.e., the XML character data of the <signerprint/> element), and the time of the attestation (i.e., the XML character data of the <signtime/> element), concatenated together with no spaces or other additional characters.

As an example, consider an attestation of the key from Example 1, where the signer's JID is stpeter@jabber.org, the fingerprint of the signer's key is "becb78566783166f4a1a7c64e28dae288fe1a0f2825f6b593b336ce186c6b056", and the time of the attestation is 2009-12-14T18:43:00Z. The string to be signed would be as follows (where line breaks are not significant).

    MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA25/Y7oonF3+pRjZCk0cQ
    lQFiUFvyMeUOnn01NLfqfBeT4xjahsxaYFPd+V8jIHtpO3nbkpfrBh5aLPCkqDzS
    UFvmLaVSIMUt085kcT/Yv72BUWUGaISt7swSNfictRbVZ0k8TbXUDLIAYWN8lsie
    NVxL13PS9pu3WNoORuKAV5RuzDS3djnjb6fti7fTwEUpQVwRrJXY6jNhv4c4zE3x
    Pjm48gIlHbZrxuWNrXnKT6uwXnr6PJ6O3YspferJG1oA3kmOwm41yWDkalbKgkNZ
    WeS+ahB/i9LIG+41CdekPpI0Kr0Ll9X7+zaPV6xzjlG8dYy7ZGm4eTL9STuWlPdL
    +wIDAQAB13475c8e27399908b4447d7c52ab30822872832eba3a654f0d80e07f
    b4157673stpeter@jabber.orgbecb78566783166f4a1a7c64e28dae288fe1a0
    f2825f6b593b336ce186c6b0562009-12-14T18:43:00Z
  

Example 3. RSA public key signed by OpenPGP key

<attest xmlns='urn:xmpp:attest:1'>
  <keyprint>60561AEE-4187-4122-8A71-ACF9195DE572</keyprint>
  <signature>
    iEYEARECAAYFAksnyJ0ACgkQNL8k5A2w/vy9DgCfc1eOYZlp1P456NkjgvCtJaRX
    Wi4AoIGhfzr7XMzeOzOBi9A/bxopH8O4
    =MMuz
  </signature>
  <signerjid>stpeter@jabber.org</signerjid>
  <signerprint>becb78566783166f4a1a7c64e28dae288fe1a0f2825f6b593b336ce186c6b056</signerprint>
  <signtime>2009-12-14T18:43:00Z</signtime>
</attest>
  

6. Publication via PEP

A user SHOULD publish public keys, attestations, and revocations via Personal Eventing Protocol [4], in particular adhering to the best practices defined in Best Practices for Persistent Storage of Public Data via Publish-Subscribe [5].

Any other authorized entity can then receive notifications related to the user's public keys, and retrieve keys, attestations, and revocations.

If the user has only one public key (the simplest and most common case), then the pubkey PEP node SHOULD have only one item, with an ItemID of "current".

7. Requesting a Public Key Directly

If it is not possible for the user to publish his key via PEP, or for a contact to retrieve the user's key via PEP, the contact MAY request the user's key directly by sending an <iq/> of type 'get' to the user's particular full JID, containing an empty <pubkey/> element qualified by the 'urn:xmpp:pubkey:1' namespace (see Namespace Versioning regarding the possibility of incrementing the version number).

Example 4. Public key request

<iq from='maineboy@jabber.org/bar'
    to='peter@jabber.org/foo'
    id='hfgt654s'
    type='get'>
  <pubkey xmlns='urn:xmpp:pubkey:1'/>
</iq>
  

The receiving client then return its public key (which might be different from the overall key for the user, e.g. a key for only a particular device).

Example 5. Public key response

<iq from='peter@jabber.org/foo'
    to='maineboy@jabber.org/bar'
    id='hfgt654s'
    type='result'>
  <pubkey xmlns='urn:xmpp:pubkey:1'>
    <begin>2009-12-11T20:12:37</begin>
    <end>2010-12-11T23:59:59</end>
    <jid>peter@jabber.org</jid>
    <key>
      MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA25/Y7oonF3+pRjZCk0cQ
      lQFiUFvyMeUOnn01NLfqfBeT4xjahsxaYFPd+V8jIHtpO3nbkpfrBh5aLPCkqDzS
      UFvmLaVSIMUt085kcT/Yv72BUWUGaISt7swSNfictRbVZ0k8TbXUDLIAYWN8lsie
      NVxL13PS9pu3WNoORuKAV5RuzDS3djnjb6fti7fTwEUpQVwRrJXY6jNhv4c4zE3x
      Pjm48gIlHbZrxuWNrXnKT6uwXnr6PJ6O3YspferJG1oA3kmOwm41yWDkalbKgkNZ
      WeS+ahB/i9LIG+41CdekPpI0Kr0Ll9X7+zaPV6xzjlG8dYy7ZGm4eTL9STuWlPdL
      +wIDAQAB
    </key>
    <print>13475c8e27399908b4447d7c52ab30822872832eba3a654f0d80e07fb4157673</print>
  </pubkey>
</iq>
  

8. Determining Support

To advertise its support for public keys, revocations, and attestations, when replying to Service Discovery [6] information requests an entity MUST return features for 'urn:xmpp:pubkey:1', 'urn:xmpp:revoke:1', and 'urn:xmpp:attest:1' respectively.

In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in Entity Capabilities [7]. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

9. Security Considerations

The reliable association between a user or entity and its public keys is beyond the scope of this document. However, each client SHOULD maintain its own secure library of the public keys it associates with other users.

10. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].

11. XMPP Registrar Considerations

11.1 Protocol Namespaces

This specification defines the following XML namespaces:

Upon advancement of this specification to a status of Draft, the XMPP Registrar [9] shall add these namespaces to the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function [10].

11.2 Protocol Versioning

If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.

12. XML Schemas

To follow.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0189
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.10
Last Updated: 2009-12-15
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0060, XEP-0163
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control: HTML  RSS


Appendix B: Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/

Dirk Meyer

Email: dmeyer@tzi.de
JabberID: dmeyer@jabber.org

Ian Paterson

Email: ian.paterson@clientside.co.uk
JabberID: ian@zoofy.com


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2009 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XMPP Standards Foundation, c/o Peter Saint-Andre, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Appendix G: Notes

1. XML Signature Syntax and Processing <http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/>.

2. XEP-0082: XMPP Date and Time Profiles <http://xmpp.org/extensions/xep-0082.html>.

3. RFC 3447: Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1 <http://tools.ietf.org/html/rfc3447>.

4. XEP-0163: Personal Eventing Protocol <http://xmpp.org/extensions/xep-0163.html>.

5. XEP-0222: Best Practices for Persistent Storage of Public Data via Publish-Subscribe <http://xmpp.org/extensions/xep-0222.html>.

6. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

7. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.

8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

9. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.

10. XEP-0053: XMPP Registrar Function <http://xmpp.org/extensions/xep-0053.html>.


Appendix H: Revision History

Version 0.10 (2009-12-15)

Major revision; split into three namespaces and three corresponding PEP nodes, one each for public keys, attestations, and revocations; iterated the version number for public keys to urn:xmpp:pubkey:1; added detailed data to each node payload; removed some use cases to simply the protocol.

(psa)

Version 0.9 (2009-03-08)

Required specification of an algorithm for elements with hashes; removed fingerprint in <keyinfo/>; added sign request; added guidelines for key management; improved examples; changed namespace from urn:xmpp:tmp:pubkey to urn:xmpp:pubkey:0.

(dm/psa)

Version 0.8 (2008-09-08)

Change KeyInfo element from W3C XML Signature to ASCII and add signature support

(dm)

Version 0.7 (2008-03-03)

Changed temporary namespace per XEP-0053 procedures; corrected several small errors in the text and examples.

(psa)

Version 0.6 (2007-08-15)

More clearly explained node creation and key publication workflows.

(psa)

Version 0.5 (2007-03-05)

Merged node creation and first publish examples; recommended the value of each <KeyName/> element and id attribute is set to the key fingerprint; added fprint element and more examples

(ip)

Version 0.4 (2006-11-27)

Added jid attribute and send use case; changed namespace

(ip)

Version 0.3 (2006-11-20)

Specified that PEP nodes SHOULD be persistent

(ip)

Version 0.2 (2006-09-29)

Replaced pubkey and key elements with the KeyInfo element defined in W3C XML Signature

(ip)

Version 0.1 (2006-07-18)

Initial version.

(ip)

END