Skip to content

Commit 79841c3

Browse files
authored
Prepare methods for additional KeyFormat enum values (#419)
1 parent a4cd8e0 commit 79841c3

File tree

1 file changed

+22
-34
lines changed

1 file changed

+22
-34
lines changed

spec/Overview.html

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,46 +2301,43 @@ <h4>The importKey method</h4>
23012301
<li>
23022302
<dl class="switch">
23032303
<dt>
2304-
If |format| is equal to the string {{KeyFormat/"raw"}},
2305-
{{KeyFormat/"pkcs8"}}, or {{KeyFormat/"spki"}}:
2304+
If |format| is equal to the string {{KeyFormat/"jwk"}}:
23062305
</dt>
23072306
<dd>
23082307
<ol>
23092308
<li>
23102309
<p>
23112310
If the `keyData` parameter passed to the
2312-
{{SubtleCrypto/importKey()}} method is a
2311+
{{SubtleCrypto/importKey()}} method is not a
23132312
{{JsonWebKey}} dictionary, [= exception/throw =] a
23142313
{{TypeError}}.
23152314
</p>
23162315
</li>
23172316
<li>
23182317
<p>
2319-
Let |keyData| be the result of
2320-
[= get a copy of the buffer source |
2321-
getting a copy of the bytes held by =] the
2322-
`keyData` parameter passed to the
2318+
Let |keyData| be the `keyData` parameter passed to the
23232319
{{SubtleCrypto/importKey()}} method.
23242320
</p>
23252321
</li>
23262322
</ol>
23272323
</dd>
2328-
<dt>
2329-
If |format| is equal to the string {{KeyFormat/"jwk"}}:
2330-
</dt>
2324+
<dt>Otherwise:</dt>
23312325
<dd>
23322326
<ol>
23332327
<li>
23342328
<p>
23352329
If the `keyData` parameter passed to the
2336-
{{SubtleCrypto/importKey()}} method is not a
2330+
{{SubtleCrypto/importKey()}} method is a
23372331
{{JsonWebKey}} dictionary, [= exception/throw =] a
23382332
{{TypeError}}.
23392333
</p>
23402334
</li>
23412335
<li>
23422336
<p>
2343-
Let |keyData| be the `keyData` parameter passed to the
2337+
Let |keyData| be the result of
2338+
[= get a copy of the buffer source |
2339+
getting a copy of the bytes held by =] the
2340+
`keyData` parameter passed to the
23442341
{{SubtleCrypto/importKey()}} method.
23452342
</p>
23462343
</li>
@@ -2515,21 +2512,18 @@ <h4>The exportKey method</h4>
25152512
</li>
25162513
<li>
25172514
<dl class="switch">
2518-
<dt>
2519-
If |format| is equal to the strings {{KeyFormat/"raw"}},
2520-
{{KeyFormat/"pkcs8"}}, or {{KeyFormat/"spki"}}:
2521-
</dt>
2522-
<dd>
2523-
Let |result| be the result of [= ArrayBuffer/create | creating =] an {{ArrayBuffer}}
2524-
in |realm|, containing |result|.
2525-
</dd>
25262515
<dt>
25272516
If |format| is equal to the string {{KeyFormat/"jwk"}}:
25282517
</dt>
25292518
<dd>
25302519
Let |result| be the result of converting |result| to an ECMAScript Object in |realm|,
25312520
as defined by [[WebIDL]].
25322521
</dd>
2522+
<dt>Otherwise:</dt>
2523+
<dd>
2524+
Let |result| be the result of [= ArrayBuffer/create | creating =] an {{ArrayBuffer}}
2525+
in |realm|, containing |result|.
2526+
</dd>
25332527
</dl>
25342528
</li>
25352529
<li>
@@ -2658,13 +2652,6 @@ <h4>The wrapKey method</h4>
26582652
</li>
26592653
<li>
26602654
<dl class="switch">
2661-
<dt>
2662-
If |format| is equal to the strings {{KeyFormat/"raw"}},
2663-
{{KeyFormat/"pkcs8"}}, or {{KeyFormat/"spki"}}:
2664-
</dt>
2665-
<dd>
2666-
Let |bytes| be |exportedKey|.
2667-
</dd>
26682655
<dt>
26692656
If |format| is equal to the string {{KeyFormat/"jwk"}}:
26702657
</dt>
@@ -2685,6 +2672,10 @@ <h4>The wrapKey method</h4>
26852672
</li>
26862673
</ol>
26872674
</dd>
2675+
<dt>Otherwise:</dt>
2676+
<dd>
2677+
Let |bytes| be |exportedKey|.
2678+
</dd>
26882679
</dl>
26892680
<div class=note>
26902681
<p>
@@ -2886,13 +2877,6 @@ <h4>The unwrapKey method</h4>
28862877
</li>
28872878
<li>
28882879
<dl class="switch">
2889-
<dt>
2890-
If |format| is equal to the strings {{KeyFormat/"raw"}},
2891-
{{KeyFormat/"pkcs8"}}, or {{KeyFormat/"spki"}}:
2892-
</dt>
2893-
<dd>
2894-
Let |key| be |bytes|.
2895-
</dd>
28962880
<dt>
28972881
If |format| is equal to the string {{KeyFormat/"jwk"}}:
28982882
</dt>
@@ -2901,6 +2885,10 @@ <h4>The unwrapKey method</h4>
29012885
[= parse a JWK =] algorithm, with |bytes|
29022886
as the `data` to be parsed.
29032887
</dd>
2888+
<dt>Otherwise:</dt>
2889+
<dd>
2890+
Let |key| be |bytes|.
2891+
</dd>
29042892
</dl>
29052893
</li>
29062894
<li>

0 commit comments

Comments
 (0)