January 2018
Intermediate to advanced
336 pages
7h 56m
English
To start with the implementation of JWT with encrypted claims, first create a get-secret function to generate a secret key for encryption. Also, add a get-secret-jwk function that is used to create a JSON Web Key (https://tools.ietf.org/html/rfc7517) using the secret key generated by the get-secret function, as shown in the following code:
(ns helping-hands.auth.jwt "JWT Implementation for Auth Service" (:require [cheshire.core :as jp]) (:import [com.nimbusds.jose EncryptionMethod JWEAlgorithm JWSAlgorithm JWEDecrypter JWEEncrypter JWEHeader$Builder JWEObject Payload] [com.nimbusds.jose.crypto AESDecrypter AESEncrypter] [com.nimbusds.jose.jwk KeyOperation KeyUse OctetSequenceKey OctetSequenceKey$Builder] ...
Read now
Unlock full access