String encodedHeader = "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJwMnMiOiIyV0NUY0paMVJ2ZF9DSn" +
"VKcmlwUTF3IiwicDJjIjo0MDk2LCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5Ijoi" +
"andrK2pzb24ifQ";
Base64Url base64url = new Base64Url();
Headers headers = new Headers();
headers.setFullHeaderAsJsonString(base64url.base64UrlDecodeToUtf8String(encodedHeader));
PbkdfKey pbkdfKey = new PbkdfKey(PASSWORD);
Pbes2HmacShaWithAesKeyWrapAlgorithm pbesAlg = new Pbes2HmacShaWithAesKeyWrapAlgorithm.HmacSha256Aes128();
Key derivedKey = pbesAlg.deriveForEncrypt(pbkdfKey, headers);