ISSUE-17 and ISSUE-25: Remove the KeyAttributes object
authorRyan Sleevi <sleevi@google.com>
Mon, 03 Dec 2012 17:16:36 -0800
changeset 6 9baa26b28e78
parent 5 d9331d9ca55b
child 7 6e40e2c600d6
ISSUE-17 and ISSUE-25: Remove the KeyAttributes object

In light of the Key object following the structured clone, the following is true:
- For Keys created by an application (KeyGenerator), all attributes can be stored
in existing web storage mechanisms. The need for 'read-only' attributes is based
on a presumption of defense against XSS - which is not the intent. As such,
applications can associate whatever attributes they want with a Key, in the same
storage mechanism of the Key itself, and simply note not to modify the attributes.
- For Keys that are provided by an "external" source (eg: pre-provisioned device
specific keys), the attributes - and means of exposing these attributes - are
defined by the source itself. Since these attributes are either implementation
or application specific, they should be dictated by the spec that details how
the implementation/application behaves.

Applications that wish to pass around Key objects with custom properties can
always do so through extending or wrapping the object, obtaining and/or enumerating
the properties from the underlying key storage backend. By NOT specifying this
behaviour, it allows maximum flexibility for both application developers and
implementors, and avoids having to try to normalize all possible naming and
attribute schemes into a single API pattern.
spec/Overview-WebCryptoAPI.xml
spec/Overview.html
--- a/spec/Overview-WebCryptoAPI.xml	Mon Dec 03 17:16:28 2012 -0800
+++ b/spec/Overview-WebCryptoAPI.xml	Mon Dec 03 17:16:36 2012 -0800
@@ -740,7 +740,7 @@
           </dl>
         </div>
       </div>
-      
+
       <div id="key-interface" class="section">
         <h2>Key interface</h2>
         <p>
@@ -748,15 +748,6 @@
           user agent.
         </p>
         <x:codeblock language="idl">
-<span class="comment">
-// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/17">ISSUE-17</a>
-interface <dfn id="dfn-KeyAttributes">KeyAttributes</dfn> {
-  getter DOMString getAttribute(DOMString name);
-  setter creator void setAttribute(DOMString name, DOMString value);
-  deleter void removeAttribute(DOMString name);
-};
-</span>
-
 enum <dfn id="dfn-KeyType">KeyType</dfn> {
   "secret",
   "public",
@@ -777,10 +768,6 @@
   readonly attribute bool <a href="#dfn-Key-temporary">temporary</a>;
   readonly attribute <a href="#dfn-Algorithm">Algorithm</a> <a href="#dfn-Key-algorithm">algorithm</a>;
   readonly attribute <a href="#dfn-KeyUsage">KeyUsage</a>[] <a href="#dfn-Key-keyUsage">keyUsage</a>;
-
- <span class="comment">// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/17">ISSUE-17</a></span>
-  <span class="comment">// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/25">ISSUE-25</a></span>
-  attribute <a href="#dfn-KeyAttributes">KeyAttributes</a> <a href="#dfn-Key-extra">extra</a>;
 };
         </x:codeblock>
         <div id="key-interface-description" class="section">
@@ -832,24 +819,6 @@
               indicate what <a href="#dfn-CryptoOperation">CryptoOperations</a> may be used with this
               key.
             </dd>
-            <dt id="dfn-Key-extra"><code>extra</code></dt>
-            <dd>
-              Application-defined attributes that are associated with a key.
-              <div class="ednote">
-                <p>
-                  <a href="https://www.w3.org/2012/webcrypto/track/issues/17">ISSUE-17</a>
-                  TBD: Whether or not key-specific storage is exposed to the application or if it is
-                  left up to <a href="http://www.w3.org/TR/webstorage/">Web Storage</a> or
-                  <a href="http://www.w3.org/TR/IndexedDB/">IndexedDB</a>.
-                </p>
-                <p>
-                  <a href="https://www.w3.org/2012/webcrypto/track/issues/25">ISSUE-25</a>
-                  TBD: Whether pre-provisioned keys should support some well-known attribute that
-                  defines a pre-provisioned ID, or whether such definitions are application-specific
-                  and not part of the spec.
-                </p>
-              </div>
-            </dd>
           </dl>
         </div>
 
@@ -877,7 +846,6 @@
                 <li><a href="#dfn-Key-temporary">temporary</a></li>
                 <li><a href="#dfn-Key-Algorithm">Algorithm</a></li>
                 <li><a href="#dfn-Key-KeyUsage">KeyUsage</a></li>
-                <li><a href="#dfn-Key-KeyAttributes">keyAttributes</a></li>
               </ul>
             </li>
             <li>
--- a/spec/Overview.html	Mon Dec 03 17:16:28 2012 -0800
+++ b/spec/Overview.html	Mon Dec 03 17:16:36 2012 -0800
@@ -46,7 +46,7 @@
 communications.
       </p>
   
-      <div class="ednote"><div class="ednoteHeader">Editorial note</div><p>There are 11 further editorial notes in the document.</p></div>
+      <div class="ednote"><div class="ednoteHeader">Editorial note</div><p>There are 10 further editorial notes in the document.</p></div>
     </div>
 
     <div class="section">
@@ -736,7 +736,7 @@
           </dl>
         </div>
       </div>
-      
+
       <div id="key-interface" class="section">
         <h2>11. Key interface</h2>
         <p>
@@ -744,15 +744,6 @@
           user agent.
         </p>
         <div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code">
-<span class="comment">
-// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/17">ISSUE-17</a>
-interface <dfn id="dfn-KeyAttributes">KeyAttributes</dfn> {
-  getter DOMString getAttribute(DOMString name);
-  setter creator void setAttribute(DOMString name, DOMString value);
-  deleter void removeAttribute(DOMString name);
-};
-</span>
-
 enum <dfn id="dfn-KeyType">KeyType</dfn> {
   "secret",
   "public",
@@ -773,10 +764,6 @@
   readonly attribute bool <a href="#dfn-Key-temporary">temporary</a>;
   readonly attribute <a href="#dfn-Algorithm">Algorithm</a> <a href="#dfn-Key-algorithm">algorithm</a>;
   readonly attribute <a href="#dfn-KeyUsage">KeyUsage</a>[] <a href="#dfn-Key-keyUsage">keyUsage</a>;
-
- <span class="comment">// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/17">ISSUE-17</a></span>
-  <span class="comment">// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/25">ISSUE-25</a></span>
-  attribute <a href="#dfn-KeyAttributes">KeyAttributes</a> <a href="#dfn-Key-extra">extra</a>;
 };
         </code></pre></div></div>
         <div id="key-interface-description" class="section">
@@ -828,24 +815,6 @@
               indicate what <a href="#dfn-CryptoOperation">CryptoOperations</a> may be used with this
               key.
             </dd>
-            <dt id="dfn-Key-extra"><code>extra</code></dt>
-            <dd>
-              Application-defined attributes that are associated with a key.
-              <div class="ednote"><div class="ednoteHeader">Editorial note</div>
-                <p>
-                  <a href="https://www.w3.org/2012/webcrypto/track/issues/17">ISSUE-17</a>
-                  TBD: Whether or not key-specific storage is exposed to the application or if it is
-                  left up to <a href="http://www.w3.org/TR/webstorage/">Web Storage</a> or
-                  <a href="http://www.w3.org/TR/IndexedDB/">IndexedDB</a>.
-                </p>
-                <p>
-                  <a href="https://www.w3.org/2012/webcrypto/track/issues/25">ISSUE-25</a>
-                  TBD: Whether pre-provisioned keys should support some well-known attribute that
-                  defines a pre-provisioned ID, or whether such definitions are application-specific
-                  and not part of the spec.
-                </p>
-              </div>
-            </dd>
           </dl>
         </div>
 
@@ -873,7 +842,6 @@
                 <li><a href="#dfn-Key-temporary">temporary</a></li>
                 <li><a href="#dfn-Key-Algorithm">Algorithm</a></li>
                 <li><a href="#dfn-Key-KeyUsage">KeyUsage</a></li>
-                <li><a href="#dfn-Key-KeyAttributes">keyAttributes</a></li>
               </ul>
             </li>
             <li>