JWS.SIGN will sign the body of a JWT using a specified algorithm and signature. Unlike
JWS.SIGN will not try to encode its payload as JSON.
Xapix currently support the HS256, HS384, HS512 algorithms.
Function category: JWT
JWS.SIGN(arg1, arg2, arg3, [args...])
String denoting the algorithm to be used.
Payload as a string to be used to generate a signature.
Signature to use in signing the JWT.
Additional set of arguments for use with certain subsets of algorithms.
If we want to create a JWT, we can use
JWS.SIGN('HS256', "any + old + string", 'password')
This would use the provided algorithm and signature to create the following JWT: