createEncryptedJWT

Create an encrypted JWT (JSON Web Encryption - JWE)

createEncryptedJWT(payload, encryptOptions, config) → returns string

This function requires Adobe ColdFusion 2023 and up.  Not supported on Lucee, etc.

Argument Reference

payload any
Required

The payload as a string or struct.

encryptOptions struct
Required

Encrypt using the key information from given struct

config struct
Required

A struct with the following values:
- algorithm : algorithm used for signing.
- encryption : algorithm used for encrypting the payload.
- generateIssuedAt : boolean to indicate whether to generate "iat" field
- generateJti : boolean to indicate whether to generate "jti" field

Links more information about createEncryptedJWT

Examples
Sample code invoking the createEncryptedJWT function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub