The "A128CBC-HS256" encryption method is not supported by the JWE encrypter
Issue #190
resolved
Hi Vladimir, I am using 4.23 version of the nimbus jose but getting below error while using JWE:
JWEObject jweObject = new JWEObject(new JWEHeader.Builder(JWEAlgorithm.A128KW, EncryptionMethod.A128CBC_HS256).contentType("JWT").build(), new Payload(signedJWT));
**The "A128KW" algorithm is not supported by the JWE encrypter: Supported algorithms: [dir] (com.nimbusds.jose.JOSEException) com.nimbusds.jose.JWEObject:319 (null)
The "A128CBC-HS256" encryption method is not supported by the JWE encrypter: Supported methods: [A128GCM] (com.nimbusds.jose.JOSEException) com.nimbusds.jose.JWEObject:325 (null) **
Can you please help?
Comments (2)
-
-
- changed status to resolved
Closing for now, but feel free to post questions.
- Log in to comment
It looks like you're trying to use the DirectEncrypter with A128KW, which doesn't support key wrapping.
Please use the AESEncrypter / AESDecrypter classes for AxxxKW and AxxxGCMKW:
http://static.javadoc.io/com.nimbusds/nimbus-jose-jwt/4.23/com/nimbusds/jose/crypto/AESEncrypter.html