Bug 22548 - Specify normalization rules for usages reflected in key.usages
authorMark Watson <watsonm@netflix.com>
Thu, 27 Feb 2014 17:44:40 -0800
changeset 138 ca494eeb8ddf
parent 137 d78264e7d483
child 139 dad087725336
Bug 22548 - Specify normalization rules for usages reflected in key.usages
spec/Overview-WebCryptoAPI.xml
spec/Overview.html
--- a/spec/Overview-WebCryptoAPI.xml	Thu Feb 27 17:08:26 2014 -0800
+++ b/spec/Overview-WebCryptoAPI.xml	Thu Feb 27 17:44:40 2014 -0800
@@ -976,6 +976,21 @@
             </li>
           </ol>
         </p>
+        <p>
+          When this specification says to calculate the <dfn id="concept-usage-intersection">usage
+          intersection</dfn> of two arrays, <var>a</var> and <var>b</var> the result shall be an
+          array containing each <a href="#dfn-RecognizedKeyUsage">recognised key usage value</a>
+          that appears in both <var>a</var> and <var>b</var>, in the order listed in the list of
+          <a href="#dfn-RecognizedKeyUsage">recognised key usage values</a>, where a value is said
+          to appear in an array if an element of the array exists that is a case-sensistive string
+          match for that value.
+        </p>
+        <p>
+          When this specification says to calculate the <dfn id="concept-normalized-usages">
+          normalized value of a usages list</dfn>, <var>usages</var> the result shall be the
+          <a href="#concept-usage-intersection">usage intersection</a> of <var>usages</var> and an
+          array containing all <a href="#dfn-RecognizedKeyUsage">recognised key usage values</a>.
+        </p>
       </div>
 
       <div id="RandomSource-interface" class="section">
@@ -3394,8 +3409,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>publicKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "encrypt", "wrapKey" ]</code>.
+                                <var>publicKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "encrypt", "wrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -3425,8 +3441,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "decrypt", "unwrapKey" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "decrypt", "unwrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -3979,8 +3996,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>publicKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "verify" ]</code>.
+                                <var>publicKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "verify" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -4010,8 +4028,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "sign" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "sign" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -4311,8 +4330,9 @@
                           <li>
                             <p>
                               Set the <a href="#dfn-Key-usages">usages</a> property of
-                              <var>publicKey</var> to be the intersection of <var>usages</var>
-                              and <code>[ "verify" ]</code>.
+                              <var>publicKey</var> to be the
+                              <a href="concept-usage-intersection">usage intersection</a> of
+                              <var>usages</var> and <code>[ "verify" ]</code>.
                             </p>
                           </li>
                           <li>
@@ -4342,8 +4362,9 @@
                           <li>
                             <p>
                               Set the <a href="#dfn-Key-usages">usages</a> property of
-                              <var>privateKey</var> to be the intersection of <var>usages</var>
-                              and <code>[ "sign" ]</code>.
+                              <var>privateKey</var> to be the
+                              <a href="concept-usage-intersection">usage intersection</a> of
+                              <var>usages</var> and <code>[ "sign" ]</code>.
                             </p>
                           </li>
                           <li>
@@ -4649,8 +4670,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>publicKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "encrypt", "wrapKey" ]</code>.
+                                <var>publicKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "encrypt", "wrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -4680,8 +4702,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "decrypt", "unwrapKey" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "decrypt", "unwrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -5185,8 +5208,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "deriveKey", "deriveBits" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "deriveKey", "deriveBits" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -5715,7 +5739,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -6253,7 +6278,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -6751,7 +6777,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -7353,7 +7380,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -7856,7 +7884,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -8330,7 +8359,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -9000,7 +9030,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -9550,7 +9581,9 @@
                       <li>
                         <p>
                           Set the <a href="#dfn-Key-usages">usages</a> property of
-                          <var>key</var> to <var>usages</var>.
+                          <var>key</var> to the
+                          <a href="#concept-normalized-usages">normalized value</a> of
+                          <var>usages</var>.
                         </p>
                       </li>
                       <li>
@@ -9674,7 +9707,9 @@
                       <li>
                         <p>
                           Set the <a href="#dfn-Key-usages">usages</a> property of
-                          <var>key</var> to <var>usages</var>.
+                          <var>key</var> to the
+                          <a href="#concept-normalized-usages">normalized value</a> of
+                          <var>usages</var>.
                         </p>
                       </li>
                       <li>
@@ -9802,7 +9837,9 @@
                       <li>
                         <p>
                           Set the <a href="#dfn-Key-usages">usages</a> property of
-                          <var>key</var> to <var>usages</var>.
+                          <var>key</var> to the
+                          <a href="#concept-normalized-usages">normalized value</a> of
+                          <var>usages</var>.
                         </p>
                       </li>
                       <li>
--- a/spec/Overview.html	Thu Feb 27 17:08:26 2014 -0800
+++ b/spec/Overview.html	Thu Feb 27 17:44:40 2014 -0800
@@ -984,6 +984,21 @@
             </li>
           </ol>
         </p>
+        <p>
+          When this specification says to calculate the <dfn id="concept-usage-intersection">usage
+          intersection</dfn> of two arrays, <var>a</var> and <var>b</var> the result shall be an
+          array containing each <a href="#dfn-RecognizedKeyUsage">recognised key usage value</a>
+          that appears in both <var>a</var> and <var>b</var>, in the order listed in the list of
+          <a href="#dfn-RecognizedKeyUsage">recognised key usage values</a>, where a value is said
+          to appear in an array if an element of the array exists that is a case-sensistive string
+          match for that value.
+        </p>
+        <p>
+          When this specification says to calculate the <dfn id="concept-normalized-usages">
+          normalized value of a usages list</dfn>, <var>usages</var> the result shall be the
+          <a href="#concept-usage-intersection">usage intersection</a> of <var>usages</var> and an
+          array containing all <a href="#dfn-RecognizedKeyUsage">recognised key usage values</a>.
+        </p>
       </div>
 
       <div id="RandomSource-interface" class="section">
@@ -3398,8 +3413,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>publicKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "encrypt", "wrapKey" ]</code>.
+                                <var>publicKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "encrypt", "wrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -3429,8 +3445,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "decrypt", "unwrapKey" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "decrypt", "unwrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -3980,8 +3997,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>publicKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "verify" ]</code>.
+                                <var>publicKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "verify" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -4011,8 +4029,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "sign" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "sign" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -4309,8 +4328,9 @@
                           <li>
                             <p>
                               Set the <a href="#dfn-Key-usages">usages</a> property of
-                              <var>publicKey</var> to be the intersection of <var>usages</var>
-                              and <code>[ "verify" ]</code>.
+                              <var>publicKey</var> to be the
+                              <a href="concept-usage-intersection">usage intersection</a> of
+                              <var>usages</var> and <code>[ "verify" ]</code>.
                             </p>
                           </li>
                           <li>
@@ -4340,8 +4360,9 @@
                           <li>
                             <p>
                               Set the <a href="#dfn-Key-usages">usages</a> property of
-                              <var>privateKey</var> to be the intersection of <var>usages</var>
-                              and <code>[ "sign" ]</code>.
+                              <var>privateKey</var> to be the
+                              <a href="concept-usage-intersection">usage intersection</a> of
+                              <var>usages</var> and <code>[ "sign" ]</code>.
                             </p>
                           </li>
                           <li>
@@ -4644,8 +4665,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>publicKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "encrypt", "wrapKey" ]</code>.
+                                <var>publicKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "encrypt", "wrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -4675,8 +4697,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "decrypt", "unwrapKey" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "decrypt", "unwrapKey" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -5179,8 +5202,9 @@
                             <li>
                               <p>
                                 Set the <a href="#dfn-Key-usages">usages</a> property of
-                                <var>privateKey</var> to be the intersection of <var>usages</var>
-                                and <code>[ "deriveKey", "deriveBits" ]</code>.
+                                <var>privateKey</var> to be the
+                                <a href="concept-usage-intersection">usage intersection</a> of
+                                <var>usages</var> and <code>[ "deriveKey", "deriveBits" ]</code>.
                               </p>
                             </li>
                             <li>
@@ -5708,7 +5732,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -6246,7 +6271,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -6744,7 +6770,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -7346,7 +7373,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -7849,7 +7877,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -8323,7 +8352,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -8993,7 +9023,8 @@
                   <li>
                     <p>
                       Set the <a href="#dfn-Key-usages">usages</a> property of <var>key</var>
-                      to <var>usages</var>.
+                      to the <a href="#concept-normalized-usages">normalized value</a> of
+                      <var>usages</var>.
                     </p>
                   </li>
                   <li>
@@ -9542,7 +9573,9 @@
                       <li>
                         <p>
                           Set the <a href="#dfn-Key-usages">usages</a> property of
-                          <var>key</var> to <var>usages</var>.
+                          <var>key</var> to the
+                          <a href="#concept-normalized-usages">normalized value</a> of
+                          <var>usages</var>.
                         </p>
                       </li>
                       <li>
@@ -9666,7 +9699,9 @@
                       <li>
                         <p>
                           Set the <a href="#dfn-Key-usages">usages</a> property of
-                          <var>key</var> to <var>usages</var>.
+                          <var>key</var> to the
+                          <a href="#concept-normalized-usages">normalized value</a> of
+                          <var>usages</var>.
                         </p>
                       </li>
                       <li>
@@ -9794,7 +9829,9 @@
                       <li>
                         <p>
                           Set the <a href="#dfn-Key-usages">usages</a> property of
-                          <var>key</var> to <var>usages</var>.
+                          <var>key</var> to the
+                          <a href="#concept-normalized-usages">normalized value</a> of
+                          <var>usages</var>.
                         </p>
                       </li>
                       <li>