Automate the token generation

hello community,
to communicate with a webservice, i need to automate the token generation (in uipath) and pass it in argument in http request.
i have a RSA private and public key, header and payload, but i couldn’t decode and hash (sign) to create the token using uipath.
Could you please help ?
Kind regards