Regarding JWT (JSON Web Token), there is another plugin by Miyako: 
https://github.com/miyako/4d-plugin-jwt

Lutz Epperlein

-----Ursprüngliche Nachricht-----
Betreff: Re: HMAC SHA256 in native 4D code?

Hi, 

I had to spend some time looking into this recently myself. You have two
options:

1 - K. Miyako has a plugin - CommonCrypto. Easy to use.
        $signature:=HMACSHA256 ($keyData;$stringData;Crypto BASE64)

2 - Use PHP execute, but then encode the result (assuming you need to)
          php way if we ever need it - do not delete
          $phpOK:=PHP
Execute("";"hash_hmac";$sigBlob;"sha256";$stringToSign;$key;True)
          BASE64 ENCODE($sigBlob)
          $signature:=Convert to text($sigBlob;"utf-8")


**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to