.. module:: *************** JSON Web Tokens *************** This module allows handling `JSON Web Tokens `_ from Zerynth programs. .. function:: encode(payload, key, algo=ES256) Encode a JWT for target :samp:`payload` signed with :samp:`key`. Currently only HS256 and ES256 encoding algorithms are supported (ES256 using prime256v1curve) :samp:`key` must be an ECDSA private key in hex format for ES256 or a bytes/string for HS256 If a private key is, for example, stored as a pem file, the needed hex string can be extracted from the OCTET STRING field associated value obtained from :: openssl asn1parse -in my_private.pem command (since pem is a base64 encoded, plus header, `DER `_).