Skip to content

Commit 6543db8

Browse files
authored
Specify how to handle ML-KEM/DSA PKCS8 keys in non-seed-only formats (#34)
- When importing a key in the `expandedKey` format, throw a `NotSupportedError`. - When importing a key in the `both` format, *optionally* throw a `NotSupportedError`. - Alternatively, when importing a key in the `both` format, require checking that the seed and expanded key match.
1 parent fa0ad23 commit 6543db8

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
@@ -1741,6 +1741,20 @@ <h5>Import Key</h5>
17411741
{{DataError}}.
17421742
</p>
17431743
</li>
1744+
<li>
1745+
<p>
1746+
If |mlKemPrivateKey| represents an ML-KEM key in the `expandedKey` format,
1747+
or if |mlKemPrivateKey| represents an ML-KEM key in the `both` format
1748+
and the `both` format is not supported, throw a {{NotSupportedError}}.
1749+
</p>
1750+
</li>
1751+
<li>
1752+
<p>
1753+
If |mlKemPrivateKey| represents an ML-KEM key in the `both` format,
1754+
and the `seed` field does not correspond to the `expandedKey` field,
1755+
throw a {{DataError}}.
1756+
</p>
1757+
</li>
17441758
<li>
17451759
<p>
17461760
Let |key| be a new {{CryptoKey}}
@@ -2904,6 +2918,20 @@ <h5>Import Key</h5>
29042918
{{DataError}}.
29052919
</p>
29062920
</li>
2921+
<li>
2922+
<p>
2923+
If |mlDsaPrivateKey| represents an ML-DSA key in the `expandedKey` format,
2924+
or if |mlDsaPrivateKey| represents an ML-DSA key in the `both` format
2925+
and the `both` format is not supported, throw a {{NotSupportedError}}.
2926+
</p>
2927+
</li>
2928+
<li>
2929+
<p>
2930+
If |mlDsaPrivateKey| represents an ML-DSA key in the `both` format,
2931+
and the `seed` field does not correspond to the `expandedKey` field,
2932+
throw a {{DataError}}.
2933+
</p>
2934+
</li>
29072935
<li>
29082936
<p>
29092937
Let |key| be a new {{CryptoKey}}

0 commit comments

Comments
 (0)