0.5 RC1 examples, id attribute value, publish & configure

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@637 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Ian Paterson 2007-03-02 01:41:40 +00:00
parent f112606a8f
commit ec1e5988a4
1 changed files with 131 additions and 51 deletions

View File

@ -23,6 +23,12 @@
<supersededby>None</supersededby>
<shortname>pubkeys</shortname>
&ianpaterson;
<revision>
<version>0.5</version>
<date>2007-03-01</date>
<initials>ip</initials>
<remark><p>Merged node creation and first publish examples; recommended the value of each &lt;KeyName/&gt; element and id attribute is set to the key fingerprint; added more examples</p></remark>
</revision>
<revision>
<version>0.4</version>
<date>2006-11-27</date>
@ -57,13 +63,27 @@
<p>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.</p>
</section1>
<section1 topic='Public Key Publication and Retrieval via PEP' anchor='usecases-pubsub'>
<section1 topic='Public Key Publication via PEP' anchor='usecases-pub'>
<p>An entity SHOULD use &xep0163; to publish all its long-term public keys via its own server.</p>
<p>If the pubkeys PEP node does not exist already then the entity MUST create it first. In this case, the entity SHOULD specify that items published to the node are persistent and that the keys will only be pushed to subscribers whenever new keys are published (i.e. not when subscribers become newly available or when a new subscription is created). If the user wants to control access to his/her identity (see <link url='#security'>Security Considerations</link>) then the entity MUST also specify an appropriate access model other than "Open".</p>
<example caption='Entity Creates Public Keys Publishing Node'><![CDATA[
<iq from='juliet@capulet.com/balcony' type='set' id='create1'>
<p>If the pubkeys PEP node does not exist already then the entity MUST create it. In this case, the entity SHOULD specify that items published to the node are persistent and that the keys will only be pushed to subscribers whenever new keys are published (i.e. not when subscribers become newly available or when a new subscription is created). If the user wants to control access to his/her identity (see <link url='#security'>Security Considerations</link>) then the entity MUST also specify an appropriate access model other than "Open". The entity MAY create the node by including a &lt;configure/&gt; element when publishing a key for the first time.</p>
<p>The entity can update the keys that the node contains at any time. The value of the 'id' attribute of each &lt;item/&gt; element SHOULD be set to the fingerprint of the public key. i.e., the SHA256 hash (see &nistfips180-2;) of the key's normalized &lt;KeyValue/&gt;, &lt;PGPData/&gt; or &lt;X509Data/&gt; element (all character data <em>between</em> all elements MUST be removed and the XML MUST be converted to canonical form - see &w3canon;). Thus subscribers are able to request a single key by specifying its fingerprint (for example, when a subscriber is using the &xep0116; protocol).</p>
<p>Each public key MUST be wrapped in a &lt;KeyInfo/&gt; element as specified in &w3xmlsig;. Each &lt;KeyInfo/&gt; element published using PEP MUST contain a &lt;KeyName/&gt; element with a unique (for the user) name to allow the key to be referenced by other XMPP Extension Protocols (for example, &xep0136;). The name MAY be the same as the value of the 'id' attribute. However, if two &lt;KeyInfo/&gt; 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.</p>
<example caption='Entity Creates Public Keys Publishing Node and Publishes an RSA Key to its Server'><![CDATA[
<iq from='juliet@capulet.com/balcony' type='set' id='pub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='urn:xmpp:pubkeys'/>
<publish node='urn:xmpp:pubkeys'>
<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'>
@ -84,35 +104,15 @@
</x>
</configure>
</pubsub>
</iq>
]]></example>
<p>Once the publishing node has been created, the entity can update the keys at any time. Each public key MUST be wrapped in a &lt;KeyInfo/&gt; element as specified in &w3xmlsig;. Each &lt;KeyInfo/&gt; element MUST contain a &lt;KeyName/&gt; element with a unique (for the user) name to allow the key to be referenced by other XMPP Extension Protocols.</p>
<example caption='Entity Publishes an RSA Key to its Server'><![CDATA[
<iq from='juliet@capulet.com/balcony' type='set' id='pub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:pubkeys'>
<item id='julietRSAkey1'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietRSAkey1</KeyName>
<KeyValue>
<RSAKeyValue>
<Modulus>...</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</item>
</publish>
</pubsub>
</iq>
]]></example>
<example caption='Entity Publishes a DSA Key to its Server'><![CDATA[
<iq from='juliet@capulet.com/balcony' type='set' id='pub2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:pubkeys'>
<item id='julietDSAkey1'>
<item id='julietDSAkey1hash'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietDSAkey1</KeyName>
<KeyName>julietDSAkey1hash</KeyName>
<KeyValue>
<DSAKeyValue>
<P>...</P>
@ -131,9 +131,9 @@
<iq from='juliet@capulet.com/balcony' type='set' id='pub3'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:pubkeys'>
<item id='julietX509cert1'>
<item id='julietX509cert1hash'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietX509cert1</KeyName>
<KeyName>julietX509cert1hash</KeyName>
<X509Data>
<X509IssuerSerial>
<X509IssuerName>CN=TAMURA Kent, OU=TRL, O=IBM, L=Yamato-shi, ST=Kanagawa, C=JP</X509IssuerName>
@ -155,9 +155,9 @@
<iq from='juliet@capulet.com/balcony' type='set' id='pub4'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:pubkeys'>
<item id='julietPGPkey1'>
<KeyInfo xmlnss="http://www.w3.org/2000/09/xmldsig#">
<KeyName>julietPGPkey1</KeyName>
<item id='julietPGPkey1hash'>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>julietPGPkey1hash</KeyName>
<PGPData>
<PGPKeyId>...</PGPKeyId>
<PGPKeyPacket>...</PGPKeyPacket>
@ -172,9 +172,9 @@
<message to='romeo@montague.net/garden' from='juliet@capulet.com' type='headline'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='urn:xmpp:pubkeys'>
<item id='julietRSAkey1'>
<item id='julietRSAkey1hash'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietRSAkey1</KeyName>
<KeyName>julietRSAkey1hash</KeyName>
<KeyValue>
<RSAKeyValue>
<Modulus>...</Modulus>
@ -191,6 +191,9 @@
</message>
]]></example>
<p>Note: The stanza containing the event notification (see example above) MAY also include 'replyto' data (as specified by the &xep0033; protocol) to provide an explicit association between the published data and the <em>resource</em> that published it.</p>
</section1>
<section1 topic='Public Key Retrieval via PEP' anchor='usecases-retrieve'>
<example caption='Subscriber Requests Keys from Account'><![CDATA[
<iq type='get'
to='juliet@capulet.com'
@ -208,32 +211,66 @@
id='items1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='urn:xmpp:pubkeys'>
<item id='julietRSAkey1'>
<item id='julietRSAkey1hash'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietRSAkey1</KeyName>
<KeyName>julietRSAkey1hash</KeyName>
...
</KeyInfo>
</item>
<item id='julietDSAkey1'>
<item id='julietDSAkey1hash'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietDSAkey1</KeyName>
<KeyName>julietDSAkey1hash</KeyName>
...
</KeyInfo>
</item>
<item id='julietX509cert1'>
<item id='julietX509cert1hash'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietX509cert1</KeyName>
<KeyName>julietX509cert1hash</KeyName>
...
</KeyInfo>
</item>
<item id='julietPGPkey1'>
<KeyInfo xmlnss="http://www.w3.org/2000/09/xmldsig#">
<KeyName>julietPGPkey1</KeyName>
<item id='julietPGPkey1hash'>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>julietPGPkey1hash</KeyName>
...
</KeyInfo>
</item>
</items>
</pubsub>
</iq>
]]></example>
<example caption='Subscriber Requests Specific Key'><![CDATA[
<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:pubkeys'>
<item id='julietRSAkey1hash'/>
</items>
</pubsub>
</iq>
]]></example>
<example caption='Entity&apos;s Server Returns Key to Subscriber'><![CDATA[
<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:pubkeys'>
<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>
]]></example>
</section1>
@ -256,11 +293,15 @@
from='juliet@capulet.com/balcony'>
<pubkeys xmlns='urn:xmpp:pubkeys'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietRSAkey1</KeyName>
...
</KeyInfo>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>julietX509cert1</KeyName>
...
</KeyInfo>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
...
</KeyInfo>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
...
</KeyInfo>
</pubkeys>
@ -276,6 +317,33 @@
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>An entity MAY request one or more specific public keys by specifying their fingerprints (see <link url='#usecases-pub'>Public Key Publication via PEP</link>). The entity includes &lt;pubkey/&gt; child elements with 'fprint' attributes in its request:</p>
<example caption='Specific public keys request'><![CDATA[
<iq type='get'
id='keys2'
to='juliet@capulet.com/balcony'
from='romeo@montague.net/garden'>
<pubkeys xmlns='urn:xmpp:pubkeys'>
<pubkey fprint='julietRSAkey1hash'/>
<pubkey fprint='julietRSAkey2hash'/>
</pubkeys>
</iq>
]]></example>
<example caption='Successful specific public keys response'><![CDATA[
<iq type='result'
id='keys2'
to='romeo@montague.net/garden'
from='juliet@capulet.com/balcony'>
<pubkeys xmlns='urn:xmpp:pubkeys'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
...
</KeyInfo>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
...
</KeyInfo>
</pubkeys>
</iq>
]]></example>
</section1>
@ -284,7 +352,7 @@
<p>An entity may request the public keys of another entity from a third party using the 'jid' attribute of the &lt;pubkeys/&gt; element to specify the JID that the keys belong to:</p>
<example caption='Requesting public keys from a third-party'><![CDATA[
<iq type='get'
id='keys2'
id='keys3'
to='juliet@capulet.com/balcony'
from='romeo@montague.net/garden'>
<pubkeys xmlns='urn:xmpp:pubkeys' jid='benvolio@capulet.com'/>
@ -292,12 +360,14 @@
]]></example>
<example caption='Third-party responds with public keys'><![CDATA[
<iq type='result'
id='keys2'
id='keys3'
to='romeo@montague.net/garden'
from='juliet@capulet.com/balcony'>
<pubkeys xmlns='urn:xmpp:pubkeys' jid='benvolio@capulet.com'>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
<KeyName>benvolioRSAkey</KeyName>
...
</KeyInfo>
<KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
...
</KeyInfo>
</pubkeys>
@ -305,7 +375,7 @@
]]></example>
<example caption='Third party has no copies of the keys'><![CDATA[
<iq type='error'
id='keys2'
id='keys3'
to='romeo@montague.net/garden'
from='juliet@capulet.com/balcony'>
<pubkeys xmlns='urn:xmpp:pubkeys' jid='benvolio@capulet.com'/>
@ -368,13 +438,23 @@
<xs:element name='pubkeys'>
<xs:complexType>
<xs:choice maxOccurs='unbounded'>
<any processContents="lax" namespace="##other"/>
<xs:choice minOccurs='0' maxOccurs='unbounded'>
<xs:element ref='pubkey'/>
<any processContents='lax' namespace='##other'/>
</xs:choice>
<xs:attribute name='jid' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>
<xs:element name='pubkey'>
<xs:complexType>
<xs:sequence minOccurs='0'>
<any processContents='lax' namespace='##other'/>
</xs:sequence>
<xs:attribute name='fprint' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section1>