This specification defines a method by which an entity can publish its public keys over XMPP.
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 should not deploy implementations of this protocol until it advances to a status of Draft.
Series: XEP
Number: 0189
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.7
Last Updated: 2008-03-03
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0060, XEP-0163, W3C XML Signature
Supersedes: None
Superseded By: None
Short Name: NOT YET ASSIGNED
Wiki Page: <http://wiki.jabber.org/index.php/Public Key Publishing (XEP-0189)>
Email:
ian.paterson@clientside.co.uk
JabberID:
ian@zoofy.com
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.
Errata may be sent to <editor@xmpp.org>.
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 following 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. Introduction
2. Public Key Publication via PEP
2.1. Creating the Node
2.2. Publishing a Key
3. Public Key Retrieval via PEP
4. Requesting Public Keys Directly From Another Entity
5. Requesting Public Keys Directly From a Third Party
6. Sending Public Keys Directly To Another Entity
7. Security Considerations
8. IANA Considerations
9. XMPP Registrar Considerations
9.1. Protocol Namespaces
10. XML Schema
Notes
Revision History
This document defines different methods an entity MAY use for publishing its long-term public keys:
An entity MAY have multiple public keys with different formats, signatures, algorithms, strengths and expiry dates. Each client used by a user may use different keys.
An entity SHOULD follow the best practices defined in Best Practices for Persistent Storage of Public Data via Publish-Subscribe [1] to publish its long-term public keys via its own server. Processes for doing so are described in the following sections.
If the pubkeys PEP node does not exist already then the entity must create it. The node MUST have a NodeID of "urn:xmpp:tmp:pubkey" (see Protocol Namespaces regarding issuance of one or more permanent namespaces).
The node MUST be configured as follows:
If the user wants to control access to his/her identity (see Security Considerations) then the node access model SHOULD be something other than "open" (this can be done by setting the "access_model" option to a value of "authorize", "presence", "roster", or "whitelist").
<iq type='set' from='juliet@capulet.com/balcony' to='pubsub.shakespeare.lit' id='create1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <create node='urn:xmpp:tmp:pubkey'/> <configure> <x xmlns='jabber:x:data' type='submit'> <field var='FORM_TYPE' type='hidden'> <value>http://jabber.org/protocol/pubsub#node_config</value> </field> <field var='pubsub#persist_items'> <value>1</value> </field> <field var='pubsub#send_last_published_item'> <value>never</value> </field> <field var='pubsub#access_model'> <value>roster</value> </field> <field var='pubsub#roster_groups_allowed'> <value>friends</value> </field> </x> </configure> </pubsub> </iq>
Alternatively, if the entity's pubsub service supports both the "auto-create" and "publish-options" features, then the entity MAY create the node by publishing a key and in the first publish including a <publish-options/> element. However, note that not all pubsub services support this feature, since it is optional in Publish-Subscribe [2].
<iq from='juliet@capulet.com/balcony' type='set' id='pub1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='urn:xmpp:tmp:pubkey'> <item id='julietRSAkey1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietRSAkey1hash</KeyName> <KeyValue> <RSAKeyValue> <Modulus>...</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> </item> </publish> <configure> <x xmlns='jabber:x:data' type='submit'> <field var='FORM_TYPE' type='hidden'> <value>http://jabber.org/protocol/pubsub#node_config</value> </field> <field var='pubsub#persist_items'> <value>1</value> </field> <field var='pubsub#send_last_published_item'> <value>never</value> </field> <field var='pubsub#access_model'> <value>roster</value> </field> <field var='pubsub#roster_groups_allowed'> <value>friends</value> </field> </x> </configure> </pubsub> </iq>
The entity publishes a key by sending a pubsub publish request to the pubsub service. A previously published key can be updated by re-publishing the key using the same ItemID.
Each public key MUST be wrapped in a <KeyInfo/> element qualified by the 'http://www.w3.org/2000/09/xmldsig#' namespace as specified in XML Signature [3]. Each <KeyInfo/> element MUST contain a <KeyName/> element with a name that is unique for the user; this enables the key to be referenced by other XMPP Extension Protocols (for example, Message Archiving [4]). The name MAY be the same as the value of the ItemID. However, if two <KeyInfo/> elements contain the same public key in different formats (for example, an X.509 certificate may contain an RSA key), then the name of the two keys SHOULD be the same.
Before computing the fingerprint or publishing the key, all character data between all elements in the <KeyInfo/> element MUST be removed and the XML MUST be converted to canonical form according to Canonical XML [5]. (Any whitespace or other character data shown in the examples herein is included only for the purpose of readability.)
The value of the ItemID SHOULD be set to the fingerprint of the public key, e.g., the SHA256 hash (see SHA [6]) of the key's normalized <KeyValue/>, <PGPData/> or <X509Data/> element. Therefore subscribers or other interested entities are able to request a single key by specifying its fingerprint (for example, when a subscriber is using the Encrypted Session Negotiation [7] protocol).
<iq from='juliet@capulet.com/balcony' type='set' id='pub2'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='urn:xmpp:tmp:pubkey'> <item id='julietDSAkey1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietDSAkey1hash</KeyName> <KeyValue> <DSAKeyValue> <P>...</P> <Q>...</Q> <G>...</G> <Y>...</Y> </DSAKeyValue> </KeyValue> </KeyInfo> </item> </publish> </pubsub> </iq>
<iq from='juliet@capulet.com/balcony' type='set' id='pub3'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='urn:xmpp:tmp:pubkey'> <item id='julietX509cert1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietX509cert1hash</KeyName> <X509Data> <X509IssuerSerial> <X509IssuerName>CN=TAMURA Kent, OU=TRL, O=IBM, L=Yamato-shi, ST=Kanagawa, C=JP</X509IssuerName> <X509SerialNumber>12345678</X509SerialNumber> </X509IssuerSerial> <X509SKI>31d97bd7</X509SKI> <X509SubjectName>Subject of Certificate B</X509SubjectName> <X509Certificate>...</X509Certificate> <X509Certificate>...</X509Certificate> <X509Certificate>...</X509Certificate> </X509Data> </KeyInfo> </item> </publish> </pubsub> </iq>
<iq from='juliet@capulet.com/balcony' type='set' id='pub4'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='urn:xmpp:tmp:pubkey'> <item id='julietPGPkey1hash'> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <KeyName>julietPGPkey1hash</KeyName> <PGPData> <PGPKeyId>...</PGPKeyId> <PGPKeyPacket>...</PGPKeyPacket> </PGPData> </KeyInfo> </item> </publish> </pubsub> </iq>
After the account owner publishes the key, the pubsub service shall send a notification to each subscriber or otherwise authorized and interested entity.
<message to='romeo@montague.net/garden' from='juliet@capulet.com' type='headline'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='urn:xmpp:tmp:pubkey'> <item id='julietRSAkey1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietRSAkey1hash</KeyName> <KeyValue> <RSAKeyValue> <Modulus>...</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> </item> </items> </event> <addresses xmlns='http://jabber.org/protocol/address'> <address type='replyto' jid='juliet@capulet.com/balcony'/> </addresses> </message>
Note: The stanza containing the event notification (see example above) MAY also include 'replyto' data (as specified by the Extended Stanza Addressing [8] protocol) to provide an explicit association between the published data and the resource that published it.
<iq type='get' to='juliet@capulet.com' from='romeo@montague.net/garden' id='items1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <items node='urn:xmpp:tmp:pubkey'/> </pubsub> </iq>
<iq type='result' to='romeo@montague.net/garden' from='juliet@capulet.com' id='items1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <items node='urn:xmpp:tmp:pubkey'> <item id='julietRSAkey1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietRSAkey1hash</KeyName> ... </KeyInfo> </item> <item id='julietDSAkey1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietDSAkey1hash</KeyName> ... </KeyInfo> </item> <item id='julietX509cert1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietX509cert1hash</KeyName> ... </KeyInfo> </item> <item id='julietPGPkey1hash'> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <KeyName>julietPGPkey1hash</KeyName> ... </KeyInfo> </item> </items> </pubsub> </iq>
<iq type='get' to='juliet@capulet.com' from='romeo@montague.net/garden' id='items2'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <items node='urn:xmpp:tmp:pubkey'> <item id='julietRSAkey1hash'/> </items> </pubsub> </iq>
<iq type='result' to='romeo@montague.net/garden' from='juliet@capulet.com' id='items2'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <items node='urn:xmpp:tmp:pubkey'> <item id='julietRSAkey1hash'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyName>julietRSAkey1hash</KeyName> <KeyValue> <RSAKeyValue> <Modulus>...</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> </item> </items> </pubsub> </iq>
If an entity wishes to request the public keys of another entity and it cannot access the keys via Personal Eventing via Pubsub, then the entity MAY send an <iq/> of type 'get' to the other entity, containing an empty <pubkeys/> element qualified by the 'urn:xmpp:tmp:pubkey' namespace (see Protocol Namespaces regarding issuance of one or more permanent namespaces).
<iq type='get' id='keys1' to='juliet@capulet.com/balcony' from='romeo@montague.net/garden'> <pubkeys xmlns='urn:xmpp:tmp:pubkey'/> </iq>
The other entity MUST make a careful access control decision before returning only those public keys for which it holds the corresponding private key (not necessarily the full list of keys being published via Personal Eventing via Pubsub):
<iq type='result' id='keys1' to='romeo@montague.net/garden' from='juliet@capulet.com/balcony'> <pubkeys xmlns='urn:xmpp:tmp:pubkey'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> </pubkeys> </iq>
If the receiving entity decides not to return the public keys, it MUST return an IQ error, which SHOULD be <service-unavailable/> (to avoid divulging presence to unauthorized entities), but MAY be some other appropriate error, such as <forbidden/> or <not-allowed/>:
<iq type='error' id='keys1' to='romeo@montague.net/garden' from='juliet@capulet.com/balcony'> <pubkeys xmlns='urn:xmpp:tmp:pubkey'/> <error code='503' type='cancel'> <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
An entity MAY request one or more specific public keys by specifying their fingerprints (see Public Key Publication via PEP) as the content of <fprint/> child elements:
<iq type='get' id='keys2' to='juliet@capulet.com/balcony' from='romeo@montague.net/garden'> <pubkeys xmlns='urn:xmpp:tmp:pubkey'> <fprint>julietRSAkey1hash</fprint> <fprint>julietRSAkey2hash</fprint> </pubkeys> </iq>
<iq type='result' id='keys2' to='romeo@montague.net/garden' from='juliet@capulet.com/balcony'> <pubkeys xmlns='urn:xmpp:tmp:pubkey'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> </pubkeys> </iq>
An entity may request the public keys of another entity from a third party using the 'jid' attribute of the <pubkeys/> element to specify the JID that the keys belong to:
<iq type='get' id='keys3' to='juliet@capulet.com/balcony' from='romeo@montague.net/garden'> <pubkeys xmlns='urn:xmpp:tmp:pubkey' jid='benvolio@montague.net'/> </iq>
<iq type='result' id='keys3' to='romeo@montague.net/garden' from='juliet@capulet.com/balcony'> <pubkeys xmlns='urn:xmpp:tmp:pubkey' jid='benvolio@montague.net'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> ... </KeyInfo> </pubkeys> </iq>
<iq type='error' id='keys3' to='romeo@montague.net/garden' from='juliet@capulet.com/balcony'> <pubkeys xmlns='urn:xmpp:tmp:pubkey' jid='benvolio@montague.net'/> <error code='404' type='cancel'> <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
If an entity wishes to send public keys to another entity then it MAY include them in a <message/> stanza. The entity MAY use the 'jid' attribute of the <pubkeys/> element to specify the JID that the keys belong to. If no 'jid' attribute is specified then the other entity SHOULD assume the keys belong to the sender of the stanza.
<message to='romeo@montague.net/garden' from='juliet@capulet.com/balcony'> <pubkeys xmlns='urn:xmpp:tmp:pubkey' jid='benvolio@montague.net'> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyValue> <RSAKeyValue> <Modulus>...</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'> <KeyValue> <RSAKeyValue> <Modulus>...</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> </KeyValue> </KeyInfo> </pubkeys> </message>
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 (or the "fingerprints" of the keys) it associates with other users (not necessarily JIDs).
Whenever public keys are published an identity is typically associated with a JID. Although the public keys are public information, it may be critically important for the user of the JID to keep his identity secret from all but a few specified people. Implementors MUST take great care to ensure that the identity of the user of a JID is never divulged to anyone except the entities who have been permitted by the user to access the public key.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [9].
Until this specification advances to a status of Draft, its associated namespace shall be "urn:xmpp:tmp:pubkey"; upon advancement of this specification, the XMPP Registrar [10] shall issue a permanent namespace in accordance with the process defined in Section 4 of XMPP Registrar Function [11].
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:tmp:pubkey' xmlns='urn:xmpp:tmp:pubkey' elementFormDefault='qualified'> <xs:element name='pubkeys'> <xs:complexType> <xs:choice xmlns:dsig='http://www.w3.org/2000/09/xmldsig#' maxOccurs='unbounded' minOccurs='0'> <xs:element name='fprint' type='xs:string'/> <xs:element ref='dsig:KeyInfo'/> </xs:choice> <xs:attribute name='jid' type='xs:string' use='optional'/> <xs:anyAttribute namespace='##any' processContents='lax'/> </xs:complexType> </xs:element> </xs:schema>
1. XEP-0222: Best Practices for Persistent Storage of Public Data via Publish-Subscribe <http://www.xmpp.org/extensions/xep-0222.html>.
2. XEP-0060: Publish-Subscribe <http://www.xmpp.org/extensions/xep-0060.html>.
3. XML Signature Syntax and Processing <http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/>.
4. XEP-0136: Message Archiving <http://www.xmpp.org/extensions/xep-0136.html>.
5. Canonical XML 1.0 <http://www.w3.org/TR/xml-c14n>.
6. Secure Hash Standard: Federal Information Processing Standards Publication 180-2 <http://csrc.nist.gov/publications/fips/fips180-2/fips186-2withchangenotice.pdf>.
7. XEP-0116: Encrypted Session Negotiation <http://www.xmpp.org/extensions/xep-0116.html>.
8. XEP-0033: Extended Stanza Addressing <http://www.xmpp.org/extensions/xep-0033.html>.
9. 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/>.
10. 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://www.xmpp.org/registrar/>.
11. XEP-0053: XMPP Registrar Function <http://www.xmpp.org/extensions/xep-0053.html>.
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