Create a JWT in VBA RSASHA256

865 views Asked by At

I have automated the use of Docusign from an Access Database using https calls from VBA Now I have to change from their legacy authentication to use OAuth 2.0

I need to create a JWT and then use this to exchange for a Docusign API Access Token

I can create and encode the Header & Payload but need to generate the Signature part by encoding the Header and Payload to Base64 (which I can do) but then need to use the Private Key (also have a Public Key) which I have from Docusign and use something like RSASHA256 (as per JWT.io) to generate the Signature to add to my JWT

Does anyone know how I can create this signature element from VBA please

Thank you

1

There are 1 answers

0
Koen Rijnsent On

you could try some of this code (part of a repository I made): https://github.com/krijnsent/crypto_vba/blob/master/ModHash.bas

You do need .NET 3.5 or greater on your system, as it's used by the hashing algorithms (System.Security.Cryptography).