It is great this implementation does not require many other packages, but with phpseclib it is quite unneeded to have this dependency.
With e.g. simple JWT you can see, this task can be done just with openssl which is one of the std (default) extensions of php.