@staticmethod<EOL><INDENT>def decrypt_with_key(encrypted_token, key):<DEDENT>
try:<EOL><INDENT>jwe_token = jwe.JWE(algs=['<STR_LIT>', '<STR_LIT>'])<EOL>jwe_token.deserialize(encrypted_token)<EOL>jwe_token.decrypt(key)<EOL>return jwe_token.payload.decode()<EOL><DEDENT>except (ValueError, InvalidJWEData) as e:<EOL><INDENT>raise InvalidTokenException(str(e)) from e<EOL><DEDENT>
Decrypts JWE token with supplied key
:param encrypted_token:
:param key: A (:class:`jwcrypto.jwk.JWK`) decryption key or a password
:returns: The payload of the decrypted token