Skip to content

Commit c826db8

Browse files
committed
Deprecate ES256K Algorithm (#543)
* [SDK-3192] Deprecate secp256k1 curve for EC Algorithms * Documentation update
1 parent fef3ccf commit c826db8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/main/java/com/auth0/jwt/algorithms/Algorithm.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ public static Algorithm HMAC256(byte[] secret) throws IllegalArgumentException {
183183
* @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
184184
* @return a valid ECDSA256 Algorithm.
185185
* @throws IllegalArgumentException if the Key Provider is null.
186+
* @deprecated The SECP-256K1 Curve algorithm has been disabled beginning in Java 15.
187+
* Use of this method in those unsupported Java versions will throw a {@link java.security.SignatureException}.
188+
* This method will be removed in the next major version. See for additional information
186189
*/
190+
@Deprecated
187191
public static Algorithm ECDSA256K(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {
188192
return new ECDSAAlgorithm("ES256K", "SHA256withECDSA", 32, keyProvider);
189193
}
@@ -195,7 +199,11 @@ public static Algorithm ECDSA256K(ECDSAKeyProvider keyProvider) throws IllegalAr
195199
* @param privateKey the key to use in the signing instance.
196200
* @return a valid ECDSA256 Algorithm.
197201
* @throws IllegalArgumentException if the provided Key is null.
202+
* @deprecated The SECP-256K1 Curve algorithm has been disabled beginning in Java 15.
203+
* Use of this method in those unsupported Java versions will throw a {@link java.security.SignatureException}.
204+
* This method will be removed in the next major version. See for additional information
198205
*/
206+
@Deprecated
199207
public static Algorithm ECDSA256K(ECPublicKey publicKey, ECPrivateKey privateKey) throws IllegalArgumentException {
200208
return ECDSA256K(ECDSAAlgorithm.providerForKeys(publicKey, privateKey));
201209
}

0 commit comments

Comments
 (0)