XEP-0189: Public Key Publishing

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

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. The KeyInfo Format
    2.1. X.509 Certificate
    2.2. OpenPGP
    2.3. Signatures
3. Public Key Publication via PEP
    3.1. Creating the Node
    3.2. Publishing a Key
4. Public Key Retrieval via PEP
5. Requesting Public Keys Directly From Another Entity
6. Requesting Public Keys Directly From a Third Party
7. Sending Public Keys Directly To Another Entity
8. Signing Public Keys
9. Key Management Guidelines for Secure End-to-End Communication
10. Determining Support
11. Security Considerations
12. IANA Considerations
13. XMPP Registrar Considerations
    13.1. Protocol Namespaces
    13.2. Protocol Versioning
    13.3. Service Discovery Features
14. XML Schema

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

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. Guidelines how to manage different public keys in included in this document.

2. The KeyInfo Format

This document does not use the 'http://www.w3.org/2000/09/xmldsig#' namespace as specified in XML Signature [1] because it is too complicated and the complexity is not needed for this use case. The <keyinfo/> element defined in the 'urn:xmpp:pubkey:0' namespace (see Namespace Versioning regarding the possibility of incrementing the version number) is based on the ASCII output most cryptographic libraries support. It has two parts: the public key data and signatures from other keys (optional). The optional argument 'jid' SHOULD be set if the X.509 certificate or OpenPGP key does not belong to the user providing it to another.

2.1 X.509 Certificate

The public key data is the X.509 certificate in DER encoding. To be included in an XML stream the data is Base64 encoded.

Example 1. X.509 Certificate

<keyinfo xmlns='urn:xmpp:pubkey:0'>
  <x509cert>
    MIICCTCCAXKgAwIBAgIJALhU0Id6xxwQMA0GCSqGSIb3DQEBBQUAMA4xDDAKBgNV
    BAMTA2ZvbzAeFw0wNzEyMjgyMDA1MTRaFw0wODEyMjcyMDA1MTRaMA4xDDAKBgNV
    BAMTA2ZvbzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0DPcfeJzKWLGE22p
    RMINLKr+CxqozF14DqkXkLUwGzTqYRi49yK6aebZ9ssFspTTjqa2uNpw1U32748t
    qU6bpACWHbcC+eZ/hm5KymXBhL3Vjfb/dW0xrtxjI9JRFgrgWAyxndlNZUpN2s3D
    hKDfVgpPSx/Zp8d/ubbARxqZZZkCAwEAAaNvMG0wHQYDVR0OBBYEFJWwFqmSRGcx
    YXmQfdF+XBWkeML4MD4GA1UdIwQ3MDWAFJWwFqmSRGcxYXmQfdF+XBWkeML4oRKk
    EDAOMQwwCgYDVQQDEwNmb2+CCQC4VNCHesccEDAMBgNVHRMEBTADAQH/MA0GCSqG
    SIb3DQEBBQUAA4GBAIhlUeGZ0d0msNVxYWAXg2lRsJt9INHJQTCJMmoUeTtaRjyp
    ffJtuopguNNBDn+MjrEp2/+zLNMahDYLXaTVmBf6zvY0hzB9Ih0kNTh23Fb5j+yK
    QChPXQUo0EGCaODWhfhKRNdseUozfNWOz9iTgMGw8eYNLllQRL//iAOfOr/8
  </x509cert>
</keyinfo>
    

2.2 OpenPGP

The public key data is the OpenPGP public key (RFC 4880 [2]) using binary output. Like X.509 certificates the data MUST be Base64 encoded to fit in an XML stream.

Example 2. OpenPGP Public Key

<keyinfo xmlns='urn:xmpp:pubkey:0'
         jid='romeo@montague.net'>
  <pgpdata>
    mQGiBDsKPy8RBACG1vVC8+5jMbtr8YUSfL2ciIu/Zb7/dDhwFd4iFlH7BIEt3RjR
    wmiCUw/pcL8LHav7L2L4/Yxm8peJxyK0c11tP5Mq8kG3v55BSkZzn3fwKilEYG1c
    rkOPWMEHds3c8kLDn+WNyxrSpw10EyJSsXc0edBdl7eLHiNQsCNmPpZhvwCg8uCQ
    ...
    HDU4Qg9lslDyfa2pHqkweHvC/LmIxrZeCSxOgSMLV8bqbbra1n3F4vdqgc8VP8I2
    o9wBSf3HMohGBBgRAgAGBQI7Cj82AAoJEE598tACtM5EuWIAn0tHJF+Bk7pPAngp
    hFOdFgS8UBSAAJ9ZPviS2XDzrWRpiyKV+hDqO/WTHA==
  </pgpdata>
</keyinfo>
    

2.3 Signatures

Besides the data, a key can have one or more signatures. A signature can be used to sign an X.509 certificate with an OpenPGP key or the other way around. This makes it possible to verify a self-signed X.509 certificate with the OpenPGP web-of-trust. A second use case is the concept of user and client keys. A user MAY choose to use a different X.509 certificates for each client for Jingle XTLS [3] or Client Certificate Management for SASL EXTERNAL [4]. All these client key can be signed by a user key. Once the user key is known, all clients can be verified. This XMPP based approach makes it possible to use self-signed certificates without setting up a CA (see Key Management Guidelines for Secure End-to-End Communication).

The signature has an issuer and the signature data. The issuer contains the fingerprint of the key that was used to create the signature. An optional argument 'jid' SHOULD be set if the issuer has a different base JID than the key to sign. This makes it possible to find the issuer key using PEP (see Public Key Publication via PEP).

While OpenPGP defines how to sign a string, X.509 does not specify the hash algorithm. For X.509 the signature data MUST contain an attribute what hash and sign algorithms were used. This document only defines 'RSA-SHA1' at this time. To make it easier to use standard cryptographic libraries the hash MUST contain the ASN.1 BER SHA1 algorithm designator prefix required in PKCS1. See XML-SIG section 6.4.2 how to hash and sign a string using RSA-SHA1. In most cases the cryptographic library will automatically take care of this. The data to sign is the X.509 certificate in DER encoding or the OpenPGP binary string of the fingerprint (the provided key data without Base64 encoding).

The next example contains an X.509 certificate signed by the key defined in the first example.

Example 3. X.509 Certificate with external Signature

<keyinfo xmlns='urn:xmpp:pubkey:0'>
  <x509cert>
    MIICXDCCAcWgAwIBAgIJAKBfLqul2lj3MA0GCSqGSIb3DQEBBQUAMCkxJzAlBgNV
    BAMUHmRtZXllckBqYWJiZXIuY29tXDJmdGVzdGNsaWVudDAeFw0wODA5MDYxOTI0
    MjVaFw0wOTA5MDYxOTI0MjVaMCkxJzAlBgNVBAMUHmRtZXllckBqYWJiZXIuY29t
    XDJmdGVzdGNsaWVudDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwaRLyj7J
    /mmliYhjEwGnRGRs6gmcPaIywEK2QLFz6c3/RmRabYbIOE0iZ22D33TguSNQBWfd
    lweT3bBETUhd3yuCcqWO5Ptiq/6wulMlxVeV5mxwNP/IF94VPWj0jHbRJcU8ZhS4
    UnX6R5q6OSfBGdUU4mYKdiaHpgqTAO9eeqUCAwEAAaOBizCBiDAdBgNVHQ4EFgQU
    b8touIdFuXF5clv2I/S1aOOFdN4wWQYDVR0jBFIwUIAUb8touIdFuXF5clv2I/S1
    aOOFdN6hLaQrMCkxJzAlBgNVBAMUHmRtZXllckBqYWJiZXIuY29tXDJmdGVzdGNs
    aWVudIIJAKBfLqul2lj3MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA
    pA5tI1J9Qpn3jSoQctFksRLb2H3A48R3rU8/qnarwE/AyOvth3k3ulLEmhJBT+0S
    mVb6WzrZEA/2plu7DhR8ylhuvJv6cAEIN+TPha3yzO2P8uoVZf7hdunOhMLl2Z6w
    xEfiGI5X9OsaMeFOQa+B2C3uUVAMLbVV7Rp/qQkai1Y=
  </x509cert>
  <signature>
    <issuer algo='sha1'>428b1358a286430f628da23fb33ddaf6e474f5c5</issuer>
    <value method='RSA-SHA1'>
      E3q/UkjRR3zcZMcIIoE2sSVKUATl26zyzO1Pmoe96p8apW91c3a0KqkQp1ZMBqXX
      +e2ImqQ79CKv+9qzXitxx+V4EcniKN0ZsSR+9ZbfflxkOvmBa2rpq9hFE1NYyfuT
      fsAZkRhAGlP7P5ELcvhqJ4WL6qBPYQU2NEnbVlcZSbA=
    </value>
  </signature>
</keyinfo>
    

3. Public Key Publication via PEP

An entity SHOULD follow the best practices defined in Best Practices for Persistent Storage of Public Data via Publish-Subscribe [5] to publish its long-term public keys via its own server. Processes for doing so are described in the following sections.

3.1 Creating the Node

If the pubkeys PEP node does not exist already then the entity needs to create it. The node MUST have a NodeID of "urn:xmpp:pubkey:0" (see Namespace Versioning regarding the possibility of incrementing the version number).

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").

Example 4. Entity Creates Node

<iq from='juliet@capulet.com/balcony'
    id='hfgt54ew'
    type='set'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <create node='urn:xmpp:pubkey:0'/>
    <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 [6].

Example 5. Entity Auto-Creates Node and Publishes an RSA Key

<iq from='juliet@capulet.com/balcony'
    id='hfgt54ed'
    type='set'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:pubkey:0'>
      <item id='Juliet-PGP-Key-Hash'>
        <keyinfo xmlns='urn:xmpp:pubkey:0'>
          <openpgp>PKP-Key-Base64-encoded</openpgp>
        </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>
    

3.2 Publishing a Key

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. The value of the ItemID SHOULD be the fingerprint of the X.509 certificate or the OpenPGP key and SHOULD be written in lower case. Since X.509 has no standard fingerprint mechanisms, the SHA1 value in hex is SHOULD be used as ItemID. Therefore subscribers or other interested entities are able to request a single key by specifying its fingerprint (for example, when a subscriber is using XTLS).

Example 6. Entity Publishes an X.509 Certificate to its Server

<iq from='juliet@capulet.com/balcony'
    id='gfy54e66'
    type='set'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:pubkey:0'>
      <item id='Juliet-X509-Cert-Hash'>
        <keyinfo xmlns='urn:xmpp:pubkey:0'>
          <x509cert>
            Certificate-in-DER-format-Base64-encoded
          </x509cert>
          <signature>
            <issuer>Juliet-PGP-Key-Hash</issuer>
            <value>
              Signature-Base64-encoded
            </value>
          </signature>
        </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.

Example 7. Pubsub Service Sends Notification with Key

<message to='romeo@montague.net/garden' from='juliet@capulet.com' type='headline'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='urn:xmpp:pubkey:0'>
      <item id='Juliet-X509-Cert-Hash'>
        <keyinfo xmlns='urn:xmpp:pubkey:0'>
          <x509cert>
            Certificate-in-DER-format-Base64-encoded
          </x509cert>
          <signature>
            <issuer>Juliet-PGP-Key-Hash</issuer>
            <value>
              Signature-Base64-encoded
            </value>
          </signature>
        </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 [7] protocol) to provide an explicit association between the published data and the resource that published it.

4. Public Key Retrieval via PEP

Example 8. Subscriber Requests Keys from Account

<iq from='romeo@montague.net/garden'
    to='juliet@capulet.com'
    id='hfgtredy'
    type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='urn:xmpp:pubkey:0'/>
  </pubsub>
</iq>
  

Example 9. Entity's Server Returns Keys to Subscriber

<iq from='juliet@capulet.com'
    to='romeo@montague.net/garden'
    id='hfgtredy'
    type='result'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='urn:xmpp:pubkey:0'>
      <item id='Juliet-PGP-Key-Hash'>
        <keyinfo xmlns='urn:xmpp:pubkey:0'>
          <pgpdata>
            PKP-Key-Base64-encoded
          </pgpdata>
        </keyinfo>
      </item>
      <item id='Juliet-X509-Cert-Hash'>
        <keyinfo xmlns='urn:xmpp:pubkey:0'>
          <x509cert>
            Certificate-in-DER-format-Base64-encoded
          </x509cert>
        </keyinfo>
      </item>
    </items>
  </pubsub>
</iq>
  

Example 10. Subscriber Requests Specific Key

<iq from='romeo@montague.net/garden'
    to='juliet@capulet.com'
    id='gf654ewq'
    type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='urn:xmpp:pubkey:0'>
      <item id='Juliet-X509-Cert-Hash'/>
    </items>
  </pubsub>
</iq>
  

Example 11. Entity's Server Returns Key to Subscriber

<iq from='juliet@capulet.com'
    to='romeo@montague.net/garden'
    id='gf654ewq'
    type='result'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='urn:xmpp:pubkey:0'>
      <item id='Juliet-X509-Cert-Hash'>
        <keyinfo xmlns='urn:xmpp:pubkey:0'>
          <x509cert>
            Certificate-in-DER-format-Base64-encoded
          </x509cert>
        </keyinfo>
      </item>
    </items>
  </pubsub>
</iq>
  

5. Requesting Public Keys Directly From Another Entity

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:pubkey:0' namespace (see Namespace Versioning regarding the possibility of incrementing the version number).

Example 12. Public keys request

<iq from='romeo@montague.net/garden'
    to='juliet@capulet.com/balcony'
    id='hfgt654s'
    type='get'>
  <pubkeys xmlns='urn:xmpp:pubkey:0'/>
</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). The client MAY also include the public key which was used to sign its keys even if it does not hold the private key. In that case the <keyinfo/> element MUST contain the 'jid' attribute of the public key even it is belongs to the same user.

Example 13. Successful public keys response

<iq from='juliet@capulet.com/balcony'
    to='romeo@montague.net/garden'
    id='hfgt654s'
    type='result'>
  <pubkeys xmlns='urn:xmpp:pubkey:0'>
    <keyinfo>
      <x509cert>Juliet-X509-Client-Cert</x509cert>
      <signature>
        <issuer algo='sha1'>Juliet-X509-User-Cert-Hash</issuer>
        <value method='RSA-SHA1'>
          Signature-Base64-encoded
        </value>
      </signature>
    </keyinfo>
    <keyinfo jid='juliet@capulet.com'>
      <x509cert>Juliet-X509-User-Cert</x509cert>
    </keyinfo>
    <keyinfo>
      <pgpdata>Juliet-PGP-Key</pgpdata>
    </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/>:

Example 14. Access to public keys denied

<iq from='juliet@capulet.com/balcony'
    to='romeo@montague.net/garden'
    id='hfgt654s'
    type='error'>
  <pubkeys xmlns='urn:xmpp:pubkey:0'/>
  <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 <fingerprint/> child elements:

Example 15. Specific public keys request

<iq from='juliet@capulet.com/balcony'
    to='romeo@montague.net/garden'
    id='54fgtyre'
    type='get'>
  <pubkeys xmlns='urn:xmpp:pubkey:0'>
    <fingerprint algo='sha1'>Juliet-X509-Cert-Hash</fingerprint>
    <fingerprint>Juliet-PKP-Hash</fingerprint>
  </pubkeys>
</iq>
  

Example 16. Successful specific public keys response

<iq from='juliet@capulet.com/balcony'
    to='romeo@montague.net/garden'
    id='54fgtyre'
    type='result'>
  <pubkeys xmlns='urn:xmpp:pubkey:0'>
    <keyinfo>
      <x509cert>
        Certificate-in-DER-format-Base64-encoded
      </x509cert>
    </keyinfo>
    <keyinfo>
      <pgpdata>
        PKP-Key-Base64-encoded
      </pgpdata>
    </keyinfo>
  </pubkeys>
</iq>
  

6. Requesting Public Keys Directly From a Third Party

An entity can 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:

Example 17. Requesting public keys from a third-party

<iq from='juliet@capulet.com/balcony'
    to='romeo@montague.net/garden'
    id='gftrse3w'
    type='get'>
  <pubkeys xmlns='urn:xmpp:pubkey:0' jid='benvolio@montague.net'/>
</iq>
  

Example 18. Third-party responds with public keys

<iq from='romeo@montague.net/garden'
    to='juliet@capulet.com/balcony'
    id='gftrse3w'
    type='result'>
  <pubkeys xmlns='urn:xmpp:pubkey:0' jid='benvolio@montague.net'>
    <keyinfo jid='benvolio@montague.net'>
      ...
    </keyinfo>
    <keyinfo jid='benvolio@montague.net'>
      ...
    </keyinfo>
  </pubkeys>
</iq>
  

Example 19. Third party has no copies of the keys

<iq from='romeo@montague.net/garden'
    to='juliet@capulet.com/balcony'
    id='gftrse3w'
    type='error'>
  <pubkeys xmlns='urn:xmpp:pubkey:0' jid='benvolio@montague.net'/>
  <error code='404' type='cancel'>
    <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>
  

7. Sending Public Keys Directly To Another Entity

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 <keyinfo/> 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.

Example 20. Sending public keys

<message from='romeo@montague.net/garden'
         to='juliet@capulet.com/balcony'>
  <pubkeys xmlns='urn:xmpp:pubkey:0'>
    <keyinfo>
      ...
    </keyinfo>
    <keyinfo jid='benvolio@montague.net'>
      ...
    </keyinfo>
  </pubkeys>
</message>
  

8. Signing Public Keys

A client can add another client's X.509 certificate to the pubsub node or send it directly to another client, and the client wants that certificate signed with the user's private key. If the client is not in possession of the private key, it can send a 'sign' request to another client of the user having access to the certificate.

Example 21. Client sends Signing Request

<iq from='juliet@capulet.com/chamber'
    to='juliet@capulet.com/balcony'
    type='set'
    id='hft65du8'>
  <sign node='urn:xmpp:pubkey:0'>
    <issuer algo='sha1'>UserCertificateHash</issuer>
    <pubkeys>
      <keyinfo>
        <x509cert>
          Certificate-in-DER-format-Base64-encoded
        <x509cert/>
      </keyinfo>
    <pubkeys>
  </sign>
</iq>
  

The signing client SHOULD only accept signing requests from clients of the same user (sharing a bare JID) and it is RECOMMENDED to use a secure end-to-end communicate according to Jingle XTLS [8] or C2C Authentication Using TLS [9] for serverless-messing.

Example 22. Signing Client Returns Keys

<iq from='juliet@capulet.com/balcony'
    to='juliet@capulet.com/chamber'
    type='result'
    id='hft65du8'>
  <pubkeys>
    <keyinfo>
      <x509cert>
        Certificate-in-DER-format-Base64-encoded
      <x509cert/>
      <signature>
        <issuer algo='sha1'>UserCertificateHash</issuer>
        <value method='RSA-SHA1'>
          Signature-Base64-encoded
        </value>
      </signature>
    </keyinfo>
  <pubkeys>
</iq>
  

Possible error conditions are that the signing client does not have the requested private key, the client is not authorized to request a signature, or that the signing client requires a secure connection and the request was issued over an insecure link.

Example 23. Error Conditions

<error code='404' type='cancel'>
  <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>

<error type='auth'>
  <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>

<error type='cancel'>
  <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  <security-required xmlns='urn:xmpp:jingle:errors:0'/>
</error>
  

9. Key Management Guidelines for Secure End-to-End Communication

Different X.509 certificates for each client, a user X.509 certificate to sign client certificates, and secure communication with friends make the scenario quite confusing. This section provides guidelines how to manage the different public keys and what kind of key to sign. The desired use case is to manage for secure end-to-end communication as defined by XTLS.

If a user possess an OpenPGP key, the user certificate SHOULD be signed with that key. This allows another users to verify the certificate based on the OpenPGP web-of-trust, and two users might be able to bootstrap a secure communicate without the usage of TLS-SRP.

10. Determining Support

If an entity can sign certificates or OpenPGP keys with the user's private key, it MUST report that by including a service discovery feature of "urn:xmpp:pubkey:0:sign" in response to disco#info requests (see Namespace Versioning regarding the possibility of incrementing the version number).

Example 24. Initial Service Discovery Information Request

<iq from='juliet@capulet.com/chamber'
    to='juliet@capulet.com/balcony'
    id='gfd68yt4'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
  

Example 25. Service Discovery Information Response

<iq from='juliet@capulet.com/balcony'
    to='juliet@capulet.com/chamber'
    id='gfd68yt4'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:pubkey:0'/>
    <feature var='urn:xmpp:pubkey:0:sign'/>
  </query>
</iq>
  

11. 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 (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 can 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.

The usage of secure end-to-end communication is RECOMMENDED for exchanging public keys without a pubsub service.

12. IANA Considerations

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

13. XMPP Registrar Considerations

13.1 Protocol Namespaces

This specification defines the following XML namespace:

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

13.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.

13.3 Service Discovery Features

The XMPP Registrar shall include the following features in its registry of service discovery features (see <http://xmpp.org/registrar/disco-features.html>), where the string "urn:xmpp:pubkey:0" shall be replaced with the URN issued by the XMPP Registrar:

<var>
  <name>urn:xmpp:pubkey:0:sign</name>
  <desc>The client is in possession of the user's private client to sign certificates.</desc>
  <doc>XEP-0189</doc>
</var>
    

14. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:pubkey:0'
    xmlns='urn:xmpp:pubkey:0'
    elementFormDefault='qualified'>

  <xs:element name='pubkeys'>
    <xs:complexType>
      <xs:choice>
        <xs:element ref='fingerprint'/>
        <xs:element ref='keyinfo'/>
      </xs:choice>
      <xs:attribute name='jid' type='xs:string' use='optional'/>
      <xs:anyAttribute namespace='##any' processContents='lax'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='keyinfo'>
    <xs:complexType>
      <xs:element name='name' minOccurs='1' maxOccurs='1' type='xs:string'/>
      <xs:choice minOccurs='0' maxOccurs='1'>
        <xs:element name='x509cert' type='xs:string'/>
        <xs:element name='pgpdata' type='xs:string'/>
      </xs:choice>
      <xs:element ref='signature' minOccurs='0' maxOccurs='unbounded'/>
      <xs:attribute name='jid' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='fingerprint'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='xs:string'>
          <xs:attribute name='algo' type='xs:string' use='optional'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:element name='signature'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='issuer'/>
        <xs:element ref='value'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name='issuer'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='xs:string'>
          <xs:attribute name='algo' type='xs:string' use='optional'/>
          <xs:attribute name='jid' type='xs:string' use='optional'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:element name='value'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='xs:string'>
          <xs:attribute name='method' type='xs:string' use='optional'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:element name='sign'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='issuer'/>
        <xs:element ref='pubkeys'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
  

Appendices


Appendix A: Document Information

Series: XEP
Number: 0189
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.9
Last Updated: 2009-03-08
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

Ian Paterson

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

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


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. RFC 4880: OpenPGP Message Format <http://tools.ietf.org/html/rfc4880>.

3. Extensible Messaging and Presence Protocol (XMPP) End-to-End Encryption Using Transport Layer Security ("XTLS") <http://tools.ietf.org/html/draft-meyer-xmpp-e2e-encryption>.

4. Management and Use of Client Certificates for the Extensible Messaging and Presence Protocol (XMPP) <http://tools.ietf.org/html/draft-meyer-xmpp-sasl-cert-management>.

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

6. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.

7. XEP-0033: Extended Stanza Addressing <http://xmpp.org/extensions/xep-0033.html>.

8. Extensible Messaging and Presence Protocol (XMPP) End-to-End Encryption Using Transport Layer Security ("XTLS") <http://tools.ietf.org/html/draft-meyer-xmpp-e2e-encryption>.

9. XEP-0250: C2C Authentication Using TLS <http://xmpp.org/extensions/xep-0250.html>.

10. 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/>.

11. 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/>.

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


Appendix H: Revision History

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