Forum > General
JOSE JWS signing
PizzaProgram:
Delphi (XE7+) has a complete set of JOSE components on Github, including JWS signing: https://github.com/paolo-rossi/delphi-jose-jwt#using-tjwt-tjws-and-tjwk-classes
Did anyone ever succeeded to use JWS signing under FPC ?
Our (hungarian) goverment is forcing us to send detailed data from all restaurants, signing all JSON REST communication with this method.
af0815:
Be a contributor and ask Paolo Rossi for a FPC/Lazarus Version, if you need it for business.
--- Quote ---Our (hungarian) goverment is forcing us to send detailed data from all restaurants, signing all JSON REST communication with this method.
--- End quote ---
nummer8:
Check the fpc trunk version
https://gitlab.com/freepascal.org/fpc/source/-/tree/main/packages/fcl-web/src/jwt
There are already some implementations ready.
PizzaProgram:
--- Quote from: af0815 on April 21, 2022, 05:51:42 am ---Be a contributor and ask Paolo Rossi for a FPC/Lazarus Version, if you need it for business.
--- End quote ---
I've studied his code a day long, and realised:
- It is based on a very (12+ y.) old Indy-OpenSSL library (v0.9).
- Using functions long deprecated.
- It would be too much work to rewrite the whole thing, it is easier to use code available here at FPC.
--- Quote from: nummer8 on April 21, 2022, 10:39:53 am ---Check the fpc trunk version
https://gitlab.com/freepascal.org/fpc/source/-/tree/main/packages/fcl-web/src/jwt
There are already some implementations ready.
--- End quote ---
That was exactly what I was hoping for! :D
Until I've realized: only SHA + AES are implemented, RSA (RS256) not! :(
I've found an RSA encryption component here:
https://github.com/jarto/lockbox2
Maybe it is possible to combine those...
PierceNg:
--- Quote from: PizzaProgram on April 24, 2022, 02:07:58 pm ---Until I've realized: only SHA + AES are implemented, RSA (RS256) not! :(
--- End quote ---
I haven't used it myself, but Mormot2 source contains the following:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- /// implements 'RS256' RSA 2048-bit algorithm over SHA-256 using OpenSSL TJwtRS256Osl = class(TJwtAbstractOsl) protected procedure SetAlgorithm; override; end;
Navigation
[0] Message Index
[#] Next page