final JWEAlgorithm alg = header.getAlgorithm();
final EncryptionMethod enc = header.getEncryptionMethod();
// Generate and encrypt the CEK according to the enc method
final SecureRandom randomGen = getSecureRandom();
final SecretKey cek = AES.generateKey(enc.cekBitLength(), randomGen);
Base64URL encryptedKey; // The second JWE part
if (alg.equals(JWEAlgorithm.RSA1_5)) {