@@ -525,6 +525,18 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
525
525
* <td>4096 <= size <sup>5</sup></td>
526
526
* <td>{@link StandardSecureDigestAlgorithms#RS512 RS512}</td>
527
527
* </tr>
528
+ * <tr>
529
+ * <td><a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/security/interfaces/EdECKey.html">EdECKey</a><sup>7</sup></td>
530
+ * <td><code>instanceof {@link PrivateKey}</code></td>
531
+ * <td>256</td>
532
+ * <td>{@link StandardSecureDigestAlgorithms#Ed25519 Ed25519}</td>
533
+ * </tr>
534
+ * <tr>
535
+ * <td><a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/security/interfaces/EdECKey.html">EdECKey</a><sup>7</sup></td>
536
+ * <td><code>instanceof {@link PrivateKey}</code></td>
537
+ * <td>456</td>
538
+ * <td>{@link StandardSecureDigestAlgorithms#Ed448 Ed448}</td>
539
+ * </tr>
528
540
* </tbody>
529
541
* </table>
530
542
* <p>Notes:</p>
@@ -553,6 +565,8 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
553
565
* {@link StandardSecureDigestAlgorithms#RS512 RS512} algorithms, so we assume an RSA signature algorithm based on the key
554
566
* length to parallel similar decisions in the JWT specification for HMAC and ECDSA signature algorithms.
555
567
* This is not required - just a convenience.</li>
568
+ * <li><a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/security/interfaces/EdECKey.html">EdECKey</a>s
569
+ * require JDK >= 15 or BouncyCastle in the runtime classpath.</li>
556
570
* </ol>
557
571
*
558
572
* <p>This implementation does not use the {@link StandardSecureDigestAlgorithms#PS256 PS256},
@@ -564,13 +578,13 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
564
578
* {@link #signWith(Key, SecureDigestAlgorithm)} method instead.</p>
565
579
*
566
580
* <p>Finally, this method will throw an {@link InvalidKeyException} for any key that does not match the
567
- * heuristics and requirements documented above, since that inevitably means the Key is either insufficient or
568
- * explicitly disallowed by the JWT specification.</p>
581
+ * heuristics and requirements documented above, since that inevitably means the Key is either insufficient,
582
+ * unsupported, or explicitly disallowed by the JWT specification.</p>
569
583
*
570
584
* @param key the key to use for signing
571
585
* @return the builder instance for method chaining.
572
- * @throws InvalidKeyException if the Key is insufficient or explicitly disallowed by the JWT specification as
573
- * described above in <em>recommended signature algorithms</em>.
586
+ * @throws InvalidKeyException if the Key is insufficient, unsupported, or explicitly disallowed by the JWT
587
+ * specification as described above in <em>recommended signature algorithms</em>.
574
588
* @see Jwts#SIG
575
589
* @see #signWith(Key, SecureDigestAlgorithm)
576
590
* @since 0.10.0
@@ -751,7 +765,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
751
765
* {@code keyAlg} when invoked with the given {@code key}, producing a JWE.
752
766
*
753
767
* <p>This behavior can be illustrated by the following pseudocode, a rough example of what happens during
754
- * {@link #compact() compact}ion:</p>
768
+ * {@link #compact() compact}ion:</p>
755
769
* <blockquote><pre>
756
770
* SecretKey encryptionKey = keyAlg.getEncryptionKey(key); // (1)
757
771
* byte[] jweCiphertext = enc.encrypt(payloadBytes, encryptionKey); // (2)</pre></blockquote>
0 commit comments