Update editors draft for promises language, example and misc fixes
authorMark Watson <watsonm@netflix.com>
Thu, 15 May 2014 11:50:56 -0700
changeset 19 25441662e0ac
parent 18 8d7eeeaad746
child 20 0e6b21a932c8
Update editors draft for promises language, example and misc fixes
Overview.html
keydiscovery-source.html
--- a/Overview.html	Wed Aug 21 07:55:57 2013 -0700
+++ b/Overview.html	Thu May 15 11:50:56 2014 -0700
@@ -151,45 +151,44 @@
 .section dl.attrs dd, .section dl.eldef dd {
     margin-bottom:  0;
 }
-</style><style>/* --- ISSUES/NOTES --- */
-div.issue-title, div.note-title {
-    padding-right:  1em;
+
+@media print {
+    .removeOnSave {
+        display: none;
+    }
+}
+</style><style>/* --- EXAMPLES --- */
+div.example-title {
     min-width: 7.5em;
     color: #b9ab2d;
 }
-div.issue-title { color: #e05252; }
-div.note-title { color: #2b2; }
-div.issue-title span, div.note-title span {
-    text-transform: uppercase;
+div.example-title span {
+    text-transform: uppercase;   
 }
-div.note, div.issue {
-    margin-top: 1em;
-    margin-bottom: 1em;
-}
-.note > p:first-child, .issue > p:first-child { margin-top: 0 }
-.issue, .note {
-    padding: .5em;
-    border-left-width: .5em;
-    border-left-style: solid;
-}
-div.issue, div.note {
-    padding: 1em 1.2em 0.5em;
+aside.example, div.example, div.illegal-example {
+    padding: 0.5em;
     margin: 1em 0;
     position: relative;
     clear: both;
 }
-span.note, span.issue { padding: .1em .5em .15em; }
-
-.issue {
-    border-color: #e05252;
-    background: #fbe9e9;
-}
-.note {
-    border-color: #52e052;
-    background: #e9fbe9;
+div.illegal-example { color: red }
+div.illegal-example p { color: black }
+aside.example, div.example {
+    padding: .5em;
+    border-left-width: .5em;
+    border-left-style: solid;
+    border-color: #e0cb52;
+    background: #fcfaee;    
 }
 
-
+aside.example div.example {
+    border-left-width: .1em;
+    border-color: #999;
+    background: #fff;
+}
+aside.example div.example div.example-title {
+    color: #999;
+}
 </style><style>/* --- WEB IDL --- */
 pre.idl {
     border-top: 1px solid #90b8de;
@@ -428,7 +427,7 @@
   </p>
   <h1 class="title p-name" id="title" property="dcterms:title">WebCrypto Key Discovery</h1>
   
-  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-07-08T07:00:00.000Z" 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>
+  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-08-22T07:00:00.000Z" id="w3c-editor-s-draft-22-august-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2013-08-22">22 August 2013</time></h2>
   <dl>
     
       <dt>This version:</dt>
@@ -443,6 +442,7 @@
     
     
     
+    
       
     
     
@@ -453,6 +453,39 @@
 
     
     
+      
+        
+          <dt>Participate:</dt>
+          
+             
+                
+                  <dd>
+                    <a href="mailto:public-webcrypto-comments@w3.org">
+                      Submit a comment
+                    </a>
+                  </dd>
+                
+             
+                
+                  <dd>
+                    <a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=Web%20Cryptography&amp;component=Web%20Cryptography%20API%20Document">
+                      File a bug
+                    </a>
+                  </dd>
+                
+             
+                
+                  <dd>
+                    <a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=Web%20Cryptography&amp;component=Web%20Cryptography%20API%20Document&amp;resolution=---">
+                      See existing bugs
+                    </a>
+                  </dd>
+                
+             
+          
+        
+      
+    
   </dl>
   
   
@@ -466,80 +499,88 @@
         <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>, <a href="http://ev.buaa.edu.cn/">Beihang</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.
+        
+          <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
+        
+        rules apply.
       </p>
     
   
   <hr>
 </div>
-    <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#abstract" rel="bibo:chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2>
+    <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#abstract" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2>
       <p>This specification describes a JavaScript API for discovering named, origin-specific pre-provisioned
       cryptographic keys for use with the Web Cryptography API. Pre-provisioned keys are keys which have been made
-      available to the UA by means other than the generation, derivation, importation functions of the
+      available to the UA by means other than the generation, derivation, importation and unwrapping functions of the
       Web Cryptography API. Origin-specific keys are keys that are available only to a specified origin. Named keys
       are identified by a name assumed to be known to the origin in question and provisioned with the key itself.
+      This specification concerns only keys which have all three of these properties.
       </p>
-    </section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#sotd" rel="bibo:chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2>
+    </section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#sotd" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2>
   
     
       
         <p>
-          <em>This section describes the status of this document at the time of its publication. Other
-          documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
-          of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
-          index</a> at http://www.w3.org/TR/.</em>
+          <em>This section describes the status of this document at the time of its publication.
+          Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the
+          latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at
+          http://www.w3.org/TR/.</em>
         </p>
         
-      <p>This document is the First Public Working Draft of the WebCrypto Key Discovery recommendation. It defines an API that provides access to named origin-specific pre-provisioned keys.
-      Such keys were previously accessible through the KeyStorage API of the main WebCrypto API, which provided for both key storage and key
-      discovery. The KeyStorage API has been removed in favour of using
-      existing web storage mechanisms for key storage and this specification
-      for named origin-specific
-      pre-provisioned key discovery. The privacy issues associated with such keys require special attention and
-      the privacy related material in this document has not yet received thorough review by the community. It is an open issue in the
-      Web Cryptography Working Group whether the scope of this document may be expanded to discovery of other kinds of key.</p>
+      <p>This document is an Editor's Draft of the WebCrypto Key Discovery recommendation. It defines an API that provides access to named origin-specific pre-provisioned keys.
+      The privacy issues associated with such keys require special attention and
+      the privacy related material in this document has not yet received thorough review by the community.</p>
     
         <p>
           This document was published by the <a href="http://www.w3.org/2012/webcrypto/">Web Cryptography WG</a> as an Editor's Draft.
           
           
-          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> 
-          (<a href="mailto:public-webcrypto-request@w3.org?subject=subscribe">subscribe</a>,
-          <a href="http://lists.w3.org/Archives/Public/public-webcrypto/">archives</a>).
+            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> 
+            (<a href="mailto:public-webcrypto-request@w3.org?subject=subscribe">subscribe</a>,
+            <a href="http://lists.w3.org/Archives/Public/public-webcrypto/">archives</a>).
           
           
           
           
-            All comments are welcome.</p>
+            All comments are welcome.
           
+        </p>
+        
         
           <p>
-            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.
+            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>
         
         
+        
         <p>
           
             This document was produced by a group operating under the 
-             
-                <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
-            
+            <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent
+            Policy</a>.
           
           
           
             
-              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/54174/status" rel="disclosure">public list of any patent disclosures</a> 
+              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/54174/status" rel="disclosure">public list of any patent
+              disclosures</a> 
             
-            made in connection with the deliverables of the group; that page also includes instructions for 
-            disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
-            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
-            information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
+            made in connection with the deliverables of the group; that page also includes
+            instructions for disclosing a patent. An individual who has actual knowledge of a patent
+            which the individual believes contains
+            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
+            Claim(s)</a> must disclose the information in accordance with
+            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
             6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
           
           
@@ -548,7 +589,7 @@
       
     
   
-</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#use-cases" class="tocxref"><span class="secno">2. </span>Use cases</a><ul class="toc"><li class="tocline"><a href="#out-of-band-key-provisioning" class="tocxref"><span class="secno">2.1 </span>Out of band key provisioning</a></li></ul></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">3. </span>Conformance</a></li><li class="tocline"><a href="#scope" class="tocxref"><span class="secno">4. </span>Scope</a></li><li class="tocline"><a href="#privacy-considerations" class="tocxref"><span class="secno">5. </span>Privacy considerations</a><ul class="toc"><li class="tocline"><a href="#named-origin-specific-pre-provisioned-keys" class="tocxref"><span class="secno">5.1 </span>Named origin-specific pre-provisioned keys</a><ul class="toc"><li class="tocline"><a href="#comparison-to-cookies-and-persistent-storage" class="tocxref"><span class="secno">5.1.1 </span>Comparison to cookies and persistent storage</a></li><li class="tocline"><a href="#user-tracking" class="tocxref"><span class="secno">5.1.2 </span>User tracking</a></li><li class="tocline"><a href="#cookie-resurrection" class="tocxref"><span class="secno">5.1.3 </span>Cookie resurrection</a></li><li class="tocline"><a href="#sensitivity-of-data" class="tocxref"><span class="secno">5.1.4 </span>Sensitivity of data</a></li></ul></li></ul></li><li class="tocline"><a href="#dependencies" class="tocxref"><span class="secno">6. </span>Dependencies</a></li><li class="tocline"><a href="#api-definition" class="tocxref"><span class="secno">7. </span>API definition</a><ul class="toc"><li class="tocline"><a href="#overview" class="tocxref"><span class="secno">7.1 </span>Overview</a></li><li class="tocline"><a href="#namedkey-interface" class="tocxref"><span class="secno">7.2 </span>NamedKey interface</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">7.2.1 </span>Attributes</a></li><li class="tocline"><a href="#structured-clone-algorithm" class="tocxref"><span class="secno">7.2.2 </span>Structured clone algorithm</a></li><li class="tocline"><a href="#immutability-of-namedkey-objects" class="tocxref"><span class="secno">7.2.3 </span>Immutability of NamedKey objects</a></li></ul></li><li class="tocline"><a href="#cryptokeys-interface" class="tocxref"><span class="secno">7.3 </span>CryptoKeys interface</a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">7.3.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#extension-of-window-interface" class="tocxref"><span class="secno">7.4 </span>Extension of Window interface</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">7.4.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#extension-of-workerglobalscope-interface" class="tocxref"><span class="secno">7.5 </span>Extension of WorkerGlobalScope interface</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">7.5.1 </span>Attributes</a></li></ul></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">8. </span>Examples</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></section>
+</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a></li><li class="tocline"><a href="#scope" class="tocxref"><span class="secno">3. </span>Scope</a></li><li class="tocline"><a href="#privacy-considerations" class="tocxref"><span class="secno">4. </span>Privacy considerations</a><ul class="toc"><li class="tocline"><a href="#named-origin-specific-pre-provisioned-keys" class="tocxref"><span class="secno">4.1 </span>Named origin-specific pre-provisioned keys</a><ul class="toc"><li class="tocline"><a href="#comparison-to-cookies-and-persistent-storage" class="tocxref"><span class="secno">4.1.1 </span>Comparison to cookies and persistent storage</a></li><li class="tocline"><a href="#user-tracking" class="tocxref"><span class="secno">4.1.2 </span>User tracking</a></li><li class="tocline"><a href="#cookie-resurrection" class="tocxref"><span class="secno">4.1.3 </span>Cookie resurrection</a></li><li class="tocline"><a href="#sensitivity-of-data" class="tocxref"><span class="secno">4.1.4 </span>Sensitivity of data</a></li></ul></li></ul></li><li class="tocline"><a href="#dependencies" class="tocxref"><span class="secno">5. </span>Dependencies</a></li><li class="tocline"><a href="#api-definition" class="tocxref"><span class="secno">6. </span>API definition</a><ul class="toc"><li class="tocline"><a href="#overview" class="tocxref"><span class="secno">6.1 </span>Overview</a></li><li class="tocline"><a href="#namedkey-interface" class="tocxref"><span class="secno">6.2 </span>NamedKey interface</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">6.2.1 </span>Attributes</a></li><li class="tocline"><a href="#structured-clone-algorithm" class="tocxref"><span class="secno">6.2.2 </span>Structured clone algorithm</a></li><li class="tocline"><a href="#immutability-of-namedkey-objects" class="tocxref"><span class="secno">6.2.3 </span>Immutability of NamedKey objects</a></li></ul></li><li class="tocline"><a href="#cryptokeys-interface" class="tocxref"><span class="secno">6.3 </span>CryptoKeys interface</a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">6.3.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#extension-of-window-interface" class="tocxref"><span class="secno">6.4 </span>Extension of Window interface</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">6.4.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#extension-of-workerglobalscope-interface" class="tocxref"><span class="secno">6.5 </span>Extension of WorkerGlobalScope interface</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">6.5.1 </span>Attributes</a></li></ul></li></ul></li><li class="tocline"><a href="#example" class="tocxref"><span class="secno">7. </span>Example</a><ul class="toc"><li class="tocline"><a href="#using-a-pre-provisioned-aes-kw-key-to-unwrap-a-session-key" class="tocxref"><span class="secno">7.1 </span>Using a pre-provisioned AES-KW key to unwrap a session key</a></li></ul></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></section>
     
     
     
@@ -557,13 +598,13 @@
       <p>
         The Web Cryptography API [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>] describes a JavaScript API for performing basic cryptographic
         operations in web applications. Cryptographic keys in are represented in this API using
-        <a href="http://www.w3.org/TR/WebCryptoAPI/#key-interface"><code>Key</code></a> objects. The API provides methods to generate, derive or import cryptographic 
+        <a href="http://www.w3.org/TR/WebCryptoAPI/#key-interface"><code>Key</code></a> objects. The API provides methods to generate, derive, import and unwrap cryptographic 
         keying material, so creating <a href="http://www.w3.org/TR/WebCryptoAPI/#key-interface"><code>Key</code></a> objects.
       </p>
       <p>This document concerns the discovery of cryptographic keys which are made available to the UA by other means.
         Specifically, this document provides an API for the discovery of cryptographic keys which have been pre-provisioned
          into a UA or device for use by a specific origin. Such keys are identified by names which are assumed to be known to 
-         the origin in question and thus they are referred to as <dfn title="named origin-specific pre-provisioned key" id="dfn-named-origin-specific-pre-provisioned-key">named origin-specific pre-provisioned keys</dfn>.</p>
+         the origin in question and thus they are referred to as <dfn id="dfn-named-origin-specific-pre-provisioned-keys">named origin-specific pre-provisioned keys</dfn>.</p>
       <p>This enables web applications to establish secure proof that the UA has access to a particular
         pre-provisioned key. Depending on the nature of the key and its associated storage - for example within
         a Hardware Security Module or available only within a Trusted Execution Environment - further properties of the
@@ -574,19 +615,7 @@
       </p>
     </section>
     
-    <section id="use-cases">
-        <!--OddPage--><h2 aria-level="1" role="heading" id="h2_use-cases"><span class="secno">2. </span>Use cases</h2>
-        <section id="out-of-band-key-provisioning">
-          <h3 aria-level="2" role="heading" id="h3_out-of-band-key-provisioning"><span class="secno">2.1 </span>Out of band key provisioning</h3>
-          <p>Web applications may wish to use keys that have been provisioned through means outside the scope of the WebCrypto API. This may include keys that are provisioned through platform-specific native APIs, stored in secure elements such as trusted platform modules (TPMs), individually bound to devices at time of manufacturing or otherwise installed via device-specific provisioning protocols.</p>
-          <p>Such keys may, for example, be used to assist in identifying a device to a specific web service. User agents may choose to expose such keys to web applications after implementing appropriate security and privacy mitigations, including gaining user consent.</p>
-
-<p>In this scenario, a web application discovers a pre-provisioned key based on its name and uses it to perform authorized cryptographic operations as part of a protocol with a server. The server may utilize knowledge obtained out-of-band regarding the key's provisioning to make access control and policy decisions, such as inferring the identity of the device and customizing its responses based on that.</p>
-        </section>
-        <p></p>
-    </section>
-    
-    <section id="conformance" typeof="bibo:Chapter" resource="#conformance" rel="bibo:chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_conformance"><span class="secno">3. </span>Conformance</h2>
+    <section id="conformance" typeof="bibo:Chapter" resource="#conformance" rel="bibo:Chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_conformance"><span class="secno">2. </span>Conformance</h2>
 <p>
   As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
   and notes in this specification are non-normative. Everything else in this specification is
@@ -627,20 +656,20 @@
       
     </section>
     
-    <section id="scope" class="informative" typeof="bibo:Chapter" resource="#scope" rel="bibo:chapter">
-      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_scope"><span class="secno">4. </span>Scope</h2><p><em>This section is non-normative.</em></p>
-      <p>The considerations in the Scope section of [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>] apply to this specification as well. In particular, although this specification directly addresses the discovery of <a>named origin-specific pre-provisioned keys</a>, it does not address the processes used to provision those keys or the type and properties of the hardware or software components in which they are stored.</p>
+    <section id="scope" class="informative" typeof="bibo:Chapter" resource="#scope" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_scope"><span class="secno">3. </span>Scope</h2><p><em>This section is non-normative.</em></p>
+      <p>The considerations in the Scope section of [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>] apply to this specification as well. In particular, although this specification directly addresses the discovery of <a href="#dfn-named-origin-specific-pre-provisioned-keys" class="internalDFN">named origin-specific pre-provisioned keys</a>, it does not address the processes used to provision those keys or the type and properties of the hardware or software components in which they are stored.</p>
     </section>
     <section class="informative" id="privacy-considerations">
-      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_privacy-considerations"><span class="secno">5. </span>Privacy considerations</h2><p><em>This section is non-normative.</em></p>
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_privacy-considerations"><span class="secno">4. </span>Privacy considerations</h2><p><em>This section is non-normative.</em></p>
       <p>The Privacy considerations of [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>] apply to this specification.</p>
       <section id="named-origin-specific-pre-provisioned-keys">
-        <h3 aria-level="2" role="heading" id="h3_named-origin-specific-pre-provisioned-keys"><span class="secno">5.1 </span>Named origin-specific pre-provisioned keys</h3><p><em>This section is non-normative.</em></p>
-        <section id="comparison-to-cookies-and-persistent-storage"><h4 aria-level="3" role="heading" id="h4_comparison-to-cookies-and-persistent-storage"><span class="secno">5.1.1 </span>Comparison to cookies and persistent storage</h4><p><em>This section is non-normative.</em></p>
+        <h3 aria-level="2" role="heading" id="h3_named-origin-specific-pre-provisioned-keys"><span class="secno">4.1 </span>Named origin-specific pre-provisioned keys</h3>
+        <section id="comparison-to-cookies-and-persistent-storage"><h4 aria-level="3" role="heading" id="h4_comparison-to-cookies-and-persistent-storage"><span class="secno">4.1.1 </span>Comparison to cookies and persistent storage</h4>
         <p>The privacy considerations associated with origin-specific pre-provisioned keys are similar to those that apply to cookies [<cite><a class="bibref" href="#bib-COOKIES">COOKIES</a></cite>] and persistent storage, such as [<cite><a class="bibref" href="#bib-INDEXEDDB">INDEXEDDB</a></cite>]. The principle difference is that pre-provisioned keys are pre-existing, whereas cookies and persistent store are not. Thus sites can be relied upon to work (in an 'out-of-the-box' fashion) when cookies have been deleted and persistent store cleared. By contrast, sites that rely on pre-provisioned keys may not operate or may operate in a different fashion if the expected pre-provisioned keys are not available. Such sites may require users to choose whether to trade a certain amount of privacy for whatever service the site offers, or not access the service at all.</p></section>
         
         <section id="user-tracking">
-          <h4 aria-level="3" role="heading" id="h4_user-tracking"><span class="secno">5.1.2 </span>User tracking</h4>
+          <h4 aria-level="3" role="heading" id="h4_user-tracking"><span class="secno">4.1.2 </span>User tracking</h4>
   
           <p>A third-party host (or any object capable of getting content distributed to multiple sites) could use a named origin-specific pre-provisioned key to track a user across multiple sessions, building a profile of the user's activities. In conjunction with a site that is aware of the user's real identity (for example an e-commerce site that requires authenticated credentials), this could allow oppressive groups to target individuals with greater accuracy than in a world with purely anonymous Web usage.</p>
           
@@ -676,12 +705,12 @@
           <p>However, user tracking is to some extent possible even with no cooperation from the user agent whatsoever, for instance by using session identifiers in URLs, a technique already commonly used for innocuous purposes but easily repurposed for user tracking (even retroactively). This information can then be shared with other sites, using visitors' IP addresses and other user-specific data (e.g. user-agent headers and configuration settings) to combine separate sessions into coherent user profiles.</p>
         </section>
         <section id="cookie-resurrection">
-          <h4 aria-level="3" role="heading" id="h4_cookie-resurrection"><span class="secno">5.1.3 </span>Cookie resurrection</h4>
+          <h4 aria-level="3" role="heading" id="h4_cookie-resurrection"><span class="secno">4.1.3 </span>Cookie resurrection</h4>
   
           <p>If the user interface for the origin-specific pre-provisioned keys feature described in this specification presents data separately from data in HTTP session cookies or persistent storage, then users are likely to modify site authorization or delete data in one and not the others. This would allow sites to use the various features as redundant backup for each other, defeating a user's attempts to protect his privacy.</p>
         </section>
         <section id="sensitivity-of-data">
-          <h4 aria-level="3" role="heading" id="h4_sensitivity-of-data"><span class="secno">5.1.4 </span>Sensitivity of data</h4>
+          <h4 aria-level="3" role="heading" id="h4_sensitivity-of-data"><span class="secno">4.1.4 </span>Sensitivity of data</h4>
   
           <p>User agents should treat pre-provisioned keys and material generated using such keys as potentially sensitive; it is quite possible for the user privacy to be compromised by the release of this information.</p>
   
@@ -690,8 +719,8 @@
       </section>
     </section>
     
-    <section class="section" id="dependencies" typeof="bibo:Chapter" resource="#dependencies" rel="bibo:chapter">
-      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_dependencies"><span class="secno">6. </span>Dependencies</h2>
+    <section class="section" id="dependencies" typeof="bibo:Chapter" resource="#dependencies" rel="bibo:Chapter">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_dependencies"><span class="secno">5. </span>Dependencies</h2>
       <p>
         This specification relies on several other underlying specifications. 
       </p>
@@ -701,14 +730,12 @@
           <dfn title="Window" id="dfn-window"><code>Window</code></dfn>,
           <dfn title="Function" id="dfn-function"><code>Function</code></dfn>,
           <dfn id="dfn-origin">origin</dfn>, <dfn id="dfn-same-origin">same origin</dfn>, <dfn id="dfn-structured-clone">structured clone</dfn>,
-          <dfn id="dfn-structured-clone-algorithm">structured clone algorithm</dfn>, <dfn id="dfn-task">task</dfn>, <dfn id="dfn-task-source">task source</dfn>, 
-          <dfn title="queue-a-task" id="dfn-queue-a-task">queue a task</dfn>
-          and <dfn title="fire-a-simple-event" id="dfn-fire-a-simple-event">fire a simple event</dfn> are defined by the HTML 5 
+          and <dfn id="dfn-structured-clone-algorithm">structured clone algorithm</dfn> are defined by the HTML 5 
           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>
-          <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>
+          <p>The term <dfn title="Key" id="dfn-key"><code>Key</code></dfn> is defined in [<cite><a class="bibref" href="#bib-WEBCRYPTO">WEBCRYPTO</a></cite>].</p>
         </dd>
         <dt>WebIDL</dt>
         <dd>Many of the interface definitions and all of the IDL in this spec depends on [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>].</dd>
@@ -719,20 +746,21 @@
     </section>
 
     <section id="api-definition">
-      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_api-definition"><span class="secno">7. </span>API definition</h2>
-      <section class="informative" id="overview"><h3 aria-level="2" role="heading" id="h3_overview"><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="#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>
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_api-definition"><span class="secno">6. </span>API definition</h2>
+      <section class="informative" id="overview"><h3 aria-level="2" role="heading" id="h3_overview"><span class="secno">6.1 </span>Overview</h3><p><em>This section is non-normative.</em></p>
+      <p>This specification defines a new <code>cryptokeys</code> 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, <code>getKeyByName</code> which may be used to get the key with a given name. 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 aria-level="2" role="heading" id="h3_namedkey-interface"><span class="secno">7.2 </span>NamedKey interface</h3>
+      <section id="namedkey-interface"><h3 aria-level="2" role="heading" id="h3_namedkey-interface"><span class="secno">6.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 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 aria-level="3" role="heading" id="h4_attributes"><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>
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType">DOMString</span>  <span class="idlAttrName"><a href="#widl-NamedKey-name">name</a></span>;</span>
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType">DOMString?</span> <span class="idlAttrName"><a href="#widl-NamedKey-id">id</a></span>;</span>
+};</span></pre><section id="attributes"><h4 aria-level="3" role="heading" id="h4_attributes"><span class="secno">6.2.1 </span>Attributes</h4><dl class="attributes"><dt id="widl-NamedKey-id"><code>id</code> of type <span class="idlAttrType">DOMString</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" aria-level="4" role="heading" id="h_note_1"><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 aria-level="3" role="heading" id="h4_structured-clone-algorithm"><span class="secno">7.2.2 </span>Structured clone algorithm</h4>
+            <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 <code>name</code> 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 <code>id</code>. If no identifier matching these conditions exists, <code>id</code> <em class="rfc2119" title="MUST">MUST</em> be <code>null</code>.</p>
+          </dd><dt id="widl-NamedKey-name"><code>name</code> of type <span class="idlAttrType">DOMString</span>, readonly   </dt><dd><p>A local identifier for the key.</p></dd></dl></section>
+        <section id="structured-clone-algorithm"><h4 aria-level="3" role="heading" id="h4_structured-clone-algorithm"><span class="secno">6.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>
           <li>Let <var>input</var> and <var>memory</var> be the corresponding inputs defined by the <a title="structured clone algorithm" href="#dfn-structured-clone-algorithm" class="internalDFN">internal structured clone algorithm</a>, where <var>input</var> is a <a href="#idl-def-NamedKey" class="idlType"><code>NamedKey</code></a> object to be cloned.</li>
@@ -745,52 +773,77 @@
         </ol>
         </section>
 
-        <section id="immutability-of-namedkey-objects"><h4 aria-level="3" role="heading" id="h4_immutability-of-namedkey-objects"><span class="secno">7.2.3 </span>Immutability of NamedKey objects</h4>
+        <section id="immutability-of-namedkey-objects"><h4 aria-level="3" role="heading" id="h4_immutability-of-namedkey-objects"><span class="secno">6.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>
         </section>
       </section>
-      <section id="cryptokeys-interface"><h3 aria-level="2" role="heading" id="h3_cryptokeys-interface"><span class="secno">7.3 </span>CryptoKeys interface</h3>
+      <section id="cryptokeys-interface"><h3 aria-level="2" role="heading" id="h3_cryptokeys-interface"><span class="secno">6.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>Promise</a></span> <span class="idlMethName"><a href="#widl-CryptoKeys-getKeyByName-Promise-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 aria-level="3" role="heading" id="h4_methods"><span class="secno">7.3.1 </span>Methods</h4><dl class="methods"><dt id="widl-CryptoKeys-getKeyByName-Promise-DOMString-name"><code>getKeyByName</code></dt><dd>
+<span class="idlMethod">    <span class="idlMethType">Promise</span> <span class="idlMethName"><a href="#widl-CryptoKeys-getKeyByName-Promise-DOMString-name">getKeyByName</a></span> (<span class="idlParam"><span class="idlParamType">DOMString</span> <span class="idlParamName">name</span></span>);</span>
+};</span></pre><section id="methods"><h4 aria-level="3" role="heading" id="h4_methods"><span class="secno">6.3.1 </span>Methods</h4><dl class="methods"><dt id="widl-CryptoKeys-getKeyByName-Promise-DOMString-name"><code>getKeyByName</code></dt><dd>
             <p>When invoked, this method must perform the following steps:
               </p><ol>
-                <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 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 a key is found</dt>
-                        <dd>
-                          <ol>
-                            <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>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>Let <var>promise</var> be a new <code>Promise</code>
+                </li><li>Make an asynchronous request to 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 a key is found</dt>
+                    <dd>
+                      <ol>
+                        <li>Let the <var>result</var> be an object of type <code>NamedKey</code> representing the key.</li>
+                        <li>Resolve <var>promise</var> with <var>result</var>.</li>
+                      </ol>
+                    </dd>
+                    <dt>Otherwise</dt>
+                    <dd>Resolve <var>promise</var> with <code>null</code>.
+                  </dd></dl>
                 </li>
+                <li>Return <var>promise</var>.</li>
               </ol>
             <p></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>Promise</a></code></div></dd></dl></section>
+          <table class="parameters"><tbody><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>DOMString</code></td><td class="prmNullFalse"><span role="img" aria-label="False">✘</span></td><td class="prmOptFalse"><span role="img" aria-label="False">✘</span></td><td class="prmDesc"></td></tr></tbody></table><div><em>Return type: </em><code>Promise</code></div></dd></dl></section>
       </section>
       
-      <section id="extension-of-window-interface"><h3 aria-level="2" role="heading" id="h3_extension-of-window-interface"><span class="secno">7.4 </span>Extension of Window interface</h3>
+      <section id="extension-of-window-interface"><h3 aria-level="2" role="heading" id="h3_extension-of-window-interface"><span class="secno">6.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 aria-level="3" role="heading" id="h4_attributes-1"><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></pre><section id="attributes-1"><h4 aria-level="3" role="heading" id="h4_attributes-1"><span class="secno">6.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 aria-level="2" role="heading" id="h3_extension-of-workerglobalscope-interface"><span class="secno">7.5 </span>Extension of WorkerGlobalScope interface</h3>
+      <section id="extension-of-workerglobalscope-interface"><h3 aria-level="2" role="heading" id="h3_extension-of-workerglobalscope-interface"><span class="secno">6.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 aria-level="3" role="heading" id="h4_attributes-2"><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></pre><section id="attributes-2"><h4 aria-level="3" role="heading" id="h4_attributes-2"><span class="secno">6.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 aria-level="1" role="heading" id="h2_examples"><span class="secno">8. </span>Examples</h2></section>
+    <section id="example">
+      <!--OddPage--><h2 aria-level="1" role="heading" id="h2_example"><span class="secno">7. </span>Example</h2>
+      <section id="using-a-pre-provisioned-aes-kw-key-to-unwrap-a-session-key">
+        <h3 aria-level="2" role="heading" id="h3_using-a-pre-provisioned-aes-kw-key-to-unwrap-a-session-key"><span class="secno">7.1 </span>Using a pre-provisioned AES-KW key to unwrap a session key</h3>
+          <div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example">window.cryptokeys.getKeyByName( "Kunwrap" ).then( function( key ) {
+
+  if ( key === null ) {
+    console.error( "Unwrapping key, 'Kunwrap', not found.");
+  } else {
+    // Call a function to get a wrapped session key from the server, based on key.id
+    getSessionKeyForId( key.id ).then( function( wrappedJwkKeyData ) {
+      
+      window.crypto.subtle.unwrapKey( 'jwk',
+                wrappedJwkKeyData,            // the wrapped JWK session key
+                key,                          // the pre-provisoned unwrapping key
+                { name: 'AES-KW' },           // the key wrapping algorithm
+                { name: 'AES-GCM' },          // the algorithm the unwrapped key will be used with
+                false,                        // the result must not be extractable
+                [ 'encrypt', 'decrypt' ]      // we'll use the result for encrypt and decrypt
+                ).then( function( sessionKey ) {
+                
+          // use session key here for secure communication bound to the pre-provisioned key
+                
+       }, console.error.bind( console, "Unwrapping returned an error" ) );
+    }, console.error.bind( console, "Could not get session key from server" ) );
+  }
+});</pre></div>
+      </section>
+    </section>
     <!--
     <section class='appendix'>
       <h2>Acknowledgements</h2>
@@ -801,11 +854,11 @@
     -->
   
 
-<section id="references" class="appendix" typeof="bibo:Chapter" resource="#references" rel="bibo:chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_references"><span class="secno">A. </span>References</h2><section id="normative-references" typeof="bibo:Chapter" resource="#normative-references" rel="bibo:chapter"><h3 aria-level="2" role="heading" id="h3_normative-references"><span class="secno">A.1 </span>Normative references</h3><dl class="bibliography" about=""><dt id="bib-HTML5">[HTML5]</dt><dd rel="dcterms:requires">Robin Berjon; Steve Faulkner; Travis Leithead; Erika Doyle Navara; Edward O'Connor; Silvia Pfeiffer. <a href="http://www.w3.org/TR/html5/"><cite>HTML5</cite></a>. 6 August 2013. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a>
+<section id="references" class="appendix" typeof="bibo:Chapter" resource="#references" rel="bibo:Chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_references"><span class="secno">A. </span>References</h2><section id="normative-references" typeof="bibo:Chapter" resource="#normative-references" rel="bibo:Chapter"><h3 aria-level="2" role="heading" id="h3_normative-references"><span class="secno">A.1 </span>Normative references</h3><dl class="bibliography" about=""><dt id="bib-HTML5">[HTML5]</dt><dd rel="dcterms:requires">Robin Berjon; Steve Faulkner; Travis Leithead; Erika Doyle Navara; Edward O'Connor; Silvia Pfeiffer. <a href="http://www.w3.org/TR/html5/"><cite>HTML5</cite></a>. 29 April 2014. 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 rel="dcterms:requires">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 rel="dcterms:requires">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-WEBCRYPTO">[WEBCRYPTO]</dt><dd rel="dcterms:requires">Ryan Sleevi, Mark Watson <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 rel="dcterms:requires">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 rel="dcterms:requires">Ian Hickson. <a href="http://www.w3.org/TR/workers/"><cite>Web Workers</cite></a>. 1 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" typeof="bibo:Chapter" resource="#informative-references" rel="bibo:chapter"><h3 aria-level="2" role="heading" id="h3_informative-references"><span class="secno">A.2 </span>Informative references</h3><dl class="bibliography" about=""><dt id="bib-COOKIES">[COOKIES]</dt><dd rel="dcterms:references">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></dl></section><section id="informative-references" typeof="bibo:Chapter" resource="#informative-references" rel="bibo:Chapter"><h3 aria-level="2" role="heading" id="h3_informative-references"><span class="secno">A.2 </span>Informative references</h3><dl class="bibliography" about=""><dt id="bib-COOKIES">[COOKIES]</dt><dd rel="dcterms:references">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 rel="dcterms:references">Nikunj Mehta; Jonas Sicking; Eliot Graff; Andrei Popescu; Jeremy Orlow; Joshua Bell. <a href="http://www.w3.org/TR/IndexedDB/"><cite>Indexed Database API</cite></a>. 4 July 2013. W3C Candidate Recommendation. 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	Wed Aug 21 07:55:57 2013 -0700
+++ b/keydiscovery-source.html	Thu May 15 11:50:56 2014 -0700
@@ -42,7 +42,7 @@
      -->
     <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", 
@@ -57,7 +57,11 @@
                             wgURI:        "http://www.w3.org/2012/webcrypto/",
                             wgPublicList: "public-webcrypto",
                             wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/54174/status",
-                            localBiblio : { "WEBCRYPTO" : "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> "}
+                            localBiblio : { "WEBCRYPTO" : "Ryan Sleevi, Mark Watson <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> "},
+                            otherLinks: [ { key: "Participate", data: [
+                                { value: "Submit a comment", href: "mailto:public-webcrypto-comments@w3.org" },
+                                { value: "File a bug", href: "https://www.w3.org/Bugs/Public/enter_bug.cgi?product=Web%20Cryptography&component=Web%20Cryptography%20API%20Document" },
+                                { value: "See existing bugs", href: "https://www.w3.org/Bugs/Public/buglist.cgi?product=Web%20Cryptography&component=Web%20Cryptography%20API%20Document&resolution=---" } ] } ]
                         };
     </script>
   </head>
@@ -65,21 +69,17 @@
     <section id='abstract'>
       <p>This specification describes a JavaScript API for discovering named, origin-specific pre-provisioned
       cryptographic keys for use with the Web Cryptography API. Pre-provisioned keys are keys which have been made
-      available to the UA by means other than the generation, derivation, importation functions of the
+      available to the UA by means other than the generation, derivation, importation and unwrapping functions of the
       Web Cryptography API. Origin-specific keys are keys that are available only to a specified origin. Named keys
       are identified by a name assumed to be known to the origin in question and provisioned with the key itself.
+      This specification concerns only keys which have all three of these properties.
       </p>
     </section>
     
     <section id="sotd">
-      <p>This document is the First Public Working Draft of the WebCrypto Key Discovery recommendation. It defines an API that provides access to named origin-specific pre-provisioned keys.
-      Such keys were previously accessible through the KeyStorage API of the main WebCrypto API, which provided for both key storage and key
-      discovery. The KeyStorage API has been removed in favour of using
-      existing web storage mechanisms for key storage and this specification
-      for named origin-specific
-      pre-provisioned key discovery. The privacy issues associated with such keys require special attention and
-      the privacy related material in this document has not yet received thorough review by the community. It is an open issue in the
-      Web Cryptography Working Group whether the scope of this document may be expanded to discovery of other kinds of key.</p>
+      <p>This document is an Editor's Draft of the WebCrypto Key Discovery recommendation. It defines an API that provides access to named origin-specific pre-provisioned keys.
+      The privacy issues associated with such keys require special attention and
+      the privacy related material in this document has not yet received thorough review by the community.</p>
     </section>
     
     <section class="informative">
@@ -87,13 +87,13 @@
       <p>
         The Web Cryptography API [[!WEBCRYPTO]] describes a JavaScript API for performing basic cryptographic
         operations in web applications. Cryptographic keys in are represented in this API using
-        <a href='http://www.w3.org/TR/WebCryptoAPI/#key-interface'><code>Key</code></a> objects. The API provides methods to generate, derive or import cryptographic 
+        <a href='http://www.w3.org/TR/WebCryptoAPI/#key-interface'><code>Key</code></a> objects. The API provides methods to generate, derive, import and unwrap cryptographic 
         keying material, so creating <a href='http://www.w3.org/TR/WebCryptoAPI/#key-interface'><code>Key</code></a> objects.
       </p>
       <p>This document concerns the discovery of cryptographic keys which are made available to the UA by other means.
         Specifically, this document provides an API for the discovery of cryptographic keys which have been pre-provisioned
          into a UA or device for use by a specific origin. Such keys are identified by names which are assumed to be known to 
-         the origin in question and thus they are referred to as <dfn title="named origin-specific pre-provisioned key">named origin-specific pre-provisioned keys</dfn>.</p>
+         the origin in question and thus they are referred to as <dfn>named origin-specific pre-provisioned keys</dfn>.</p>
       <p>This enables web applications to establish secure proof that the UA has access to a particular
         pre-provisioned key. Depending on the nature of the key and its associated storage - for example within
         a Hardware Security Module or available only within a Trusted Execution Environment - further properties of the
@@ -104,18 +104,6 @@
       </p>
     </section>
     
-    <section>
-        <h2>Use cases</h2>
-        <section>
-          <h3>Out of band key provisioning</h3>
-          <p>Web applications may wish to use keys that have been provisioned through means outside the scope of the WebCrypto API. This may include keys that are provisioned through platform-specific native APIs, stored in secure elements such as trusted platform modules (TPMs), individually bound to devices at time of manufacturing or otherwise installed via device-specific provisioning protocols.</p>
-          <p>Such keys may, for example, be used to assist in identifying a device to a specific web service. User agents may choose to expose such keys to web applications after implementing appropriate security and privacy mitigations, including gaining user consent.</p>
-
-<p>In this scenario, a web application discovers a pre-provisioned key based on its name and uses it to perform authorized cryptographic operations as part of a protocol with a server. The server may utilize knowledge obtained out-of-band regarding the key's provisioning to make access control and policy decisions, such as inferring the identity of the device and customizing its responses based on that.</p>
-        </section>
-        <p></p>
-    </section>
-    
     <section id="conformance">
       
       <p>
@@ -221,14 +209,12 @@
           <dfn title="Window"><code>Window</code></dfn>,
           <dfn title="Function"><code>Function</code></dfn>,
           <dfn>origin</dfn>, <dfn>same origin</dfn>, <dfn>structured clone</dfn>,
-          <dfn>structured clone algorithm</dfn>, <dfn>task</dfn>, <dfn>task source</dfn>, 
-          <dfn title="queue-a-task">queue a task</dfn>
-          and <dfn title="fire-a-simple-event">fire a simple event</dfn> are defined by the HTML 5 
+          and <dfn>structured clone algorithm</dfn> are defined by the HTML 5 
           specification [[!HTML5]].
         </dd>
         <dt>Web Cryptography API</dt>
         <dd><p>A <a>conforming user agent</a> MUST support the Web Cryptography API [[!WEBCRYPTO]].</p>
-          <p>The terms <dfn title="Key"><code>Key</code></dfn> and <dfn title="KeyOperation"><code>KeyOperation</code></dfn> are defined in [[!WEBCRYPTO]].</p>
+          <p>The term <dfn title="Key"><code>Key</code></dfn> is defined in [[!WEBCRYPTO]].</p>
         </dd>
         <dt>WebIDL</dt>
         <dd>Many of the interface definitions and all of the IDL in this spec depends on [[!WEBIDL]].</dd>
@@ -241,7 +227,9 @@
     <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>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>
+      <p>This specification defines a new <a title="cryptokeys"><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 title="getKeyByName"><code>getKeyByName</code></a> which may be used to get the key with a given name. 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">
@@ -251,7 +239,6 @@
           <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>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 SHOULD be exposed, base64 encoded, as the <a><code>id</code></a>. If no identifier matching these conditions exists, <a><code>id</code></a> MUST be <code>null</code>.</p>
-            <p class="note">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>
           </dd>
         </dl>
         <section><h4>Structured clone algorithm</h4>
@@ -273,37 +260,34 @@
       </section>
       <section><h3>CryptoKeys interface</h3>
         <dl title="[NoInterfaceObject] interface CryptoKeys" class="idl">
-          <dt>Promise getKeyByName( DOMString name )</dt>
+          <dt>Promise <dfn>getKeyByName</dfn>( DOMString name )</dt>
           <dd>
             <p>When invoked, this method must perform the following steps:
               <ol>
-                <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 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 a key is found</dt>
-                        <dd>
-                          <ol>
-                            <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>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>Let <var>promise</var> be a new <a><code>Promise</code></a>
+                <li>Make an asynchronous request to 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 a key is found</dt>
+                    <dd>
+                      <ol>
+                        <li>Let the <var>result</var> be an object of type <code>NamedKey</code> representing the key.</li>
+                        <li>Resolve <var>promise</var> with <var>result</var>.</li>
+                      </ol>
+                    </dd>
+                    <dt>Otherwise</dt>
+                    <dd>Resolve <var>promise</var> with <code>null</code>.
+                  </dl>
                 </li>
+                <li>Return <var>promise</var>.</li>
               </ol>
             </p>
-            </dd>
+          </dd>
         </dl>
       </section>
       
       <section><h3>Extension of Window interface</h3>
       <dl title="partial interface Window" class="idl">
-        <dt>readonly attribute CryptoKeys cryptokeys</dt>
+        <dt>readonly attribute CryptoKeys <dfn>cryptokeys</dfn></dt>
         <dd>The object that exposes the key discovery methods</dd>
       </dl></section>
       
@@ -314,7 +298,37 @@
       </dl></section>
     </section>
     
-    <section><h2>Examples</h2></section>
+    <section>
+      <h2>Example</h2>
+      <section>
+        <h3>Using a pre-provisioned AES-KW key to unwrap a session key</h3>
+          <pre class="example">
+            window.cryptokeys.getKeyByName( "Kunwrap" ).then( function( key ) {
+            
+              if ( key === null ) {
+                console.error( "Unwrapping key, 'Kunwrap', not found.");
+              } else {
+                // Call a function to get a wrapped session key from the server, based on key.id
+                getSessionKeyForId( key.id ).then( function( wrappedJwkKeyData ) {
+                  
+                  window.crypto.subtle.unwrapKey( 'jwk',
+                            wrappedJwkKeyData,            // the wrapped JWK session key
+                            key,                          // the pre-provisoned unwrapping key
+                            { name: 'AES-KW' },           // the key wrapping algorithm
+                            { name: 'AES-GCM' },          // the algorithm the unwrapped key will be used with
+                            false,                        // the result must not be extractable
+                            [ 'encrypt', 'decrypt' ]      // we'll use the result for encrypt and decrypt
+                            ).then( function( sessionKey ) {
+                            
+                      // use session key here for secure communication bound to the pre-provisioned key
+                            
+                   }, console.error.bind( console, "Unwrapping returned an error" ) );
+                }, console.error.bind( console, "Could not get session key from server" ) );
+              }
+            });
+          </pre>
+      </section>
+    </section>
     <!--
     <section class='appendix'>
       <h2>Acknowledgements</h2>