{"record":{"id":"30640e9b06f1b218","repo":"jwtk/jjwt","slug":"the-specified-elliptic-curve-signing-key-is-not-st","errorCode":null,"errorMessage":"The specified Elliptic Curve signing key is not strong enough to be used with JWT ECDSA signature algorithms.  The JWT specification requires ECDSA keys to be >= 256 bits long.  The specified ECDSA key is ${bitLength} bits.  See https://tools.ietf.org/html/rfc7518#section-3.4 for more information.","messagePattern":"The specified Elliptic Curve signing key is not strong enough to be used with JWT ECDSA signature algorithms\\.  The JWT specification requires ECDSA keys to be >= 256 bits long\\.  The specified ECDSA key is (.+?) bits\\.  See https://tools\\.ietf\\.org/html/rfc7518#section-3\\.4 for more information\\.","errorType":"exception","errorClass":"WeakKeyException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java","lineNumber":650,"sourceCode":"\n        // if we've made it this far in the method, the key is an ECKey due to the instanceof assertions at the\n        // top of the method\n\n        ECKey ecKey = (ECKey) key;\n        int bitLength = ecKey.getParams().getOrder().bitLength();\n\n        for (SignatureAlgorithm alg : PREFERRED_EC_ALGS) {\n            if (bitLength >= alg.minKeyLength) {\n                alg.assertValidSigningKey(key);\n                return alg;\n            }\n        }\n\n        String msg = \"The specified Elliptic Curve signing key is not strong enough to be used with JWT ECDSA \" +\n                \"signature algorithms.  The JWT specification requires ECDSA keys to be >= 256 bits long.  \" +\n                \"The specified ECDSA key is \" + bitLength + \" bits.  See \" +\n                \"https://tools.ietf.org/html/rfc7518#section-3.4 for more information.\";\n        throw new WeakKeyException(msg);\n    }\n\n    /**\n     * Looks up and returns the corresponding {@code SignatureAlgorithm} enum instance based on a\n     * case-<em>insensitive</em> name comparison.\n     *\n     * @param value The case-insensitive name of the {@code SignatureAlgorithm} instance to return\n     * @return the corresponding {@code SignatureAlgorithm} enum instance based on a\n     * case-<em>insensitive</em> name comparison.\n     * @throws SignatureException if the specified value does not match any {@code SignatureAlgorithm}\n     *                            name.\n     */\n    public static SignatureAlgorithm forName(String value) throws SignatureException {\n        for (SignatureAlgorithm alg : values()) {\n            if (alg.getValue().equalsIgnoreCase(value)) {\n                return alg;\n            }\n        }","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/jwtk/jjwt/blob/fb71496164c71442d08adec4571d9616ed5e1b8d/api/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java#L632-L668","documentation":"Error \"The specified Elliptic Curve signing key is not strong enough to be used with JWT ECDSA signature algorithms.  The JWT specification requires ECDSA keys to be >= 256 bits long.  The specified ECDSA key is ${bitLength} bits.  See https://tools.ietf.org/html/rfc7518#section-3.4 for more information.\" thrown in jwtk/jjwt.","triggerScenarios":"Thrown at api/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java:650 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Generate a compliant EC key pair with Keys.keyPairFor(SignatureAlgorithm.ES256) or a larger curve (ES384/ES512) matching the desired algorithm.","Use a curve whose order is >=256 bits (P-256 or larger); avoid small/odd curves like secp112/secp192.","Match the ES* algorithm to the curve: >=256 bits allows ES256, >=384 ES384, >=512 ES512."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb71496164c71442d08adec4571d9616ed5e1b8d","analyzedAt":"2026-09-09T00:33:09.982Z","contentChangedAt":"2026-09-09T00:33:09.982Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}