Switch to getKeyByName. Switch to returning a Promise
authorMark Watson <watsonm@netflix.com>
Mon, 08 Jul 2013 15:24:18 -0700
changeset 13 9dd3763a0333
parent 12 df2d7c7979b0
child 14 9579d36520db
Switch to getKeyByName. Switch to returning a Promise
Overview.html
keydiscovery-source.html
--- a/Overview.html	Mon Jan 07 14:01:11 2013 -0800
+++ b/Overview.html	Mon Jul 08 15:24:18 2013 -0700
@@ -88,12 +88,6 @@
     color:  #ff4500;
 }
 
-
-/* --- --- */
-ol.algorithm { counter-reset:numsection; list-style-type: none; }
-ol.algorithm li { margin: 0.5em 0; }
-ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
-
 /* --- TOC --- */
 .toc a, .tof a {
     text-decoration:    none;
@@ -164,7 +158,7 @@
     color: #b9ab2d;
 }
 div.issue-title { color: #e05252; }
-div.note-title { color: #52e052; }
+div.note-title { color: #2b2; }
 div.issue-title span, div.note-title span {
     text-transform: uppercase;
 }
@@ -179,7 +173,7 @@
     border-left-style: solid;
 }
 div.issue, div.note {
-    padding: 0.5em;
+    padding: 1em 1.2em 0.5em;
     margin: 1em 0;
     position: relative;
     clear: both;
@@ -229,6 +223,11 @@
     font-weight:    bold;
     color:  #005a9c;
 }
+a.idlEnumItem {
+    color:  #000;
+    border-bottom:  1px dotted #ccc;
+    text-decoration: none;
+}
 
 .idlSuperclass {
     font-style: italic;
@@ -261,6 +260,16 @@
     text-decoration: none;
 }
 
+/*.idlCtor*/
+.idlCtorName {
+    color:  #ff4500;
+}
+.idlCtorName a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+}
+
 /*.idlParam*/
 .idlParamType {
     color:  #005a9c;
@@ -273,6 +282,11 @@
     color:  #666;
 }
 
+/*.idlSectionComment*/
+.idlSectionComment {
+    color: gray;
+}
+
 /*.idlConst*/
 .idlConstType {
     color:  #005a9c;
@@ -320,15 +334,15 @@
     font-weight:    bold;
 }
 
-dl.attributes, dl.methods, dl.constants, dl.fields, dl.dictionary-members {
+dl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {
     margin-left:    2em;
 }
 
-.attributes dt, .methods dt, .constants dt, .fields dt, .dictionary-members dt {
+.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {
     font-weight:    normal;
 }
 
-.attributes dt code, .methods dt code, .constants dt code, .fields dt code, .dictionary-members dt code {
+.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {
     font-weight:    bold;
     color:  #000;
     font-family:    monospace;
@@ -354,7 +368,11 @@
     background:  #ddffd2;
 }
 
-.attributes dd, .methods dd, .constants dd, .fields dd, .dictionary-members dd {
+.constructors dt code {
+    background:  #cfc;
+}
+
+.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {
     margin-bottom:  1em;
 }
 
@@ -401,20 +419,20 @@
     border-collapse:    collapse;
     width:  100%;
 }
-</style><link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-WD"><!--[if lt IE 9]><script src='http://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
-  <body><div class="head">
+</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
+  <body class="h-entry"><div class="head">
   <p>
     
-      <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
+      <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a>
     
   </p>
-  <h1 class="title" id="title">WebCrypto Key Discovery</h1>
+  <h1 class="title p-name" id="title">WebCrypto Key Discovery</h1>
   
-  <h2 id="w3c-working-draft-08-january-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Working Draft 08 January 2013</h2>
+  <h2 id="w3c-editor-s-draft-08-july-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2013-07-08">08 July 2013</time></h2>
   <dl>
     
       <dt>This version:</dt>
-      <dd><a href="http://www.w3.org/TR/2013/WD-webcrypto-key-discovery-20130108/">http://www.w3.org/TR/2013/WD-webcrypto-key-discovery-20130108/</a></dd>
+      <dd><a class="u-url" href="http://dvcs.w3.org/hg/webcrypto-keydiscovery/raw-file/tip/Overview.html">http://dvcs.w3.org/hg/webcrypto-keydiscovery/raw-file/tip/Overview.html</a></dd>
       <dt>Latest published version:</dt>
       <dd><a href="http://www.w3.org/TR/webcrypto-key-discovery/">http://www.w3.org/TR/webcrypto-key-discovery/</a></dd>
     
@@ -425,15 +443,15 @@
     
     
     
+      
     
-      <dt>Previous version:</dt>
-      <dd><a href=""></a></dd>
     
     
     <dt>Editor:</dt>
-    <dd><span>Mark Watson</span>, <a href="http://www.netflix.com/">Netflix</a>, <span class="ed_mailto"><a href="mailto:watsonm@netflix.com">watsonm@netflix.com</a></span></dd>
+    <dd class="p-author h-card vcard"><span class="p-name fn">Mark Watson</span>, <a class="p-org org h-org h-card" href="http://www.netflix.com/">Netflix</a>, <span class="ed_mailto"><a class="u-email email" href="mailto:watsonm@netflix.com">watsonm@netflix.com</a></span></dd>
 
     
+    
   </dl>
   
   
@@ -441,13 +459,13 @@
   
     
       <p class="copyright">
-        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 
+        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
         2013
         
-        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> 
+        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
         (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
         <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
-        <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
+        <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved.
         <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
         <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
         <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
@@ -484,9 +502,8 @@
       Web Cryptography Working Group whether the scope of this document may be expanded to discovery of other kinds of key.</p>
     
         <p>
-          This document was published by the <a href="http://www.w3.org/2012/webcrypto/">Web Cryptography WG</a> as a Working Draft.
+          This document was published by the <a href="http://www.w3.org/2012/webcrypto/">Web Cryptography WG</a> as an Editor's Draft.
           
-            This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation.
           
           If you wish to make comments regarding this document, please send them to 
           <a href="mailto:public-webcrypto@w3.org">public-webcrypto@w3.org</a> 
@@ -494,11 +511,13 @@
           <a href="http://lists.w3.org/Archives/Public/public-webcrypto/">archives</a>).
           
           
-          All feedback is welcome.
-        </p>
+          
+          
+            All comments are welcome.</p>
+          
         
           <p>
-            Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
+            Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
             This is a draft document and may be updated, replaced or obsoleted by other documents at 
             any time. It is inappropriate to cite this document as other than work in progress.
           </p>
@@ -571,8 +590,8 @@
   normative.
 </p>
 <p>
-  The key words <em class="rfc2119" title="must">must</em>, <em class="rfc2119" title="must not">must not</em>, <em class="rfc2119" title="required">required</em>, <em class="rfc2119" title="should">should</em>, <em class="rfc2119" title="should not">should not</em>, <em class="rfc2119" title="recommended">recommended</em>, <em class="rfc2119" title="may">may</em>,
-  and <em class="rfc2119" title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
+  The key words <em class="rfc2119" title="MUST">MUST</em>, <em class="rfc2119" title="MUST NOT">MUST NOT</em>, <em class="rfc2119" title="REQUIRED">REQUIRED</em>, <em class="rfc2119" title="SHOULD">SHOULD</em>, <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em>, <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>, <em class="rfc2119" title="MAY">MAY</em>,
+  and <em class="rfc2119" title="OPTIONAL">OPTIONAL</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
 </p>
 
       
@@ -584,13 +603,13 @@
           <dd>
             <p>
               A user agent is considered to be a conforming user agent
-              if it satisfies all of the <em class="rfc2119" title="must">must</em>-, <em class="rfc2119" title="required">required</em>- and <em class="rfc2119" title="shall">shall</em>-level
+              if it satisfies all of the <em class="rfc2119" title="MUST">MUST</em>-, <em class="rfc2119" title="REQUIRED">REQUIRED</em>- and <em class="rfc2119" title="SHALL">SHALL</em>-level
               criteria in this specification that apply to implementation. This specification
               uses both the terms "conforming user agent" and "user agent" to refer to this
               product class.
             </p>
             <p>
-              User agents <em class="rfc2119" title="may">may</em> implement algorithms in this
+              User agents <em class="rfc2119" title="MAY">MAY</em> implement algorithms in this
               specification in any way desired, so long as the end result is indistinguishable
               from the result that would be obtained from the specification's algorithms.
             </p>
@@ -598,7 +617,7 @@
         </dl>
         <p>
           User agents that use ECMAScript to implement the APIs defined in this specification
-          <em class="rfc2119" title="must">must</em> implement them in a manner consistent with the
+          <em class="rfc2119" title="MUST">MUST</em> implement them in a manner consistent with the
           ECMAScript Bindings defined in the Web IDL specification [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]
           as this specification uses that specification and terminology.
         </p>
@@ -685,7 +704,7 @@
           specification [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>].
         </dd>
         <dt>Web Cryptography API</dt>
-        <dd><p>A <a href="#dfn-conforming-user-agent" class="internalDFN">conforming user agent</a> <em class="rfc2119" title="must">must</em> support the Web Cryptography API [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>].</p>
+        <dd><p>A <a href="#dfn-conforming-user-agent" class="internalDFN">conforming user agent</a> <em class="rfc2119" title="MUST">MUST</em> support the Web Cryptography API [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>].</p>
           <p>The terms <dfn title="Key" id="dfn-key"><code>Key</code></dfn> and <dfn title="KeyOperation" id="dfn-keyoperation"><code>KeyOperation</code></dfn> are defined in [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>].</p>
         </dd>
         <dt>WebIDL</dt>
@@ -699,17 +718,17 @@
     <section id="api-definition">
       <!--OddPage--><h2><span class="secno">7. </span>API definition</h2>
       <section class="informative" id="overview"><h3><span class="secno">7.1 </span>Overview</h3><p><em>This section is non-normative.</em></p>
-      <p>This specification defines a new <a><code>cryptokeys</code></a> attribute on the <a href="#dfn-window" class="internalDFN"><code>Window</code></a> and <a href="#dfn-workerglobalscope" class="internalDFN"><code>WorkerGlobalScope</code></a> objects. This attribute is an object supporting a method, <a><code>getkeysByName</code></a> which may be used to get an array of all keys matching a <code>DOMString</code> name specifier. Keys are returned as <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> objects which are subclasses of the <a href="#dfn-key" class="internalDFN"><code>Key</code></a> class.</p></section>
+      <p>This specification defines a new <a><code>cryptokeys</code></a> attribute on the <a href="#idl-def-Window" class="idlType"><code>Window</code></a> and <a href="#idl-def-WorkerGlobalScope" class="idlType"><code>WorkerGlobalScope</code></a> objects. This attribute is an object supporting a method, <a><code>getKeyByName</code></a> which may be used to get an array of all keys matching a <code>DOMString</code> name specifier. Keys are returned as <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> objects which are subclasses of the <a href="#dfn-key" class="internalDFN"><code>Key</code></a> class.</p></section>
       
       <section id="namedkey-interface"><h3><span class="secno">7.2 </span>NamedKey interface</h3>
-        <pre class="idl"><span class="idlInterface" id="idl-def-NamedKey">interface <span class="idlInterfaceID">NamedKey</span> : <span class="idlSuperclass"><a>Key</a></span> {
-<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a></span>  <span class="idlAttrName"><a href="#widl-NamedKey-name">name</a></span>;</span>
-<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-NamedKey-id">id</a></span>;</span>
-};</span></pre><section id="attributes"><h4><span class="secno">7.2.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-NamedKey-id"><code>id</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly, nullable</dt><dd>
+        <pre class="idl"><span class="idlInterface" id="idl-def-NamedKey">interface <span class="idlInterfaceID">NamedKey</span> : <span class="idlSuperclass"><a href="#dfn-key" class="internalDFN">Key</a></span> {
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><a>DOMString</a></span>  <span class="idlAttrName"><a href="#widl-NamedKey-name">name</a></span>;</span>
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><a>DOMString</a>?</span> <span class="idlAttrName"><a href="#widl-NamedKey-id">id</a></span>;</span>
+};</span></pre><section id="attributes"><h4><span class="secno">7.2.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-NamedKey-id"><code>id</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly   , nullable</dt><dd>
             <p>A global identifier associated with the key.</p>
-            <p>Origin-specific pre-provisioned keys are frequently provisioned with associated identifiers. Where an identifier exists that uniquely identifies the key amongst all keys pre-provisoned with the same <a href="#dfn-origin" class="internalDFN">origin</a> and <a><code>name</code></a> and if this identifier can be canonically expressed as a sequence of no more than 256 bytes, then this identifier <em class="rfc2119" title="should">should</em> be exposed, base64 encoded, as the <a><code>id</code></a>. If no identifier matching these conditions exists, <a><code>id</code></a> <em class="rfc2119" title="must">must</em> be <code>null</code>.</p>
-            <div class="note"><div class="note-title"><span>Note</span></div><p class="">The inclusion and definition of this identifier is the subject of <a href="http://www.w3.org/2012/webcrypto/track/issues/25">ISSUE-25</a>.</p></div>
-          </dd><dt id="widl-NamedKey-name"><code>name</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly</dt><dd><p>A local identifier for the key.</p></dd></dl></section>
+            <p>Origin-specific pre-provisioned keys are frequently provisioned with associated identifiers. Where an identifier exists that uniquely identifies the key amongst all keys pre-provisoned with the same <a href="#dfn-origin" class="internalDFN">origin</a> and <a><code>name</code></a> and if this identifier can be canonically expressed as a sequence of no more than 256 bytes, then this identifier <em class="rfc2119" title="SHOULD">SHOULD</em> be exposed, base64 encoded, as the <a><code>id</code></a>. If no identifier matching these conditions exists, <a><code>id</code></a> <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+            <div class="note"><div class="note-title" role="heading" aria-level="4"><span>Note</span></div><p class="">The inclusion and definition of this identifier is the subject of <a href="http://www.w3.org/2012/webcrypto/track/issues/25">ISSUE-25</a>.</p></div>
+          </dd><dt id="widl-NamedKey-name"><code>name</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly   </dt><dd><p>A local identifier for the key.</p></dd></dl></section>
         <section id="structured-clone-algorithm"><h4><span class="secno">7.2.2 </span>Structured clone algorithm</h4>
         <p>When a user agent is required to obtain a <a href="#dfn-structured-clone" class="internalDFN">structured clone</a> of a <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> object, it must run the following steps.</p>
         <ol>
@@ -724,50 +743,48 @@
         </section>
 
         <section id="immutability-of-namedkey-objects"><h4><span class="secno">7.2.3 </span>Immutability of NamedKey objects</h4>
-          <p>The <code>name</code> and <code>id</code> attributes of a <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> object <em class="rfc2119" title="shall not">shall not</em> change. The underlying cryptographic key <em class="rfc2119" title="shall not">shall not</em> change, except that it <em class="rfc2119" title="may">may</em> be removed altogether. In this case any attempt to use the <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> object shall return an error.</p>
+          <p>The <code>name</code> and <code>id</code> attributes of a <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> object <em class="rfc2119" title="SHALL NOT">SHALL NOT</em> change. The underlying cryptographic key <em class="rfc2119" title="SHALL NOT">SHALL NOT</em> change, except that it <em class="rfc2119" title="MAY">MAY</em> be removed altogether. In this case any attempt to use the <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> object shall return an error.</p>
         </section>
       </section>
       <section id="cryptokeys-interface"><h3><span class="secno">7.3 </span>CryptoKeys interface</h3>
         <pre class="idl"><span class="idlInterface" id="idl-def-CryptoKeys">[<span class="extAttr">NoInterfaceObject</span>]
 interface <span class="idlInterfaceID">CryptoKeys</span> {
-<span class="idlMethod">    <span class="idlMethType"><a>KeyOperation</a></span> <span class="idlMethName"><a href="#widl-CryptoKeys-getKeysByName-KeyOperation-DOMString-name">getKeysByName</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">name</span></span>);</span>
-};</span></pre><section id="methods"><h4><span class="secno">7.3.1 </span>Methods</h4><dl class="methods"><dt id="widl-CryptoKeys-getKeysByName-KeyOperation-DOMString-name"><code>getKeysByName</code></dt><dd>
+<span class="idlMethod">    <span class="idlMethType"><a>Promise<any></any></a></span> <span class="idlMethName"><a href="#widl-CryptoKeys-getKeyByName-Promise-any--DOMString-name">getKeyByName</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">name</span></span>);</span>
+};</span></pre><section id="methods"><h4><span class="secno">7.3.1 </span>Methods</h4><dl class="methods"><dt id="widl-CryptoKeys-getKeyByName-Promise-any--DOMString-name"><code>getKeyByName</code></dt><dd>
             <p>When invoked, this method must perform the following steps:
               </p><ol>
-                <li>Let <var>KeyOp</var> be a newly created object implementing the <code><a href="http://www.w3.org/TR/WebCryptoAPI/#KeyOperation-interface">KeyOperation</a></code> interface</li>
-                <li>Queue an operation to asynchronously run the following steps:
+                <li>Let <var>promise</var> be a new <a><code>Promise</code></a> and <var>resolver</var> its associated resolver
+                </li><li>Return <var>promise</var> and continue executing the following steps asynchronously:
                   <ol>
-                    <li>Search for a key or keys matching the name specifier provided in <code>name</code>. A name specifier matches the name of a key if they are identical when expressed as a string of unicode characters.
+                    <li>Search for a key matching the name specifier provided in <code>name</code>. A name specifier matches the name of a key if they are identical when expressed as a string of unicode characters.
                       <dl class="switch">
-                        <dt>If one or more keys are found</dt>
+                        <dt>If a key is found</dt>
                         <dd>
                           <ol>
-                            <li>Let the <code>result</code> attribute of <var>KeyOp</var> be an object of type <code>NamedKey[]</code> containing the keys</li>
-                            <li><a title="queue-a-task" href="#dfn-queue-a-task" class="internalDFN">queue a task</a> to <a title="fire-a-simple-event" href="#dfn-fire-a-simple-event" class="internalDFN">fire a simple event</a> called <code>onsuccess</code>at <var>KeyOp</var></li>
+                            <li>Let the <var>result</var> be an object of type <code>NamedKey</code> representing the key</li>
+                            <li>Execute <var>resolver</var>'s <code>resolve(value)</code> algorithm with <var>result</var> as the <code>value</code> argument</li>
                           </ol>
                         </dd>
                         <dt>Otherwise</dt>
-                        <dd><a title="queue-a-task" href="#dfn-queue-a-task" class="internalDFN">queue a task</a> to <a title="fire-a-simple-event" href="#dfn-fire-a-simple-event" class="internalDFN">fire a simple event</a> called <code>onerror</code> at <var>KeyOp</var></dd>
+                        <dd>Execute <var>resolver</var>'s <code>resolve(value)</code> algorithm with <code>null</code> as the <code>value</code> argument</dd>
                       </dl>
                     </li>
                   </ol>
                 </li>
-                <li>Return <var>KeyOp</var> to the task that invoked <a>getKeysByName</a></li>
               </ol>
             <p></p>
-            
-            <p>A name specifier matches the name of a key if they are identical when expressed as a string of unicode characters. If no matching keys are found, and empty array is returned.</p><table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">name</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>KeyOperation</a></code></div></dd></dl></section>
+            <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">name</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>Promise<any></any></a></code></div></dd></dl></section>
       </section>
       
       <section id="extension-of-window-interface"><h3><span class="secno">7.4 </span>Extension of Window interface</h3>
       <pre class="idl"><span class="idlInterface" id="idl-def-Window">partial interface <span class="idlInterfaceID">Window</span> {
-<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span> <span class="idlAttrName"><a href="#widl-Window-cryptokeys">cryptokeys</a></span>;</span>
-};</span></pre><section id="attributes-1"><h4><span class="secno">7.4.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-Window-cryptokeys"><code>cryptokeys</code> of type <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span>, readonly</dt><dd>The object that exposes the key discovery methods</dd></dl></section></section>
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span> <span class="idlAttrName"><a href="#widl-Window-cryptokeys">cryptokeys</a></span>;</span>
+};</span></pre><section id="attributes-1"><h4><span class="secno">7.4.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-Window-cryptokeys"><code>cryptokeys</code> of type <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span>, readonly   </dt><dd>The object that exposes the key discovery methods</dd></dl></section></section>
       
       <section id="extension-of-workerglobalscope-interface"><h3><span class="secno">7.5 </span>Extension of WorkerGlobalScope interface</h3>
       <pre class="idl"><span class="idlInterface" id="idl-def-WorkerGlobalScope">partial interface <span class="idlInterfaceID">WorkerGlobalScope</span> {
-<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span> <span class="idlAttrName"><a href="#widl-WorkerGlobalScope-cryptokeys">cryptokeys</a></span>;</span>
-};</span></pre><section id="attributes-2"><h4><span class="secno">7.5.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-WorkerGlobalScope-cryptokeys"><code>cryptokeys</code> of type <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span>, readonly</dt><dd>The object that exposes the key discovery methods</dd></dl></section></section>
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span> <span class="idlAttrName"><a href="#widl-WorkerGlobalScope-cryptokeys">cryptokeys</a></span>;</span>
+};</span></pre><section id="attributes-2"><h4><span class="secno">7.5.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-WorkerGlobalScope-cryptokeys"><code>cryptokeys</code> of type <span class="idlAttrType"><a href="#idl-def-CryptoKeys" class="idlType"><code>CryptoKeys</code></a></span>, readonly   </dt><dd>The object that exposes the key discovery methods</dd></dl></section></section>
     </section>
     
     <section id="examples"><!--OddPage--><h2><span class="secno">8. </span>Examples</h2></section>
@@ -781,11 +798,11 @@
     -->
   
 
-<section id="references" class="appendix"><!--OddPage--><h2><span class="secno">A. </span>References</h2><section id="normative-references"><h3><span class="secno">A.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-HTML5">[HTML5]</dt><dd>Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/html5"><cite>HTML5.</cite></a> 29 March 2012. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/html5">http://www.w3.org/TR/html5</a> 
+<section id="references" class="appendix"><!--OddPage--><h2><span class="secno">A. </span>References</h2><section id="normative-references"><h3><span class="secno">A.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-HTML5">[HTML5]</dt><dd>Robin Berjon et al. <a href="http://www.w3.org/TR/html5/"><cite>HTML5</cite></a>. 17 December 2012. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a>
 </dd><dt id="bib-RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119.  URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a> 
 </dd><dt id="bib-WEBCRYPTO">[WEBCRYPTO]</dt><dd>Ryan Sleevi, David Dahl. <a href="http://www.w3.org/TR/WebCryptoAPI/"><cite>Web Cryptography API.</cite></a> W3C Working Draft (Work in progress.) URL: <a href="http://www.w3.org/TR/WebCryptoAPI/">http://www.w3.org/TR/WebCryptoAPI/</a> 
-</dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd>Cameron McCormack. <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/"><cite>Web IDL.</cite></a> 27 September 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a> 
-</dd><dt id="bib-WEBWORKERS">[WEBWORKERS]</dt><dd>Ian Hickson. <a href="http://www.w3.org/TR/2011/WD-workers-20110901/"><cite>Web Workers.</cite></a> 1 September 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-workers-20110901/">http://www.w3.org/TR/2011/WD-workers-20110901/</a> 
-</dd></dl></section><section id="informative-references"><h3><span class="secno">A.2 </span>Informative references</h3><dl class="bibliography"><dt id="bib-COOKIES">[COOKIES]</dt><dd>Adam Barth. <cite><a href="http://www.rfc-editor.org/rfc/rfc6265.txt">HTTP State Management Mechanism</a>.</cite> April 2011. Internet Proposed Standard RFC 6265. URL: <a href="http://www.rfc-editor.org/rfc/rfc6265.txt">http://www.rfc-editor.org/rfc/rfc6265.txt</a> 
-</dd><dt id="bib-INDEXEDDB">[INDEXEDDB]</dt><dd>Nikunj Mehta, Jonas Sicking, Eliot Graff, Andrei Popescu, Jeremy Orlow. <a href="http://www.w3.org/TR/IndexedDB/">Indexed Database API</a>. April 2011. Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/IndexedDB/">http://www.w3.org/TR/IndexedDB/</a>
+</dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd>Cameron McCormack. <a href="http://www.w3.org/TR/WebIDL/"><cite>Web IDL</cite></a>. 19 April 2012. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a>
+</dd><dt id="bib-WEBWORKERS">[WEBWORKERS]</dt><dd>Ian Hickson. <a href="http://www.w3.org/TR/workers/"><cite>Web Workers</cite></a>. 01 May 2012. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/workers/">http://www.w3.org/TR/workers/</a>
+</dd></dl></section><section id="informative-references"><h3><span class="secno">A.2 </span>Informative references</h3><dl class="bibliography"><dt id="bib-COOKIES">[COOKIES]</dt><dd>A. Barth. <a href="http://www.ietf.org/rfc/rfc6265.txt"><cite>HTTP State Management Mechanism</cite></a>. April 2011. RFC. URL: <a href="http://www.ietf.org/rfc/rfc6265.txt">http://www.ietf.org/rfc/rfc6265.txt</a>
+</dd><dt id="bib-INDEXEDDB">[INDEXEDDB]</dt><dd>Nikunj Mehta; Jonas Sicking; Eliot Graff; Andrei Popescu; Jeremy Orlow. <a href="http://www.w3.org/TR/IndexedDB/"><cite>Indexed Database API</cite></a>. 24 May 2012. W3C Last Call Working Draft. URL: <a href="http://www.w3.org/TR/IndexedDB/">http://www.w3.org/TR/IndexedDB/</a>
 </dd></dl></section></section></body></html>
\ No newline at end of file
--- a/keydiscovery-source.html	Mon Jan 07 14:01:11 2013 -0800
+++ b/keydiscovery-source.html	Mon Jul 08 15:24:18 2013 -0700
@@ -40,15 +40,15 @@
       For the three scripts below, if your spec resides on dev.w3 you can check them
       out in the same tree and use relative links so that they'll work offline,
      -->
-    <script src='http://www.w3.org/Tools/respec/respec-w3c-common' class='remove' async></script>
+    <script src='http://darobin.github.com/respec/builds/respec-w3c-common.js' class='remove' async></script>
     <script type="text/javascript" class='remove'>
-      var respecConfig = {  specStatus: "WD",
+      var respecConfig = {  specStatus: "ED",
                             shortName: "webcrypto-key-discovery",
                             editors: [{ name: "Mark Watson", 
                                         mailto: "watsonm@netflix.com", 
                                         company: "Netflix", 
                                         companyURL: "http://www.netflix.com/"} ],
-                            publishDate: "2013-01-08",
+                            publishDate: "2013-07-08",
                             // previousPublishDate:  "2012-05-02",
                             // edEnd:  "",
                             previousMaturity: "ED",
@@ -241,7 +241,7 @@
     <section>
       <h2>API definition</h2>
       <section class="informative"><h3>Overview</h3>
-      <p>This specification defines a new <a><code>cryptokeys</code></a> attribute on the <a><code>Window</code></a> and <a><code>WorkerGlobalScope</code></a> objects. This attribute is an object supporting a method, <a><code>getkeysByName</code></a> which may be used to get an array of all keys matching a <code>DOMString</code> name specifier. Keys are returned as <a>NamedKey</a> objects which are subclasses of the <a><code>Key</code></a> class.</p></section>
+      <p>This specification defines a new <a><code>cryptokeys</code></a> attribute on the <a><code>Window</code></a> and <a><code>WorkerGlobalScope</code></a> objects. This attribute is an object supporting a method, <a><code>getKeyByName</code></a> which may be used to get an array of all keys matching a <code>DOMString</code> name specifier. Keys are returned as <a>NamedKey</a> objects which are subclasses of the <a><code>Key</code></a> class.</p></section>
       
       <section><h3>NamedKey interface</h3>
         <dl title="interface NamedKey : Key" class="idl">
@@ -273,33 +273,31 @@
       </section>
       <section><h3>CryptoKeys interface</h3>
         <dl title="[NoInterfaceObject] interface CryptoKeys" class="idl">
-          <dt><a href-"http://www.w3.org/TR/WebCryptoAPI/#dfn-KeyOperation">KeyOperation</a> getKeysByName( DOMString name )</dt>
+          <dt>Promise&lt;any&gt; getKeyByName( DOMString name )</dt>
           <dd>
             <p>When invoked, this method must perform the following steps:
               <ol>
-                <li>Let <var>KeyOp</var> be a newly created object implementing the <code><a href="http://www.w3.org/TR/WebCryptoAPI/#KeyOperation-interface">KeyOperation</a></code> interface</li>
-                <li>Queue an operation to asynchronously run the following steps:
+                <li>Let <var>promise</var> be a new <a><code>Promise</code></a> and <var>resolver</var> its associated resolver
+                <li>Return <var>promise</var> and continue executing the following steps asynchronously:
                   <ol>
-                    <li>Search for a key or keys matching the name specifier provided in <code>name</code>. A name specifier matches the name of a key if they are identical when expressed as a string of unicode characters.
+                    <li>Search for a key matching the name specifier provided in <code>name</code>. A name specifier matches the name of a key if they are identical when expressed as a string of unicode characters.
                       <dl class="switch">
-                        <dt>If one or more keys are found</dt>
+                        <dt>If a key is found</dt>
                         <dd>
                           <ol>
-                            <li>Let the <code>result</code> attribute of <var>KeyOp</var> be an object of type <code>NamedKey[]</code> containing the keys</li>
-                            <li><a title="queue-a-task">queue a task</a> to <a title="fire-a-simple-event">fire a simple event</a> called <code>onsuccess</code>at <var>KeyOp</var></li>
+                            <li>Let the <var>result</var> be an object of type <code>NamedKey</code> representing the key</li>
+                            <li>Execute <var>resolver</var>'s <code>resolve(value)</code> algorithm with <var>result</var> as the <code>value</code> argument</li>
                           </ol>
                         </dd>
                         <dt>Otherwise</dt>
-                        <dd><a title="queue-a-task">queue a task</a> to <a title="fire-a-simple-event">fire a simple event</a> called <code>onerror</code> at <var>KeyOp</var></dd>
+                        <dd>Execute <var>resolver</var>'s <code>resolve(value)</code> algorithm with <code>null</code> as the <code>value</code> argument</dd>
                       </dl>
                     </li>
                   </ol>
                 </li>
-                <li>Return <var>KeyOp</var> to the task that invoked <a>getKeysByName</a></li>
               </ol>
             </p>
-            
-            <p>A name specifier matches the name of a key if they are identical when expressed as a string of unicode characters. If no matching keys are found, and empty array is returned.</p></dd>
+            </dd>
         </dl>
       </section>