{"record":{"id":"87ae7752280ab37f","repo":"jwtk/jjwt","slug":"unrecognized-okp-jwk-param-value-crvid","errorCode":null,"errorMessage":"Unrecognized OKP JWK ${param} value '${crvId}'","messagePattern":"Unrecognized OKP JWK (.+?) value '(.+?)'","errorType":"exception","errorClass":"UnsupportedKeyException","httpStatus":null,"severity":"error","filePath":"impl/src/main/java/io/jsonwebtoken/impl/security/OctetJwkFactory.java","lineNumber":43,"sourceCode":"\npublic abstract class OctetJwkFactory<K extends Key, J extends Jwk<K>> extends AbstractFamilyJwkFactory<K, J> {\n\n    OctetJwkFactory(Class<K> keyType, Set<Parameter<?>> params) {\n        super(DefaultOctetPublicJwk.TYPE_VALUE, keyType, params);\n    }\n\n    @Override\n    public boolean supports(Key key) {\n        return super.supports(key) && EdwardsCurve.isEdwards(key);\n    }\n\n    protected static EdwardsCurve getCurve(final ParameterReadable reader) throws UnsupportedKeyException {\n        Parameter<String> param = DefaultOctetPublicJwk.CRV;\n        String crvId = reader.get(param);\n        EdwardsCurve curve = EdwardsCurve.findById(crvId);\n        if (curve == null) {\n            String msg = \"Unrecognized OKP JWK \" + param + \" value '\" + crvId + \"'\";\n            throw new UnsupportedKeyException(msg);\n        }\n        return curve;\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":48,"githubUrl":"https://github.com/jwtk/jjwt/blob/fb71496164c71442d08adec4571d9616ed5e1b8d/impl/src/main/java/io/jsonwebtoken/impl/security/OctetJwkFactory.java#L25-L48","documentation":"When converting an OKP (Octet Key Pair) JWK, the 'crv' parameter must identify a supported Edwards curve (Ed25519 or Ed448). If EdwardsCurve.findById(crvId) returns null for the given value, an UnsupportedKeyException is thrown.","triggerScenarios":"Parsing or building an OKP JWK whose 'crv' value is null, misspelled, or an unsupported curve name (anything other than 'Ed25519' or 'Ed448').","commonSituations":"Copy-pasted JWKs from other implementations with case mismatches ('ed25519' vs 'Ed25519'), typos in the crv field, or JWKs from curves this JJWT version does not support.","solutions":["Set crv exactly to a supported value: 'Ed25519' or 'Ed448' (case-sensitive).","Upgrade JJWT to a version that supports the desired Edwards curve.","Wrap JWK parsing in try-catch for UnsupportedKeyException to handle foreign keys gracefully."],"exampleFix":"// before\n{\"kty\":\"OKP\",\"crv\":\"ed25519\",\"x\":\"...\"}\n// after\n{\"kty\":\"OKP\",\"crv\":\"Ed25519\",\"x\":\"...\"}","handlingStrategy":"validation","validationCode":"String crv = jwk.get(\"crv\", String.class);\nif (!\"Ed25519\".equals(crv) && !\"Ed448\".equals(crv)) {\n    throw new UnsupportedKeyException(\"Unsupported OKP crv: \" + crv);\n}","typeGuard":null,"tryCatchPattern":"try {\n    Jwk jwk = Jwks.parser().build().parse(json);\n} catch (UnsupportedKeyException e) {\n    // unknown/unsupported crv\n}","preventionTips":["Use exact RFC 8037 crv names (case-sensitive)","Check JJWT release notes for supported curves","Validate external JWKs before ingestion"],"tags":["jwk","jwt","keys"],"backgroundTag":"invalid-enum-value","analyzedSha":"fb71496164c71442d08adec4571d9616ed5e1b8d","analyzedAt":"2026-09-09T00:33:09.982Z","contentChangedAt":"2026-09-09T00:33:09.982Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}