Skip to main content
100%

Gist c2007066af4a2f2b97d4293778f8af5d

✓ Published0🌍 Public
CCarlos-Augusto
Last edited Oct 12, 2020
Created on Oct 12, 2020

This Scala example demonstrates a complete JWT (JSON Web Token) lifecycle, creating a signed token with custom claims and then verifying and decoding it. The code generates an ES256 key pair using `GeneratorKeyFactory` from the Ubirch crypto library, then encodes a token with `Jwt.encode` that includes tenant, device, UUID identifiers, and custom role claims, before decoding it back with `Jwt.decodeRawAll` to display the parsed header, payload, and signature. The visualized output is the `Try` result showing the extracted JSON claims alongside the cryptographic signature.

AI-generated description

Similar vizzes