Última actualización el
19 ene. 2024
Description
Create an encrypted JWT.
Syntax
createEncryptedJWT(payload, encryptOptions, config)
History
- New in ColdFusion (2023 release).
Parameters
| Parameter | Description | Required |
| payload | If the payload is a string, the method accepts it as it is. If not, the following fields will need to be passed as a struct:
|
Yes |
| encryptOptions | Create the signature using the struct below:
|
Yes |
| config | A struct with the following values:
|
Yes |
Returns
A JWT string.
Example
<cfset text = {
"iss" = "a",
"sub" = "b",
"abcd" = "efgh",
"aud" = "adobe",
"exp" = "#DateAdd("n", 30, now())#"
}>
<cfset encr = {
"keystore" = test_encryption1.keystore",
"keystoreAlias" = "contentKey",
"keystorePassword" = "****",
"keypairPassword" = "****"
}>
<cfset c = {
"algorithm" = "RSA-OAEP",
"encryption" = "A128CBC-HS256"
}>
<cfset createjwe = CreateEncryptedJwt(text,encr,c)>
<cfdump var = "#createjwe#">