code: public static String encryptValueAsJwt(final Key secretKeyEncryptionKey,
                                             final Serializable value,
                                             final String algorithmHeaderValue,
                                             final String contentEncryptionAlgorithmIdentifier) {
          try {
              val jwe = new JsonWebEncryption();
              jwe.setPayload(value.toString());
              jwe.enableDefaultCompression();
              jwe.setAlgorithmHeaderValue(algorithmHeaderValue);
              jwe.setEncryptionMethodHeaderParameter(contentEncryptionAlgorithmIdentifier);
              jwe.setKey(secretKeyEncryptionKey);
              jwe.setHeader("typ", "JWT");
              LOGGER.trace("Encrypting via [{}]", contentEncryptionAlgorithmIdentifier);
              return jwe.getCompactSerialization();
          } catch (final JoseException e) {
              throw new IllegalArgumentException("Is JCE Unlimited Strength Jurisdiction Policy installed? " + e.getMessage(), e);
          }
      }
docs: Encrypt the value based on the seed array whose length was given during afterPropertiesSet,
  and the key and content encryption ids.
  
  @param secretKeyEncryptionKey               the secret key encryption key
  @param value                                the value
  @param algorithmHeaderValue                 the algorithm header value
  @param contentEncryptionAlgorithmIdentifier the content encryption algorithm identifier
  @return the encoded value