Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit bf5f161

Browse files
authored
Set and check "alg" JWK property for EdDSA keys (#3)
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".
1 parent 4eeeea0 commit bf5f161

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

index.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,14 @@ <h4>Operations</h4>
22302230
{{DataError}}.
22312231
</p>
22322232
</li>
2233+
<li>
2234+
<p>
2235+
If the {{JsonWebKey/alg}} field of <var>jwk</var> is present and is
2236+
not <code>"EdDSA"</code>,
2237+
then [= exception/throw =] a
2238+
{{DataError}}.
2239+
</p>
2240+
</li>
22332241
<li>
22342242
<p>
22352243
If <var>usages</var> is non-empty and the {{JsonWebKey/use}} field of <var>jwk</var> is present and is
@@ -2524,6 +2532,12 @@ <h4>Operations</h4>
25242532
<code>"OKP"</code>.
25252533
</p>
25262534
</li>
2535+
<li>
2536+
<p>
2537+
Set the <code>alg</code> attribute of <var>jwk</var> to
2538+
<code>"EdDSA"</code>.
2539+
</p>
2540+
</li>
25272541
<li>
25282542
<p>
25292543
Set the <code>crv</code> attribute of <var>jwk</var> to
@@ -3110,6 +3124,14 @@ <h4>Operations</h4>
31103124
{{DataError}}.
31113125
</p>
31123126
</li>
3127+
<li>
3128+
<p>
3129+
If the {{JsonWebKey/alg}} field of <var>jwk</var> is present and is
3130+
not <code>"EdDSA"</code>,
3131+
then [= exception/throw =] a
3132+
{{DataError}}.
3133+
</p>
3134+
</li>
31133135
<li>
31143136
<p>
31153137
If <var>usages</var> is non-empty and the {{JsonWebKey/use}} field of <var>jwk</var> is present and is
@@ -3404,6 +3426,12 @@ <h4>Operations</h4>
34043426
<code>"OKP"</code>.
34053427
</p>
34063428
</li>
3429+
<li>
3430+
<p>
3431+
Set the <code>alg</code> attribute of <var>jwk</var> to
3432+
<code>"EdDSA"</code>.
3433+
</p>
3434+
</li>
34073435
<li>
34083436
<p>
34093437
Set the <code>crv</code> attribute of <var>jwk</var> to

0 commit comments

Comments
 (0)