JWT requirements
Use RS256 and include these claims:
For requests without a body, hash the empty byte string. For JSON requests, hash the exact JSON bytes sent to the API. Do not sign a pretty-printed body and send a minified body.
Node.js example
Shell and OpenSSL example
This example requiresjq, openssl, and xxd.
Python example
cURL flow
Generate the JWT immediately before calling the endpoint. Use the same exact URL, method, and body bytes for signing and sending.Multipart body hash
For multipart requests, the JWTbodyHash is not the raw multipart stream hash. Nuvera validates a canonical multipart hash after parsing fields and files:
- Convert each form field value to a string.
- Sort repeated values for a field.
- Sort fields by name and value.
- For each file, include
fieldName,fileName,mimeType,size, and the SHA-256 hash of the file bytes. - Sort files by field name, file name, size, and file SHA-256.
- Hash
JSON.stringify({ fields, files }).