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 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.13 |
Last Updated: | 2010-01-12 |
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.
1. Introduction
2. Approach
3. Public Keys
4. Revocations
5. Attestations
6. Publication via PEP
7. Requesting a Public Key Directly
8. Sending a Public Key Directly
9. Signalling Key Generation
10. Determining Support
11. Security Considerations
12. IANA Considerations
13. XMPP Registrar Considerations
13.1. Protocol Namespaces
13.2. Protocol Versioning
14. 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
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:
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:
An entity MAY support only public key publishing (the 'urn:xmpp:pubkey:1' namespace) and not support revocations and attestations.
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:
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, where the input string to the hash function is the concatenation of the begin date, the end date, the JID, and the public key itself. |
<uri/> | A URI at which the key can be retrieved outside the XMPP network; this element is OPTIONAL. |
An example follows.
<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>
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:
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.
<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>
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:
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
<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>
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".
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).
<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).
<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>
An entity might need to send its public key to another entity, for example if it has generated a new key but does not have a way to publish the new key (or does not wish to publish the key in a world-readable fashion). In this case the entity MAY include the key directly in a <message/> stanza.
<message from='peter@jabber.org/foo' to='maineboy@jabber.org/bar'> <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> </message>
There are several situations in which it is helpful for an entity to signal that it is currently generating a key. For example, a client that does not have access to permanent storage might generate a key on startup, but key generation might not be complete when the client sends initial presence upon establishing an XMPP session. In this case the client might signal support for the public key format in the entity capabilities data that it includes in its initial presence broadcast, but also include an indication that it is currently generating a key.
<presence from='peter@jabber.org/foo'> <generating xmlns='urn:xmpp:pubkey:1'/> </presence>
After key generation is complete, the entity could publish the new key to the appropriate PEP node (if available) and send updated presence without the <generating/> extension.
<presence from='peter@jabber.org/foo'/>
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.
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.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].
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].
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.
To follow.
Series: XEP
Number: 0189
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.13
Last Updated: 2010-01-12
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
This document in other formats:
XML
PDF
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
Email:
dmeyer@tzi.de
JabberID:
dmeyer@jabber.org
Email:
ian.paterson@clientside.co.uk
JabberID:
ian@zoofy.com
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.
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>.
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".
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>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Updated the fingerprint generation method to hash over the begin date, end date, JID, and public key (not just the key itself).
(psa)Removed presence extension for generated state (implied by lack of generating flag).
(psa)Added back example of sending public key in a message; defined presence extension to signal key generation in progress.
(psa)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)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)Change KeyInfo element from W3C XML Signature to ASCII and add signature support
(dm)Changed temporary namespace per XEP-0053 procedures; corrected several small errors in the text and examples.
(psa)More clearly explained node creation and key publication workflows.
(psa)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)Added jid attribute and send use case; changed namespace
(ip)Specified that PEP nodes SHOULD be persistent
(ip)Replaced pubkey and key elements with the KeyInfo element defined in W3C XML Signature
(ip)Initial version.
(ip)END