Skip to content

Commit

Permalink
Set and check "alg" JWK property for EdDSA keys (#3)
Browse files Browse the repository at this point in the history
When exporting Ed25519 and Ed448 keys as JWK, set the "alg" property to "EdDSA".

When importing Ed25519 and Ed448 keys from JWK, if the "alg" property exists,
check that it is "EdDSA".
  • Loading branch information
panva committed Dec 9, 2021
1 parent 4eeeea0 commit bf5f161
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,14 @@ <h4>Operations</h4>
{{DataError}}.
</p>
</li>
<li>
<p>
If the {{JsonWebKey/alg}} field of <var>jwk</var> is present and is
not <code>"EdDSA"</code>,
then [= exception/throw =] a
{{DataError}}.
</p>
</li>
<li>
<p>
If <var>usages</var> is non-empty and the {{JsonWebKey/use}} field of <var>jwk</var> is present and is
Expand Down Expand Up @@ -2524,6 +2532,12 @@ <h4>Operations</h4>
<code>"OKP"</code>.
</p>
</li>
<li>
<p>
Set the <code>alg</code> attribute of <var>jwk</var> to
<code>"EdDSA"</code>.
</p>
</li>
<li>
<p>
Set the <code>crv</code> attribute of <var>jwk</var> to
Expand Down Expand Up @@ -3110,6 +3124,14 @@ <h4>Operations</h4>
{{DataError}}.
</p>
</li>
<li>
<p>
If the {{JsonWebKey/alg}} field of <var>jwk</var> is present and is
not <code>"EdDSA"</code>,
then [= exception/throw =] a
{{DataError}}.
</p>
</li>
<li>
<p>
If <var>usages</var> is non-empty and the {{JsonWebKey/use}} field of <var>jwk</var> is present and is
Expand Down Expand Up @@ -3404,6 +3426,12 @@ <h4>Operations</h4>
<code>"OKP"</code>.
</p>
</li>
<li>
<p>
Set the <code>alg</code> attribute of <var>jwk</var> to
<code>"EdDSA"</code>.
</p>
</li>
<li>
<p>
Set the <code>crv</code> attribute of <var>jwk</var> to
Expand Down

0 comments on commit bf5f161

Please sign in to comment.