Andriy Kharchuk
Andriy Kharchuk

Reputation: 1304

Java library to parse JWT token in JWE JSON Serialization format

What opensource Java library can be used to parse/decrypt JWT token in JWE JSON serialization format as below enter image description here

I was looking at nimbus-jose (https://connect2id.com/products/nimbus-jose-jwt/) but I cannot find any releavnt example. I want to use some open source library which will require little coding and will support different encryption algorithms out-of-the-box.

Upvotes: 1

Views: 2149

Answers (1)

Spomky-Labs
Spomky-Labs

Reputation: 16775

Unfortunately the JSON Serialization modes are often missing from implementations. This is mainly due to the fact that this mode is rarely used as not URL safe.

It is possible to convert JWE from that mode to the compact mode, but only if there is no aad and header members which is not the case here.

I see only few possibilities to solve your problem:

  • Ask developers to implement that feature (can be long).
  • Develop your own implementation (not so easy).
  • Find an implementation in another language that supports that format (e.g. in PHP).

Upvotes: 1

Related Questions